Reputation: 23211
I have a situation where _trackPageview
will be called. Then, afterwards I have a _customVar
populated.
Is there any way to get this into the page tracking without doing another _trackPageview
or _trackEvent
. We don't want duplicate page views, and we don't want to interfere with existing event-based reports.
Upvotes: 1
Views: 95
Reputation: 22832
Nope. You need to send some kind of hit. It's usually better to fire with a dummy Event that is non-interactive.
_gaq.push(['_setCustomVar', 1, 'name', 'val', 1]);
_gaq.push(['_trackEvent', 'CV', 'set', '', 0, true]); //non interactive event
you can also use another hit type like Social or Timming event. That will make it not show up on the event reports and if you don't use Social or timing reports it might be good. But I would recommend sticking to the normal Event and just ignore it from the reports.
Upvotes: 2