logo
down
shadow

Is this the correct Google Analytics tracking code for multiple subdomains and main domains?


Is this the correct Google Analytics tracking code for multiple subdomains and main domains?

Content Index :

Is this the correct Google Analytics tracking code for multiple subdomains and main domains?
Tag : google-analytics , By : Jim F.
Date : November 05 2020, 06:58 PM

hop of those help? Answer to your second question, a huge YES! If you don't have a pageview, then you don't have a way to indicate the start of a session.
Your setup looks correct - just might want to check to see if the auto-link domains accepts regex as I have a feeling it doesn't, ie.:
ga('linker:autoLink', [domain.org, domain.info]);

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Tracking Multiple Domains with Google Analytics in same code


Tag : google-analytics , By : BooTeK
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further multiple url pointed to same code base. It does not matter. The only matter is the url above and the tracking code in site is matching or not. So you have to take google access code from database which just write in address bar.
Codes:
<!-- Google Analytics -->
<script type="text/javascript">
    var accountNameFromDB = ...Some Operations...
    var domainNameFromDB = ...Some Operations...
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', accountNameFromDB]);
    _gaq.push(['_setDomainName', domainNameFromDB]);
    _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>

How to handle Google Analytics tracking code for multiple domains AND where some domains have a different root folder


Tag : javascript , By : Sandip
Date : March 29 2020, 07:55 AM
hope this fix your issue It is possible to alter the page name value with a filter within the GA interface. If you go to the admin for an account or profile, there's an "all filters" link listed on the left under the account section (if you're on account level), or a "filters" link under the "view" section on the right. Click on one of those (which one depends on how your account/profile/views are setup and what scope you want to apply the filter for), then click on the red "new filter" button.
Then, select "custom filter" for the filter type, and then you can either use the "search and replace" or "advanced" radio button option and work with "request uri". This will change the value before it goes into your reports.
// the root you want to exclude. Make site owners fill this out
var rootPath = '/myexample/'; 

/** now here's logic to specify page name with the root path removed **/
// this replicates GA's default page name
var pageName = location.pathname+location.search;
// replace rootPath with '/'
if (typeof rootPath != 'undefined')
  pageName=pageName.replace( (new RegExp("^"+String(rootPath),"")) , '/' )

// now specify the custom page name 
_gaq.push(['_trackPageview',pageName]);
www.site1.com/intro.aspx
www.site2.com/intro.aspx

PHP google analytics Tracking across multiple domains


Tag : php , By : eferro
Date : March 29 2020, 07:55 AM
Hope that helps If you are using Universal Analytics of GA, then have a look at the Measurement Protocol. https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide
That can allow you to track through PHP only, and by using the same cid you can continue to track (using the same profile) the session.

Google Analytics - (gtag) One tracking code, multiple domains


Tag : google-analytics , By : pacorro2000
Date : March 29 2020, 07:55 AM
will be helpful for those in need I don't think you need to do anything additional in terms of implementation of the gtag.js on your site. Just leave the default gtag.js that's provided to you by GA on your app.
What you need to do is some configuration in GA, specifically view filters.
Filter Type: Custom filter > Advanced
Field A: Hostname
Extract A: (.*)
Field B: Request URI
Extract B: (.*)
Output To: Request URI
Constructor: $A1$B1

Can I use the same Google Analytics (gtag.js) tracking ID for multiple subdomains?


Tag : javascript , By : helloedwin
Date : March 29 2020, 07:55 AM
I hope this helps you . The answer must be YES. I see in analytics that one can setup multiple "views", each with different website URL's.
Related Posts Related QUESTIONS :
shadow
Privacy Policy - Terms - Contact Us © scrbit.com