Unstoppable Domains

Analytics code, 2 tracking codes on 1 domain

Spaceship Spaceship
Watch

oberheimer

Established Member
Impact
51
I have 1 host and i have linked two domains to the same directory on my host

.se and .co
Now i want to track the domain individually on analytics

Here is the code i have used, but is it right?

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker1 = _gat._getTracker("[UA-00000000-1]");
pageTracker._trackPageview();
} catch(err) {}
try {
var pageTracker2 = _gat._getTracker("[UA-00000000-0]");
pageTracker2._trackPageview();
} catch(err) {}
</script>

I have aded this filter to only include the hostname www\.domain\.se and then one for the .co
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Insert different javascript code according to domain name on the server side. I think it's better. If php is used for server side scripts so not any problem to use condition
 
0
•••

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back