ember-cli-mautic
v1.0.0
Published
📊 Ember CLI addon for easy Mautic monitoring
Downloads
4
Maintainers
Readme
ember-cli-mautic
📊 Ember CLI addon for easy Mautic monitoring
Installation
ember install ember-cli-mautic
Add your Mautic domain to mautic
config object for the library to be loaded.
// config/environment.js
ENV['mautic'] = {
WEBSITE_URL = 'your_mautic_domain'
}
Usage
The addon exposes a service which can be injected into your components, routes, etc.
import { Component } from '@ember/component';
import { inject as service } from '@ember/service';
export default Component.extend({
mautic: service()
});
Tracking page views
The addon automatically tracks page views on the application didTransition
event.
To disable this functionality, you can add the defaultPageTrack
option to your mautic
config option.
// config/environment.js
ENV['mautic'] = {
WEBSITE_URL = 'your_mautic_domain',
defaultPageTrack: false
}
To call manually, use the trackPageView
method on the service.
get(this, 'mautic').trackPageView()
Contributing
Installation
git clone <repository-url>
cd ember-cli-mautic
npm install
Linting
npm run lint:js
npm run lint:js -- --fix
Running tests
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"npm test
– Runsember try:each
to test your addon against multiple Ember versions
Running the dummy application
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
License
This project is licensed under the MIT License.