I have setup Google Analytics events in various parts of my app.
It all works perfectly except that events are located in the city of Boardman (amazon server i guess).
As a consequence, all my traffic is doubled and all events are located in Boardman.
For instance, if I have 10 visitors from 2 different sources I will see in GA 20 visitors and all events and conversions attributed to this 10 extra visits from Boardman. Ultimately I can’t track events and conversions by source/location/etc.
I tried to:
exclude traffic from Boardman -> I loose event tracking
move all triggers from API workflows to Page workflows -> no impact
The issue is the API Connector will track the server location rather than the app user’s location. Instead, please use the Google Analytics plugin or add HTML snippet in header.
I am not sure the Google Analytics plugin or HTML snippet can help me track “events” on Google Analytics. They only track pageviews while events are here to track button clicks and other user actions on a page.
Indeed by adding this script and the toolbox plugin (update below) you can retrieve the clientId.
<script>
ga(function(tracker) {
var clientId = tracker.get('clientId');
bubble_fn_cid(clientId);
});
</script>
I then send this cid together with the event to GA and they match the events to the session (houra)
One last issue though:
The location will toggle between actual location when a pageview happens and Boardman when an event happens.
So I will get the location correct in my reports only when last interaction of the session is a pageview and not an event
I could not find a way to get the location or IP from GA to then override it in the event (similar to cid) …
And I don’t know if we can somehow hide the location for server hits so GA keeps the initial one …
Instead of calling the API to send events I used the “Run Javascript” function from the toolbox plugin and added the javascript function in there when appropriate - see below: