Mobile app version of vmapp.org
Login or Join
Chiappetta492

: Proper way to move Google Analytics code from one site to another one Currently, I use Google Analytics for www.example.com. example.com is also added to GA and shows "Tracking not installed".

@Chiappetta492

Posted in: #301Redirect #GoogleAnalytics #NoWww #Redirects #Tracking

Currently, I use Google Analytics for example.com. example.com is also added to GA and shows "Tracking not installed".

Recently I added rewrite rule (301 redirect) to redirect all requests from example.com to example.com.

How should I move/update GA code to properly track visits to example.com?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Chiappetta492

3 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

If I understood this correctly, you want to have all visits to the site redirected to the domain (not the www subdomain), but you have the GA code set up to track the www subdomain. I think the best way to do it is edit the settings in GA to point to example.com. When you go to GA, you should have two links in the right of the account name, edit and delete. Clicking edit will allow you to change the website URL so you're good to go and still get to keep the old data in as well.

10% popularity Vote Up Vote Down


 

@Pierce454

If the code is included in the pages it's already working. You're able to break out reporting in Analytics to give you different reports based on the sub-domain the code is sitting on. If you want to create different accounts for each you can, which requires a different UA ID to be specified in the code. However if you're fine with doing it on the reporting side you're already done.

10% popularity Vote Up Vote Down


 

@RJPawlick198

Check out the Google Articles on how to do it.


For the non-asynchronous tracking code: www.google.com/support/analytics/bin/answer.py?hl=en&answer=55503 For the asynchronous tracking code: www.google.com/support/analytics/bin/answer.py?answer=174090

One thing Google doesn't mention for Asynchronous tracking. If you have DomainNames set within your GA account you will need to have the middle line from below

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-1']);
_gaq.push(['_setDomainName', 'www.example.com']);
_gaq.push(['_trackPageview']);


Adding that line will make sure you are tracking against the correct domain.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme