Avoid AdBlockers with Data Tag and Data Client

Dear Stape community,

I have doubts about how to properly configure server-side tracking with Data Tag and Data Client to avoid AdBlockers. I state that I have already configured the SERVER container using a custom URL and I changed the GTM tracking code on my site to use my subdomain.

Here are my questions:

1) Transport URL / Data Tag / Data Client

To avoid AdBlockers I have to add the transport URL to the tags of UA, GA4 etc. in the WEB container and also use Data Tag and Data Client or use only Data Tag and Data Client?

2) Send the data to the server avoiding the AdBlockers

My site is built with Prestashop and I use the Google Tag Manager Premium module which manages GTM, events and datalayers. I have the following tags configured in the WEB container:

How should I proceed to configure Data Tag and Data Client so as to be able to track all the events I have in the WEB container avoiding AdBlockers?

Thanks so much.

Hi Serhiy,

If I understood everything correctly, you got everything done but would like to throw in some extra resistance to adblockers for GA4, correct me if I’m wrong here.

The blocking happens on web-to-server transfer stage, so the answer to your question is something like this: instead of using GA4 tags to send events to server (where they are handled by GA4 client) you should instead use Data Tag/Data Client and then trigger GA4 server-side tags of off Data Client events.

That is how you add extra layer of blocking protection to GA4.

Let me know if this makes sense - typing on the go.

Thanks. Dan

1 Like

Thank you so much for answering Dan,

taking into account that I have all the tags with their triggers, variables and templates configured in the WEB container that I share below:

what is the fastest way to implement Data Tag and Data Client?

Can I create for each UA or GA4 tag in the WEB container a corresponding tag of the Data Tag type in which I insert all the settings of the original UA or GA4 tag?

For example something like this:

Thanks again.

Hey,

Yes, you did that just right - you essentially need to replace the “transferring agent” from GA4 to Data Tag, for all events.

Now on server container trigger GA4 of off your newly created Data Tags (received by Data Client) and there you go. So for purchase (server) you would have a trigger: custom event === purchase, Client Name equals Data Client.

small tip: if you leave current WEB ga4 tags as is, they will report in parallel with DataTags, so keep that in mind

1 Like

Hi Dan,

for GA4 I have set all the events as you advised me, also in the WEB container I have paused the GA4 tags so as not to track duplicate events, maybe later I will enable them by sending the events to another GA4 property to see the differences with Data Tag and Data Client. If it may be useful to someone, I would like to point out that you have to pay attention to the name of the event that is set in the WEB and SERVER triggers, they must be set up as follows:

  • WEB - Data Tag - Event name: view_item
  • WEB - Data Tag Trigger - Event name: view_product
  • SERVER - Trigger - Event name: view_item

and not:

  • WEB - Data Tag - Event name: view_item
  • WEB - Data Tag Trigger - Event name: view_product
  • SERVER - Trigger - Event name: view_product

that is, in the tags on the SERVER container, the triggers must be set so that the name of the event coincides with the name of the event sent by the Data Tag and not with the event name of the Data Tag trigger.

Also for all events I have enabled:

  • Send common data

because as per documentation:

https://support.google.com/analytics/answer/9234069

GA4 with its WEB tags sends the following parameters with every event, including custom events:

  • language
  • page_location
  • page_referrer
  • page_title
  • screen_resolution

is this reasoning correct?

However, I have a doubt regarding the page_view event for GA4 as in my WEB container it was sent via a GA4 Settings tag. Therefore I have configured a Data Tag and a Data Client as follows:

Note that I have enabled in the Data Tag page_view:

  • Send all from Datalayer
  • Send common data

Is it correct to also enable “Send all from Datalayer” for this tag or is it not necessary?

Once all this has been done, GA4 traces the events in the reports and in the event count in the real-time view, but the number of users in the last thirty minutes is always 0 and also the user snapshot function in the same view does not report anything.

Furthermore, if I keep the SERVER container preview mode active, the events are immediately sent and displayed in the real-time view on GA4 while with the preview mode closed the events are displayed after about 10 minutes and I’m not even sure if they are all sent, even if according to the documentation, real-time events should take 1 minute to process:

https://support.google.com/analytics/answer/11198161?hl=en

is this delay normal?

To explain better regarding the delay, the events traced without preview mode are circled in red and those traced with the preview mode active in green:

page-view-comparison

As you can see, with the preview mode active all the events are sent immediately and simultaneously while without the preview mode they take about 10 minutes.

Thanks again.

Hey,

  1. Certainly, your triggers should correspond in the way you described, there is no connection between triggers on the web and server, so you need to handle that, which you did properly.

  2. That’s a very good idea to unpause GA4 tags and report to another property for comparison.

  3. Sending common data is correct, yes. Sending stuff from data layer - that’s a judgement call wether you need to send that, depends on the state of your DL and what data is there, your setup and some other things.

  4. PageView event - I recommend to check off that box, and send page_view explicitly. Only make sure config has already fired at page_view occurrence, I normally set config tag to ‘All pages’ and my page_views to ‘DOM Ready’

  5. Things you see in ‘real time’ will not appear in other UIs immediately, I don’t recall actual timings (and they may vary) but the safest approach is to always look at GA as a 24h old data.

  6. Lastly, I can’t quite comment on the delay, there might be dozens of reasons, but so long as your events actually land in GA4, I’d say you’re good to go :slight_smile:

1 Like

Thanks Dan,

I did not fully understand point 4. Could you explain to me how I can emulate the GA4 Configuration tag with Data Tag and Data Client?

Also as reported by the Analytics documentation:

https://support.google.com/tagmanager/answer/9442095?hl=en

The Google Analytics: GA4 Configuration tag initializes Google Analytics for your Google Analytics 4 property on a particular page. It handles behavior such as setting of Google Analytics cookies, sending automatic and enhanced measurement events, and declaration of common settings.

In addition to the page view events, this tag also sends automatic and enhanced events. Should I create a Data Tag for each of these events?

Hey,

you don’t need to switch off the configuration tag, just switch off the setting for it to also send page_view, instead send one explicitly with Data Tag, as you do with other events.

Screenshot 2022-01-14 at 19.28.07

for the second part, well…you could setup similar events but I say that would be redundant.

1 Like

Is it necessary to have the configuration tag active?

Couldn’t I disable the GA4 configuration tag and create various Data Tags that send the various parameters, enhanced and automatic events?

Because in any case the cookies would be set by the Data Tags and prolonged by the Data Client by enabling:

Automatically prolong Data Tag cookies

furthermore the client_id would be set by the Data Client by enabling:

Always generate client_id parameter

Or does the GA4 configuration tag have other functions that cannot be replicated with the Data Tag and Data Client?

And also if I activate the configuration tag I should also configure:

  • a GA4 client in the SERVER container to receive information, automatic and enhanced events sent by the GA4 Configuration tag
  • a GA4 tag in the SERVER container to send that information to GA4

But this exchange of information would take place without protection from AdBlockers or am I wrong?

Excuse my ignorance with these new features and thanks for your patience.

  1. Yes it is necessary to have a GA4 config tag, there is no way to replicate it, there is stuff under the hood

1.5 yes, keep both settings on

  1. GA4 client on the server is a must, yes, it will handle all those events that GA4 does automatically

  2. GA4 tag(s) on the server you should trigger of off everything that comes through GA4 Client + a selection of you Data Client handled events (so not all of them)

1 Like

Perfect, thanks Dan, I set everything up as you explained to me.
On the other hand, regarding Universal Analytics I would like to know if it is possible to reproduce with:

  • Data Tag
  • Data Client
  • UA SERVER tag

a UA WEB tag like this:

Tag Example:

Google Analytics Settings Example:

Custom dimension (Index) example:

Custom dimension (Dimension value) example:

My doubt is how to manage:

  • The Fields to Set of the Google Analytics settings variable
  • Custom Dimensions that use templates as values

with:

  • Data Tag
  • Data Client
  • UA SERVER tag

That is, I would like to know where to insert:

  • Fields to Set
  • Custom Dimensions

Thanks again.

Serhiy,

Not sure if DC will map data for UA correctly, you could check that actually, should anything you trigger of off DC and sent with UA tag actually land in analytics - well there’s that.

However, I believe there’s a lot of stuff going on under the hood (as is with GA4 btw) so unless you got a lot of time or there’s a very particular reason for this, I would stick to native tags. Ideally, set both in parallel (maybe to different properties) and compare.

1 Like