Analytics and Search Marketing Tips
If your website has more than 10 million hits per month then you are violating the Google Analytics Terms of Service.
If you are substantially exceeding this traffic limit and desire to become compliant, then implementing the Google Analytics Sample Rate is a simple solution, but it does have drawbacks.
_setSampleRate is a code-level/visitor-level change in Google Analytics that enforces a client-side sample rate. When enabled, only a specific percentage of your site’s visitors will be included in your Google Analytics profile(s).
If you specify a sample rate in your GA code of 20%, then only 20 out of 100 visitors (approximately) that come to your site will send visit data to the Google Analytics servers. This does mean that the other 80 visitors will not be tracked and won’t send data to GA. Google’s ga.js code determines which visitors to include and exclude. This occurs consistently across unique visitors, which means that once a visitor has been tagged as a participant, all of their future visits will also be included in your metrics.
To be clear, this is different than the ‘fast-access mode’ that you may see in the reporting interface. While fast access mode uses sampling of the entire data set to return a report to you in a reasonable amount of time, the client-side sample rate only sends visitor data for a specific percentage of site visitors.
Well, you probably shouldn’t. There are very few reasons why you should choose to implement sampling. We recommend avoiding it if at all possible. However, if you are violating the Google Analytics Terms of Service (ToS) you may decide to do this proactively or at some point you may be asked by Google to comply.
Here are a few reasons you might choose to implement Google Analytics sampling:
Typically, large websites are the ones that will implement sampling. In these cases, there is enough data being collected that there is still value in the metrics and trends to provide actionable insight.
If you are sampling at 20% and you receive 2 million visitors a day, multiplying that by 5 will give you a value that is close to actual (but never exact). You could use the Google Analytics API to pull the data into a database, where you then perform the inflation calculation across metrics.
Determining your sample rate is something that should be done very carefully. We recommend that you contact a Google Analytics Consultant like us and explain your situation so that we can provide solutions based on your specific objectives and requirements.
The required code change is quite simple. There are two things you should be aware of when implementing a sample rate:
Depending on the ga.js code snippet you are using, below is the code syntax to use to set a 20% sample rate.
Since this is a client-side code change, this will immediately go into effect and you’ll see the results the next time data has been processed in your GA account.
If you have implemented sampling in Google Analytics, what was your reason?
Share this Post
Digital Analytics Blog
We're here to help with tips and insight on the following topics:
Optimize your website and marketing campaigns