AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
4.1K members online now
4.1K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

eCommerce Tracking through an iFrame

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

One of the sites I work on went through and update and they are now running the third party booking engine through an iFrame.

 

Ever since the site has been updated revenue from CPC has completely dropped off a cliff. We're still getting the same amount of revenue but just not in cpc. I have implemented the code with the iframe coding. I'm having to implement the classic code because the third party shopping engine is still on that code. 

 

Here is the code I'm using. Any idea what I might be doing wrong?

 

<script type="text/javascript">

  var _gaq = _gaq || [];

  _gaq.push(['_setAccount', 'UA-xxxxxx-1']);

_gaq.push(['_setAllowLinker', true]);

_gaq.push(['_setDomainName', '.website.com']);

  _gaq.push(['_trackPageview']);

 

 

_gaq.push(function() {

  var pageTracker = _gat._getTrackerByName();

  var iframe = document.getElementById('iframeelementid');

  iframe.src=pageTracker._getLinkerUrl('https://iframeurl.com');

});

  (function() {

    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;

    ga.src=('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

  })();

</script>

 

 

1 Expert replyverified_user

Re: eCommerce Tracking through an iFrame

Rising Star
# 2
Rising Star
Hi Simon,

Iframes are the scourge of Satan and should be driven from the earth. Smiley Happy What's worse is you have to use classic GA! You should request, nay demand that they third party updates to Universal as Cross Domain is much more reliable.

That said, what you are looking for is the cookie values to be passed to the iframe. Is this the version of the code that is on both domains?

Best,

Theo Bennett
Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

Re: eCommerce Tracking through an iFrame

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Yes! iFrame suck seriously and the third party booking engine are really
lazy. You wouldn't believe what I had to go through to get them to install
this version of GA when it was current. Getting them to upgrade... forget
it! They won't even install AdWords conversion tracking, I'm told they are
cheap though so I suppose there is that.

This is the code that is running on the third party booking engine

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxx-1']);
            _gaq.push(['_setAllowLinker', true]);
      
        _gaq.push(['_setDomainName', 'thirdpartybooking.com']);
        _gaq.push(['_trackPageview','/Availabilities']);

   
    (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);
    })();
</script>



Do you think it might be something to do with the .js library that I'm
calling. I'm using dc.js on the main site but they are using ga.js on the
third party site. I'm doing this on another site and it seems to work. Also
I'm wondering if I'm missing a _linkbypost wrapper on a button.

I've looked at the cookie values for both cookies and they seem to transfer
but I haven't test it for cpc. However I can't see why it would change for
cpc and not organic.