Profile cover photo
Profile photo
James Leonard
About
Posts

Post has attachment
+ADThomesecurityuk have worked with a number of contributors, including +Victim Support +North Wales Police +Avon and Somerset Constabulary +Crime Prevention and Neighbourhood Watch to produce this graphic >>
Add a comment...

Post has attachment

Post has attachment
All about Light Water Valley roller coaster!
Add a comment...

Hi All - so I have a question about tracking two different accounts on one page.

I have: 

One domain I want to cross sub-domain track (UA-XXXXX11-1)
    - www.domainA.com
    - secure.domainA.com
 
One domain which I want to cross domain track (UA-XXXXX22-2)
    - from www.domainB.com 
    - to www.domainA.com

These are using two different GA accounts.
(UA-XXXXX11-1)
(UA-XXXXX22-2)

Would the following code work correctly? This would be implemented on www.domainA.com


<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX11-1']);
  _gaq.push(['_setDomainName', ‘domainA.com']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['b._setAccount', 'UA-XXXXX22-2']);
  _gaq.push(['b._setDomainName', ‘domainA.com']);
  _gaq.push(['b._setAllowLinker', true]);
  _gaq.push(['b._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>

I would then set up the cross links on www.domainB.com which link to www.domainA.com

My worry is parsing the correct cookie information to the correct trackers.

Many thanks in advance. 
James

Hi All - so I have a question about tracking two different accounts on one page.

I have: 

One domain I want to cross sub-domain track (UA-XXXXX11-1)
    - www.domainA.com
    - secure.domainA.com
 
One domain which I want to cross domain track (UA-XXXXX22-2)
    - from www.domainB.com 
    - to www.domainA.com

These are using two different GA accounts.
(UA-XXXXX11-1)
(UA-XXXXX22-2)

Would the following code work correctly? This would be implemented on www.domainA.com


<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX11-1']);
  _gaq.push(['_setDomainName', ‘domainA.com']);
  _gaq.push(['_trackPageview']);
  _gaq.push(['b._setAccount', 'UA-XXXXX22-2']);
  _gaq.push(['b._setDomainName', ‘domainA.com']);
  _gaq.push(['b._setAllowLinker', true]);
  _gaq.push(['b._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>

I would then set up the cross links on www.domainB.com which link to www.domainA.com

My worry is parsing the correct cookie information to the correct trackers.

Many thanks in advance. 
James

Post has attachment
Add a comment...

Post has shared content
Add a comment...

Add a comment...

Post has shared content
Add a comment...

Post has attachment
Check the +ADT Fire & security Infographic showing a heat map of alarm activations in the UK - Leeds has suffered badly!
Add a comment...
Wait while more posts are being loaded