Reputation: 988
I am using Asynchronous google Analytics code in my website. Account key for Google Analytic which i am using for Live website in also in my local website environment. but in my google analytics account the Url is of live website. suddenly i noticed that my Google Analytics is tracking the data from local environment as well and that is a huge huge problem. why its tracking from two different URLs.
Upvotes: 0
Views: 400
Reputation: 11
Google Analytics will track any domain or URL onto which you have installed the Google Analytics Tracking Code (GATC). For analytics/tracking purposes, it does not matter to Google which URL you written your GA account, either at Admin -> Profile Settings or at Account List -> Account Settings.
For example, let's say that your current GA account number is "UA-12345678-1". You have installed your GATC with UA-12345678-1 onto "livewebsite.com" and onto "localenvironment.com". As long as the GA JavaScript file called "ga.js" can load and can connect to the Internet, then a GA cookie can be created and stored on your browser and the tracking information can be sent back to GA.
Assuming that you want to keep GATC installed on your local environment webpages, some possible solutions that may fix your dilemma would either be to create a filter to exclude your own traffic or install an entirely new, unique account number into your local environment:
'1. Exclude your own traffic from UA-12345678-1 by creating a new profile for UA-12345678-1. In the new profile, create and apply one of the following "Custom/Advanced" filters:
'a. "Include" traffic from "Hostname" of livewebsite.com
--or--
'b. "Exclude" traffic from "Hostname" of localenvironment.com
--or--
'c. "Exclude" traffic from "IP Address" of your local environment. For example, if your local environment uses the IP address 65.99.208.1, you would write the IP address into the Exclude IP Address advanced filter as: ^65.99.208.1$
More info here: http://www.morevisibility.com/analyticsblog/clean-up-your-google-analytics-data-with-these-5-filters.html
'2. Create a second GA account (they're free to create):
'd. Install the new GA account number into the code of localenvironment.com. After installing the new GA account number (for example: UA-98765432-1) , you would continue using UA-12345678-1 on livewebsite.com without interference from your test environment, which would use UA-98765432-1 .
Upvotes: 1