I have installed this tracking code. I would like to track if the page being viewed by the user is private or a public page.
This is my code below.
If the page is public, public is assigned where the word 'public' is currently being shown, if it is private, then private is assigned instead.
When I log into my analytic account the user defined variable only has 'not set' - I cannot see wither public or private there?
I have set this up over 24 hours ago so don't think it's a delay problem.
Is there something wrong with this code?
It is placed as the last part of the head before </head>
var _gaq = _gaq || ;
_gaq.push(['_setCustomVar', 1,'Page Type', 'public', 3]);
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);