Sunday, 15 January 2012

javascript - Google Analytics event not working in iframe -



javascript - Google Analytics event not working in iframe -

i build pages on clients website can iframe on partners websites. included ga code on website.

var _gaq = _gaq || []; _gaq.push(['_setaccount', 'ua-1494300-1']); _gaq.push(['_setdomainname', 'mysite.com']); _gaq.push(['_trackpageview']); (function () { var ga = document.createelement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(ga, s); _gaq.push(['_trackevent', 'iframe', '/products/default.aspx', 'petersburg- zip code:26847',, false]); })();

i've verified code shows , beingness called when site pulled in , iframe, however, not getting event info in ga. i've read on iframes , ga tracking , of issues seem result of cross domain limitation. however, implementation not need info parent , parent doesnt need info me need event data. ideas?

google analytics depends on cookies. cookies within iframe in different domain technically speaking 3rd party cookies. 3rd party cookies blocked safari default. should still see traffic chrome , firefox users, except minority of users alter default settings.

for net explorer traffic must create sure implement p3p compact policy in response of iframe. otherwise 3rd party cookies blocked well.

read more how set p3p cp headers google analytics.

javascript google-analytics

No comments:

Post a Comment