Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

In our main aspx page we have this analytics code

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1301114-2']);
  _gaq.push(['_setDomainName', 'florahospitality.com']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);
  _gaq.push(function() {   
  var pageTracker = _gat._getTrackerByName();   
  var iframe = document.getElementById('reservationFrame');   
  iframe.src = pageTracker._getLinkerUrl('https://reservations.synxis.com/xbe/rez.aspx?Hotel=15159&template=flex&shell=flex&Chain=5375&locale=en&arrive=11/12/2012&depart=11/13/2012&adult=2&child=0&rooms=1&start=availresults&iata=&promo=&group='); });

  (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>

Then inside this aspx page is an iframe. Inside the iframe we setup this analytics code

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-1301114-2']);
  _gaq.push(['_setDomainName', 'reservations.synxis.com']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview', 'AvailabilityResults']);

  (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>

The problem is I see to pageview when I go to find the AvailabilityResults page. The first one is a direct traffic and the other one is a cpc.

How come that they have different source? I was expecting that both of them is using a direct traffic.

share|improve this question
    
Do you have any campaigns setup? Any custom tracking on URL's such as utm_source? How about Goals and funnel paths? –  Anagio Dec 15 '12 at 20:51

1 Answer 1

The iframe page loads after the main page has rendered the iframe element. So the flow would be -

  1. Main Page is requested
  2. Main page is being rendered and loaded
  3. Iframe Page is requested from within the main page
  4. Iframe page is being rendered and loaded

This will mean that the iframe page will always show up as a Direct traffic. The Main page would show differing sources.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.