: 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".
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?
More posts by @Chiappetta492
3 Comments
Sorted by latest first Latest Oldest Best
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.
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.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.