An open API service indexing awesome lists of open source software.

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

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.

![](https://user-images.githubusercontent.com/516342/77833539-3728d780-714f-11ea-900e-5e25b0a7a8a9.png)

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
```html

Sentry.configureScope(function configureSentryScope(scope) {
scope.setTag('page-type', {{page-type}});
scope.setTag('pwa-mode', {{pwa-mode}});
});

```

![](https://user-images.githubusercontent.com/516342/73126539-a736a800-3fbc-11ea-8d84-f7107b4d657a.png)

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