Mobile app version of vmapp.org
Login or Join
Tiffany637

: Google Analytics multi-domain iframe counted as new visitor I work for a company that has a large number of marketing sites, each of which pull in some info to an iFrame from another domain.

@Tiffany637

Posted in: #Analytics #Iframe

I work for a company that has a large number of marketing sites, each of which pull in some info to an iFrame from another domain. I'm trying to track visitors through a given marketing site, to the page with the frame, and then through various pages in the frame. I have done quite a bit of reading on multi-domain tracking in GA, but can't seem to get it to recognize a visitor to a marketing site and the framed page as a single visitor.

On the marketing sites as well as on the pages within the frame, I use this GA code:

_gaq.push(['_setAccount', 'UA-XXXXXXX-14']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);


I load my iFrame with the following code:

_gaq.push(function() {
var pageTracker = _gat._getTrackerByName();
var iframe = document.getElementById('my_frame');
iframe.src = pageTracker._getLinkerUrl('www.myurl.com');
});


Using GA Debug in Chrome, it appears that the GA parameters are being appended to the URL of the iframe correctly. Despite this, while viewing the "real-time overview", it shows a single visitor while I browse the marketing site until I get to the page with the frame, at which point it shows 2 unique visitors. This also breaks the "visitors flow" report, which shows a drop off at the page with the frame, instead of continuing to the new domain in the frame. Any suggestions or obvious problems?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

1 Comments

Sorted by latest first Latest Oldest Best

 

@Becky754

You'll need to set the domain name of the parent page in this line of course:

_gaq.push(['_setDomainName', ' example-parent.com,']);


And this line should contain the URL to the iFrame content as specified here:

iframe.src = pageTracker._getLinkerUrl('http://www.my-example-iframecontent.com/');


This will pass the cookie information to the iFrame (note the privacy settings issue with IE 6+ covered there). However, this will still result in additional pageviews because each iFrame in itself is a page that gets loaded into the browser, so you'll need to create a custom filter to show them by separate domain as covered at the bottom of this.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme