I'm using an embedded template to include the for my site. I want to use Google Analytics custom variables to track visitor information for logged in users so thought I could selectively show the Analytics code if a user is logged in using the {if logged_in} conditional.
So in a tag have put the following:
{if logged_in}
// define a Visitor-level Custom Variables based on the member ID
_gaq.push(['_setCustomVar',1,'Member ID','{member_id}',1]);
{/if}
If the user is logged in then the code works as expected. However if a member is not logged in the template is writing the following to my HTML:
{if FALSE}
// define a Visitor-level Custom Variables based on the member ID
_gaq.push(['_setCustomVar',1,'Member ID','0',1]);
{/if}
Any thoughts why this might be happening? I would expect that if nobody is logged in the site would return nothing.
Cheers,
Cole