Custom linker name for iframe cross domain tracking

Ecommerce platforms like Eventbrite requires custom linker name for cross-domain tracking to get working, as most of the user’s iframes for ticket selection it becomes pretty hard to do things easily, but if you use GTM, things work well in just a few steps with a hitCallback that executes a customJs variable when GA loads.

Below is the CustomJS to be used in GTM.

Normal linker name in Google Analytics cross-domain tracking is _ga while for Eventbrite it requires custom name – _eboga

If all is well you will get this:- custom linker name with GA client id decorated over the iframe source link.

Obtaining analytics clientId directly from cookie variable

Ever since cookie variable was introduced, obtaining clientId  became pretty easy . In this method, we will use the Cookie Variable in GTM.  ( old post for extracting clientId with CutsomJs)

So, let’s start with the basics that, the  “_ga” is the name of GA cookie that stores the client id.



now we will go ahead and create a new variable of type “1st Party Cookie”  and at variable part give the name of cookie – “_ga”. This variable will extract the value of the cookie with name “_ga” .



Now, as usual, debugging / previewing  the job.


Getting rid of GTM host events in Mixpanel

Anyone who have played around with Mixpanel implementation with GTM would have seen BOTs triggering events like below.

mixpanel gtm

To solve the issue, we would just need some JavaScript code. But let’s see the logic before discussing that, you will notice that the Current URL of GTM generated events will be always on domain , so the best thing to do is to block events from domain / host

For this, we will enclose the GTM MIXPANEL EVENT CUSTOM HTML tag in a JavaScript if statement which will check the host of the domain and execute the code.

Above, code will check if the document location and on the mismatch with it would execute the Mixpanel event. Thus filtering out all the GTM generated events.

Obtaining Google Analytics ClientID with Tag Manager

Anyone dealing with Measurement Protocols / CRMs will always need ClientID for tasks like sending offline transactions, managing leads/ refunds etc.. so that an exact user is matched with associated hit /record.

Searching the web I found 3 ways to fetch the client using GTM, both have same procedure but different CustomJs variable.

Continue Reading