Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markedmondson1234/gtm-redirect-tracker
Track in GTM Server Side using redirects
https://github.com/markedmondson1234/gtm-redirect-tracker
gtm-custom-template gtm-server-side
Last synced: 19 days ago
JSON representation
Track in GTM Server Side using redirects
- Host: GitHub
- URL: https://github.com/markedmondson1234/gtm-redirect-tracker
- Owner: MarkEdmondson1234
- License: apache-2.0
- Created: 2021-03-31T14:47:48.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-31T15:41:58.000Z (almost 4 years ago)
- Last Synced: 2024-10-28T00:25:15.035Z (2 months ago)
- Topics: gtm-custom-template, gtm-server-side
- Language: Smarty
- Homepage:
- Size: 427 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Tag Manager Server Side - Redirect Tracker
This GTM SS Client lets you track URLs via redirects.
## Configuration
You have these fields to configure:
* Path - the path pointing at your GTM Server Side domain e.g. if your GTM SS is at `https://gtm.example.com/` then use `/path1` so `https://gtm.example.com/path1` will be a redirect tracker
* Destination - where the redirect will end up. You can use any URL you like, including adding tracking parameters
* HTTP Redirect Status - choose between 301 or 302 redirects
* Referrer - you can overwrite the referrer of the redirect## GTM Event
The redirect tracker also creates a GTM event with these attributes that you can use to trigger server-side tags:
```js
const event = {
event_name: 'redirect',
redirect_source: row.path,
redirect_destination: row.redirect,
redirect_type: row.status,
redirect_referer: row.referer,
ts: getTimestampMillis()
};
```## Example
![](redirect-gtmss-config-example.png)
In the above screenshot calls to `https://gtm2.markedmondson.me` + ... =
* `/edmon` redirects to the website with UTM paramters attached
* `/edmon2` and `/edmon3` redirects without UTM parameters
* `/redirect-gtm` redirects to this GitHub containerThis client has also been attached to the [Edmonlytica Server Side Tag](https://github.com/MarkEdmondson1234/edmonlytica-server-side-tag) that reads the GTM event and sends it to BigQuery:
![](redirect-gtmss-tag-example.png)
![](redirect-gtmss-trigger-example.png)