javascript - Using custom variable in GA event tracking -



javascript - Using custom variable in GA event tracking -

i trying custom variable event tracking in dynamic templating system. uses info url utilize variable.

there nil coming across analytics script appended. can see wrong it?

jquery(function icatgafunction() { jquery('#catbanner').click(function () { var url = jquery(location).attr('href'); // current url var icat = url.substring(url.lastindexof('/') + 1); // lastly index of url icat reference _gaq.push(['_setcustomvar', 1, 'icatbanner', icat]); // ga snippet }); }); jquery('#catbanner').find('a:first').attr('onclick', 'icatgafunction()'); // wrap first href around <img> , phone call function onclick

i followed instructions here - perhaps scope? https://developers.google.com/analytics/devguides/collection/gajs/methods/gajsapibasicconfiguration#_gat.ga_tracker_._setcustomvar

javascript jquery google-analytics event-tracking

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -