Skip to content

Commit

Permalink
Geo information in G4A stats
Browse files Browse the repository at this point in the history
Not the best implementation but G4A doesn't support geographic data via
it's Measurement Protocol. So the workaround ("hack") I came up with is
to put the country name in the event title.

The existing issue of G4A's lack of geo info.
https://issuetracker.google.com/issues/237566549?pli=1
  • Loading branch information
julesghub committed Jun 11, 2024
1 parent 8993651 commit e8e001e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/underworld/_net/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def PostGA4Event( event_name, ev_params ):
"client_id": GA_CLIENT_ID,
"events": [
{
"name": event_name,
"name": geo_info["country"]+"_"+event_name,
"params": {
"session_id": GA_CLIENT_ID,
"engagement_time_msec": 1,
Expand All @@ -101,7 +101,6 @@ def PostGA4Event( event_name, ev_params ):
}

# add the input dict to the event params
payload["events"][0]["params"].update(geo_info)
payload["events"][0]["params"].update(ev_params)

# convert data to btye string
Expand Down

0 comments on commit e8e001e

Please sign in to comment.