Greconomist
Greconomist

Reputation: 396

Tracking non-js hits via google tag manager

I was reading Simo's blog trying to identify a way to track non-js-enabled hits. A solution is given at the comments by a user with the moniker Duncan. He suggests creating a new custom js variable in Google Tag Manager:

function(){
return true;
}

Then the commentator suggests creating `a rule which matches on 'Does not equal: true'. I do not understand this bit. What does the commentator mean by 'a rule' and how do I realize this? Can somebody guide me.

Upvotes: 0

Views: 165

Answers (2)

J88
J88

Reputation: 829

  1. Create a custom JS variable enter image description here
  2. Create a new trigger, for example a pageview trigger, and in the conditions options do the following enter image description here
  3. Now this trigger should only fire when there's a pageview in a browser that does not have Javascript on because then the function will never execute and it will never be true.

Upvotes: 1

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

This is a Javascript variable. If javascript is disabled it will not be executed. Therefore the value is never equal to true in a browser that does not execute javascript.

Since there is a supported way of passing in variables (i.e. appending them to the url of the noscript iframe) I don't think you need to use such a workaround, funny as it might be.

Upvotes: 0

Related Questions