Profile cover photo
Profile photo
Phil Pearce
Phil Pearce's posts

Post has attachment
Hi All,

Quick question... Has anyone created a JS variable to read Xpath @id or @class - I just got asked this question in a #GTM training session & wondered if anyone had tried this already?

Many Thanks!



+Dave Elliott

Hi All,

Does anyone know the GoogleForm URL to manually send a reset password link to all Admin users on a GTM account? A company has had an employee leave and they dont know the Admin login.

Note: the GTM account is: GTM-PSKDLP

Many Thanks!


Post has attachment
Hi All,

I noticed that the free version of Google Optimize has native IP-to-country server-side lookup as part of its targeting options.

Being a cheapskate... who wants to pass on cost saving to clients & avoid to pay for a yearly MaxMind or DemandWare IP lookup... I am trying to re-use this variable for Cookie pop-ups and Triggers in GTM.

Thus... does anyone know what the name of this variable is? And is it global scoped so GTM can read it?

I`m currently running a taint test of... changing the countryCode in the Optimise UI to try to identify the variable via a Diff check. However the code minification is making this tricky!!

Note: I suspected the countryCode/cityCode/metricCode is converted into an integer location (i.e same as Adwords LocationID) hence searching for just countryCode=UK does not work :(

If I can crack this code, I`ll let you know!

Alternatively... if you know the variableName - please let me know!

Example code:




Post has attachment
I updated my generic GTM containers templates/recipes to use the new Centralised Google Settings Variable.

The generic login for these is:
password: philrulesgtm8

Or if the login does not work you can import using these links...

Generic CMS:

Wordpress (mapped to GTM for Wordpress)

Magento (mapped to Qubit dataLayer)

Drupal (mapped to plugin)


Angulartics (mapped to plugin)

AMP (new)

APP - iOS FireBase (new)

APP - Legacy



AffiliateId Monster Script (advanced example) (video) (slides) (video)



Just a Sanity check... I'm using the new centralised Google Setting Variable.

1. Does it matter if ContentGroups are declared on GA Events? (or are these ignored on GA Events & only sent on GA pageviews... so it does not matter).

2. Also, same question applies to CrossDomain autoLinker which only activates on pageviews.

3. Lastly, the 'GA object' field can not be set to inherit Centralised Google Settings, only manually set. Is this a mistake/bug?



Post has attachment
Just after a second opinion...

Assuming that GA & GTM share the same SLA on GA premium, and that the 12 hour GTM server bug/outage last week also knocked-out GA hit data... does this mean that the client is entitled to a refund of 12hours of the GAP license?

My assumption is yes, but I am after other peoples feedback...

Post has attachment
Hi All,

I have 3 use case where it is necessary to gtm.js locally:

1) Website operators in China.
2) Hosted payment portal do not allow 3rd party scripts.
3) iFrames where postMessageAPI is not possible.

For the 3rd example I see this CORS error message: SecurityError (DOM Exception 18) Blocked frame with origin "" from accessing frame with origin "": Protocols, domains and ports must match.

Thus, given this requirement has anyone tried hosting GTM locally? Does this work & what are the pitfalls?
copied to...

I understand that...
- Preview and ShareLink preview may not work.
- There would be a 1hr-ish caching delay when gtm.js is copied from remove to local.
- I would not benefit from a GEO-optimised CDN, if I host locally.

Are there any other negative connotations & has anyone done this already? (e.g. I see that Telium and Ensighten offer it as an option).

Many Thanks



Post has attachment

Post has attachment

Post has attachment
Hi All,

Just after a sanity check...

I`m stick on a problem with exclude referrals not working in Universal.

Scenario is:
- GA universal via GTM
- Exclude referrals for and added in GA settings

However, and is still shown in the referral report :(

Thus... I tried to add a JS patch via GTM...

function() {
// Clear referrals on payment portals
var regExPaymentPortal = /(^|.+\.)(3ds.+|paypal\.com|wirecard\.com|skrill\.com|giropay\.de)$/i;
if( regExPaymentPortal.test( {{Referral Hostname}} )===true ) {
return undefined; // referral

That did not work :( So, I tried to remove the risk of GA classic hits causing issue by setting setReferrerOverride to null and also disabled legacyHistoryImport...

var _gaq = _gaq || [];
_gaq.push(['_setReferrerOverride', undefined ]);
_gaq.push(['_setCampaignTrack', false ]);

That did not work :( So... I`m stumped.

- Site is on Angular running in a Safari (in-app) wrapper.
- A fixed tracker name is being used to avoid rogue referrals.
- Thankyou page is on SSL thus referral is passed to this SSL page.
- There is a chance that there is another Thankyou page which does not have setReferral=null, but this would not explain why the serverside settings for exclude referrals is not working.

Any ideas welcome!



Wait while more posts are being loaded