Is there a way to use sample rate with the Google Analytics Measurement Protocol

310 views Asked by At

We are thinking of implementing the Google Analytics Measurement Protocol to track older devices that may not have js enabled. Is there a way to set a sample rate when working with this protocol?

I have read through this but not sure how you would go about introducing sample rates using the G.A.M.P. or even how to implement your own sample rate.

1

There are 1 answers

0
Philip Walton On BEST ANSWER

No, sample rate is a feature implemented by the other client libraries (e.g. analytics.js and the iOS/Android SDKs), and they do it by selectively not sending hits for certain users to the Measurement Protocol.

If you wanted to implement this yourself, you could do the same. The key gotcha to keep in mind is you wouldn't want to randomly sample out individual hits, you'd want to randomly sample out users. To understand why the former is bad, consider if you didn't send a transaction event for a particular user, but then you did send a refund event. Your reports wouldn't make sense.