Ember addon for integrating Google Tag Manager
- Ember.js v3.12 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
ember install ember-gtm
All that's required is setting the GTM key in your config/environment.js
file.
// config/environment.js
ENV['ember-gtm'] = {
appId: '[YOUR_APP_ID]'
};
Then you can use the gtm
service freely.
@service gtm;
@action
someAction() {
const data = {
something: "for the dataLayer"
};
this.gtm.trackGTM(data);
}
See the Contributing guide for details.
This project is licensed under the MIT License.