Plugin for at-internet when using UI-Router
npm install @ovh-ux/ng-at-internet-ui-router-plugin> Plugin for AT Internet when using UI-Router.
   
``sh`
$ yarn add @ovh-ux/ng-at-internet-ui-router-plugin
`js
import angular from 'angular';
import ngAtInternetUiRouterPlugin from '@ovh-ux/ng-at-internet-ui-router-plugin';
angular.module('myApp', [ngAtInternetUiRouterPlugin]);
`
Follow at-internet installation
In your web page:
`html`
Please see at-internet documentation:
link
Configuring the provider:
`js`
app.config([
'atInternetUiRouterPluginProvider',
function(provider) {
provider.setTrackStateChange(true);
},
]);
That's it, now every state change will send a page tracking data to ATInternet.
To disabled tracking on specific states, use the following syntax:
`js`
$stateProvider.state('your-untracked-state', {
url: '...',
atInternet: {
ignore: true, // this tell AtInternet to not track this state
},
});
By default, the state name will be used for the page name to be sent. If you want to modify this behavior
for a given state, please use the following syntax :
`js`
$stateProvider.state('your-state', {
url: '...',
atInternet: {
rename: 'foobar', // use "foobar" as page name instead of "your-state"
},
});
If you want, you can apply some filters on the states name, for example :
`js`
app.config(
/ @ngInject / (atInternetUiRouterPluginProvider) => {
// replace all occurrences of "foo" by "bar" in states name
atInternetUiRouterPluginProvider.addStateNameFilter((stateName) =>
stateName.replace(/foo/g, 'bar'),
);
},
);
`sh``
$ yarn test
- ng-at-internet - AT Internet tracking js library wrapper for AngularJS
Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.
BSD-3-Clause © OVH SAS