When submitting an event, using the Google Analytics Measurement Protocol... GA is classifying the events as bot traffic. I can determine this by configuring two views in GA, one with bot filtering on, and one with bot filtering disabled. The events show up consistently in the view with bot filtering disabled.
We do not want to disable the bot filter in our primary view, as this would include a ton of unnecessary bot traffic.
What about this code is tripping up the bot filter?
payload = {
'v': 1,
't': 'event',
'tid': tracking_id,
'ec': category,
'ea': action,
'el': label
}
if value and type(value) is int:
payload['ev'] = value
if user_id:
payload['uid'] = user_id
else:
payload['cid'] = str(uuid4())
requests.post(
'https://www.google-analytics.com/collect',
data=payload,
headers=requests.utils.default_headers()
)
from Google Analytics, Server-Side Tracking & Bot Filter
No comments:
Post a Comment