Question

I have set up cross browser tracking in google analytics in order to track goals. However at Goal Flow I only see my domain (mysite.com) listed at Visits by Source. I have set up tracking in the following way:

All non secure pages of my website contain the following code:

 <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_setDomainName', '.mysite.com']);
  _gaq.push(['_setAllowHash', false])
  _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);
   })();
 </script>

The secure pages of my website, where the goals are realized, contain the following code:

 <script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_setDomainName', '.my-securesite.com']);
  _gaq.push(['_setAllowHash', false]);
  _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);
   })();
 </script>

The form that pushes data from the non-secure page to the secure page contains the following data:

<form id="21343" method="post" action="https://my-securesite.com" onsubmit="return _gaq.push(["_linkByPost", this]);">

Looking at the source of the page I do see all the utmx data being posted:

 action="https://my-securesite.com/confirm.php?__utma=XXXXXXXXXXX" onsubmit="return _gaq.push(["_linkByPost", this]);">

Once I access mysite.com via for example a search on Google I do see the following utmx definition when posting data to my-securesite.com:

 utmcsr=google|utmccn=(organic)|utmcmd=organic|

So apparently the code posts the right source....

What am I doing wrong here?

Was it helpful?

Solution

I discovered the reason why GA didn't display the right source for my goals:

I used this tracking code:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_setDomainName', '.mysite.com']);
_gaq.push(['_setAllowHash', false])
_gaq.push(['_trackPageview']);

I was informed that the right tracking code now looks like:

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
_gaq.push(['_setDomainName', '.mysite.com']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

As _gaq.push(['_setAllowHash', false]) is no longer used.

Besides that I used GA's option to track additional pageviews at the checkout page. I used to work with this code:

<script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
   _gaq.push(['_trackPageview','/funnel/G1/Page-name']);
</script>

However the right code is:

<script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-XXXXXXX-Y']);
   _gaq.push(['_setDomainName', '.my-securesite.com']);
   _gaq.push(['_setAllowLinker', true]);
   _gaq.push(['_trackPageview','/funnel/G1/Page-name']);
</script>

Since I implemented these changes GA tracks the source of my goals correctly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top