Analytics
5.1K members online now
5.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Cross domain event tracking on iframe and different domains

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hey guys,

 

Well, I have a little problem for a while and my little knowledge on code is not helping me.

 

The problem:

- I have an iframe on a domain on a server A;

- I have a website on a server B;

- The website has classic Google Analytics. 

- I have the iframe on the website and I need to track just the events on my website GA account.

 

Searching for answers to this problem, I found this:

 

Tracking Between a Domain and a Sub-Directory on Another Domain - Another common tracking scenario is to track visitor and traffic data between a single domain and a sub-directory of a different domain. This might occur when you want to track traffic between your website and your online blog, where your blog is limited to a sub-directory of the blog service. The follow example URLs each contain recommended customizations for the tracking code on both pages.

 

problem.PNG

 

Can someone:

1. Explain to me how it works things that aren't scripts?

2. Will this work in my case?

 

Thank you so much!!!!

Re: Cross domain event tracking on iframe and different domains

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭
Hey Roberta,

If the iframe exist on your website then
- google analytics classic code should be present on both iframe and website
- before loading the iframe you would need to append linker parameters in the iframe url and would have to append this in your classic code
_gaq.push(['_setAllowLinker', true]);

Or you can use this
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite#trackingIFrames

Bookmark the Analytics FAQ as a future resource http://marketlytics.com/analytics-faq
Hope this helps,

Noman Karim

Re: Cross domain event tracking on iframe and different domains

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
I think I got it... but, doing this it will fire a pageview for the page and another one for the iframe that is inside the page, right? I just need to track the event on the iframe.
Is there a way to do this without count the iframe pageview?

Thank you!