Friday 15 July 2011

How to use one Google Analytics code on a network of sites? -


And how to set it?

When I go to editing - & gt; + New account, I need to enter a website name, b) Website URL, and C) Account Name I would like to use code on the network of 25 sites, and there is no option to enter the URL. When I enter it, it appears in the Analytics code that I get later

When I saw the Google Analytics code on one of my sites, which is more than a year old So, something looks like this:

  & lt; Script type = "text / javascript" & gt; Var _gaq = _gaq || []; _gaq.push (['_ setAccount', 'UA-01234567- 1']); _gaq.push (['_ trackPageview']); (Function () {var ga = document.createElement ('script'); ga.type = 'text / javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol? 'Http: //ssl': 'http: // www') + '.google-analytics.com / ga.js'; var s = document.getElementsByTagName ('script') [0]; s.parentNode.insertBefore (GA, S);}) (); & Lt; / Script & gt;   

When I'm just getting a code (which is estimated to be a code for sites' networks), it looks like:

  & lt; Script & gt; (Function (I, S, O, G, R, A, M) {i ['GoogleAnalyticsObject'] = R; I [R] = I [R] || function () {(I [R]. C = I [r] .q || []). Push (argument)}, I [R] .L = 1 * New date (); a = s.create element (O), M = S. ElementElementBitagname (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-41928014-1', 'test.com'); Ga ('Send', 'Pageview'); & Lt; / Script & gt;   

It has a URL / domain name in it

Normally I know that I have to set up an account, and apply filters (different domains Have access to data), but I'm not sure how this step by step (especially in test.com, analytics code, as per the example above). Maybe there is a different / better way to do this?

Thank you.

'test.com' is an optional parameter in which it is only subdomain Provides a reference for tracking, so you can leave it and insert the code on all your sites; However, if you have a subdomain for those 25 sites, you will be able to participate in problems not being able to track problems (see documentation)

I think you will get a roll- Are you trying to create your profile profile? It's great and all, but I would recommend creating a separate property for each, as if your sites get a lot of traffic, you can run in the sample.

Have you heard of Google Tag Manager? I look into it if you have many properties because it will make any changes to those tags easier to update and will take very little time out of your time.

Ideally, you set it up like this:

1) Create a container (apply this container code to all your websites)

2) Create 25 Google Analytics tags in GTM and set a rule that if test1 is equal to {{url}} then use the test1 Google Analytics tag.

No comments:

Post a Comment