Custom Event Parser
This client template for Google Tag Manager Server-Side takes an incoming GET request, extracts information from the query string, headers, IP, and cookies and returns the data to the server container as an event object. It is vendor agnostic and can handle any GET tracking request.
For an example request like https://myServerContainer.com/measure?property1=value1&property2=value2&property3=value3, the event data mapping for the object returned would look like this:
| Event Object Key | Source |
|---|---|
| property1 | Query String |
| property2 | Query String |
| property3 | Query String |
| page_location | Request Header: referer |
| user_agent | Request Header: user-agent |
| ip_override | GTM Server-Side Tagging API |
| timestamp | GTM Server-Side Tagging API |
| CookieName | Request Header: cookie (CookieName as specified in the template input field) |
Full blog post with instructions available here.
Please feel free to get in touch for feedback and suggestions.
Built With
- google-cloud
- javascript
- sandboxed-javascript

Log in or sign up for Devpost to join the conversation.