Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8766347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:31:46+00:00 2026-06-13T16:31:46+00:00

The tracking code on the site in question, site2, appears as follows: <script type=text/javascript>

  • 0

The tracking code on the site in question, “site2”, appears as follows:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
  _gaq.push(['_setDomainName', 'site1.com']);
  _gaq.push(['_setAllowLinker', true]);
  _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>
</body>
</html>

Here is a screenshot of the debugger on that site:

Screesnhot of GA Debug

The _setDomainName method on the preceding domain, “site1” has a period before it:

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
  _gaq.push(['_setDomainName', '.site1.com']);
  _gaq.push(['_setAllowLinker', true]);
  _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>

While this may or may not prevent cookies from being passed along to the second domain, the tracking code should still at least fire, no? It is important to note that we own both domains. I cannot find any reason that would cause the code not to trigger, except perhaps an error elsewhere on the page. I am using GA Debug to see whether or not the beacon is being sent. It’s being sent on site1, but not on site2.

Thanks for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:31:47+00:00Added an answer on June 13, 2026 at 4:31 pm

    _setDomainName tells the Google Analytics cookie where to store itself. Browsers will not let set a cookie on site1.com from site2.com. Leave .site1.com on you main site and update it to .site2.com on your second.

    If you’d like visit data between domains, you have to do one of the following:

    • Tag the links between the domains using linkByPost etc… Read the google documentation about it here: https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite
    • OR I’d recommend looking into Google Analytics on Steroids as they solve this use case more elegantly: https://github.com/CardinalPath/gas#cross-domain
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed the below google tracking code in my site var _gaq =
The Async Tracking code in Google Analytics looks like this: var _gaq = _gaq
We have an older site which still uses the ancient gat Analytics tracking code
I've got Google conversion tracking code (small bit of JavaScript) on a confirmation page
The Google Analytics setup instructions state: This tracking code snippet should be included in
I've got a piece of tracking code which is capturing REMOTE_HOST , SERVER ,
I know that I need to add the tracking code snippet at the bottom
Today I was tracking down a floating point exception in some code I had
This is my page code: <!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Marketing Tracking</title> </head>
I am looking for code, examples, library, components for using google analytics event tracking

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.