3.5.0 • Published 1 month ago

@ovh-ux/ng-at-internet-ui-router-plugin v3.5.0

Weekly downloads
9
License
BSD-3-Clause
Repository
github
Last release
1 month ago

ng-at-internet-ui-router-plugin

Plugin for AT Internet when using UI-Router.

npm version Downloads Dependencies Dev Dependencies

Install

$ yarn add @ovh-ux/ng-at-internet-ui-router-plugin

Usage

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:

<script src="angular.js"></script>
<script src="smarttag-yourproject.js"></script>
<script src="dist/umd/ng-at-internet.js"></script>
<script src="dist/umd/ng-at-internet-ui-router-plugin.js"></script>

Examples

Please see at-internet documentation: link

Configuring the provider:

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:

$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 :

$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 :

app.config(
  /* @ngInject */ (atInternetUiRouterPluginProvider) => {
    // replace all occurrences of "foo" by "bar" in states name
    atInternetUiRouterPluginProvider.addStateNameFilter((stateName) =>
      stateName.replace(/foo/g, 'bar'),
    );
  },
);

Test

$ yarn test

Related

  • ng-at-internet - AT Internet tracking js library wrapper for AngularJS

Contributing

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.

License

BSD-3-Clause © OVH SAS

3.5.0

1 month ago

3.4.1

4 months ago

3.4.0

4 months ago

3.3.0

5 months ago

3.2.4

7 months ago

3.2.3

1 year ago

3.2.2

1 year ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.3

2 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago