Crossdomain Tracking With Redirect Issues

2,327 views
Skip to first unread message

Brad Stewart

unread,
Feb 11, 2014, 6:07:45 PM2/11/14
to google-analyti...@googlegroups.com
I am setting up cross domain tracking and i've discovered an issue where I am losing tracking between two domains when the destination domain has a redirect before the page (cart) with the universal code on it.  The redirect ends up stripping the _ga token off the url so everything looks like a new visitor to the destination domain.  Is there any way to prevent this from happening?

Eduardo Cereto Carvalho

unread,
Feb 11, 2014, 11:14:02 PM2/11/14
to Brad Stewart, google-analyti...@googlegroups.com
That's unfortunately a known issue and not something technically possible to solve in the product, you'll have to either get rid of redirect by linking directly to the destination page or make sure that the redirect keeps the parameter in the urls. 

--
Eduardo Cereto


On Tue, Feb 11, 2014 at 9:07 PM, Brad Stewart <br...@eiffelcrown.com> wrote:
I am setting up cross domain tracking and i've discovered an issue where I am losing tracking between two domains when the destination domain has a redirect before the page (cart) with the universal code on it.  The redirect ends up stripping the _ga token off the url so everything looks like a new visitor to the destination domain.  Is there any way to prevent this from happening?

--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-ana...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Brad Stewart

unread,
Feb 12, 2014, 12:22:35 PM2/12/14
to google-analyti...@googlegroups.com, Brad Stewart
That's what I figured, thanks Eduardo!

--
Eduardo Cereto


To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-analyticsjs+unsub...@googlegroups.com.

Samy

unread,
Feb 13, 2014, 5:37:37 AM2/13/14
to Brad Stewart, google-analyti...@googlegroups.com
Hi Brad

As suggested by Edurado, If you can get the _ga token to be forwarded from the link to the redirected url, It would work.

Thanks
Samrat D'souza



To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-ana...@googlegroups.com.
Message has been deleted
Message has been deleted

Brad Stewart

unread,
Feb 26, 2014, 10:04:32 PM2/26/14
to google-analyti...@googlegroups.com, Brad Stewart
I have the _ga token forwarding to the booking engine now, however all my referrals still show up as the booking engine.

This is the code on the main site:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxx-1', {
  'cookieDomain': 'mainsite.com',
  'allowLinker': true
  });

  // Load the linker plugin.
  ga('require', 'linker');

  // Define which domains to autoLink.
  ga('linker:autoLink', ['mainsite.com', 'bookingengine.com'], false, true); 
  ga('send', 'pageview');

</script>

And this is the code on the booking engine:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create','UA-xxxxx-1','auto',{
'allowLinker':true
});
ga('send', 'pageview');


Anyone see any issues? Kind of stumped.

On Thursday, February 13, 2014 3:37:37 AM UTC-7, Samrat D'Souza wrote:
Hi Brad

As suggested by Edurado, If you can get the _ga token to be forwarded from the link to the redirected url, It would work.

Thanks
Samrat D'souza

On Wed, Feb 12, 2014 at 6:22 PM, Brad Stewart <br...@eiffelcrown.com> wrote:
That's what I figured, thanks Eduardo!


On Tuesday, February 11, 2014 9:14:02 PM UTC-7, Eduardo Cereto Carvalho wrote:
That's unfortunately a known issue and not something technically possible to solve in the product, you'll have to either get rid of redirect by linking directly to the destination page or make sure that the redirect keeps the parameter in the urls. 

--
Eduardo Cereto


On Tue, Feb 11, 2014 at 9:07 PM, Brad Stewart <br...@eiffelcrown.com> wrote:
I am setting up cross domain tracking and i've discovered an issue where I am losing tracking between two domains when the destination domain has a redirect before the page (cart) with the universal code on it.  The redirect ends up stripping the _ga token off the url so everything looks like a new visitor to the destination domain.  Is there any way to prevent this from happening?

--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-analyticsjs+unsubs...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Samy

unread,
Feb 27, 2014, 2:17:02 AM2/27/14
to Brad Stewart, google-analyti...@googlegroups.com
Hi Brad

Important: Before you implement cross domain tracking, you should configure your Google Analytics property to ignore the destination domains as self-referrals through the admin section of the web interface.

Have you added bookingengine url as internal link:
https://support.google.com/analytics/answer/2795830?hl=en&ref_topic=2790009

Thanks
Samrat


On Thu, Feb 27, 2014 at 4:02 AM, Brad Stewart <br...@eiffelcrown.com> wrote:
engine.

This is the code on the main site:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxx-1', {
  'cookieDomain': 'mainsite.com',
  'allowLinker': true
  });

  // Load the linker plugin.
  ga('require', 'linker');

  // Define which domains to autoLink.
  ga('linker:autoLink', ['mainsite.com', 'bookingengine.com'], false, true); 
  ga('send', 'pageview');

</script>

And this is the code on the booking engine:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create','UA-xxxx-1','auto',{
'allowLinker':true
});
ga('send', 'pageview');


Anyone see any issues? Kind of stumped.


On Thursday, February 13, 2014 3:37:37 AM UTC-7, Samrat D'Souza wrote:
Hi Brad

As suggested by Edurado, If you can get the _ga token to be forwarded from the link to the redirected url, It would work.

Thanks
Samrat D'souza

On Wed, Feb 12, 2014 at 6:22 PM, Brad Stewart <br...@eiffelcrown.com> wrote:
That's what I figured, thanks Eduardo!


On Tuesday, February 11, 2014 9:14:02 PM UTC-7, Eduardo Cereto Carvalho wrote:
That's unfortunately a known issue and not something technically possible to solve in the product, you'll have to either get rid of redirect by linking directly to the destination page or make sure that the redirect keeps the parameter in the urls. 

--
Eduardo Cereto


On Tue, Feb 11, 2014 at 9:07 PM, Brad Stewart <br...@eiffelcrown.com> wrote:
I am setting up cross domain tracking and i've discovered an issue where I am losing tracking between two domains when the destination domain has a redirect before the page (cart) with the universal code on it.  The redirect ends up stripping the _ga token off the url so everything looks like a new visitor to the destination domain.  Is there any way to prevent this from happening?

--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-analyticsjs+unsubs...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-analyticsjs+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Brad Stewart

unread,
Feb 27, 2014, 9:43:30 AM2/27/14
to google-analyti...@googlegroups.com, Brad Stewart
Thanks, at one point I thought that I had read that the auto-linker would take care of that automatically.  Must be confusing that with UA only taking care of the source domain?  Regardless, I'll add that and see if it fixes the issue.  Thanks.
Reply all
Reply to author
Forward
0 new messages