https://github.com/omrilotan/tagmanager-sentry
Sentry template for Google Tag Manager
https://github.com/omrilotan/tagmanager-sentry
google-tag-manager gtm javascript sentry template
Last synced: 7 months ago
JSON representation
Sentry template for Google Tag Manager
- Host: GitHub
- URL: https://github.com/omrilotan/tagmanager-sentry
- Owner: omrilotan
- License: apache-2.0
- Created: 2020-01-25T20:03:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-17T13:23:19.000Z (over 4 years ago)
- Last Synced: 2025-02-27T04:11:30.263Z (7 months ago)
- Topics: google-tag-manager, gtm, javascript, sentry, template
- Language: JavaScript
- Homepage: https://tagmanager.google.com/gallery/#/owners/omrilotan/templates/tagmanager-sentry
- Size: 134 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sentry template for Google Tag Manager
Add sentry script to page.
After Sentry init, the custom event "sentryLoaded" will be fired.
Find your project ID and public key [in your project's settings page on Sentry](https://sentry.io/settings):
```
─ projects
└─
└─ Client Keys (DSN)
└─ Configure (button)
├─ Public Key (scroll down)
└─ Project ID
```1. This template loads the [Sentry SDK](https://docs.sentry.io/platforms/javascript/configuration/install-cdn).
2. Upon success - it calls on init with DSN built from your Key and Application ID.
3. Finally - it fires a custom event, `sentryLoaded` to be picked up by other tags in your system.An example custom tag configuring Sentry dimensions
```htmlSentry.configureScope(function configureSentryScope(scope) {
scope.setTag('page-type', {{page-type}});
scope.setTag('pwa-mode', {{pwa-mode}});
});```

Browse source code and tests in [src](./src) directory