ima-plugin-analytic-google
This is the google analytic plugin for the IMA.js application. You can find the IMA.js skeleton application at https://github.com/seznam/IMA.js-skeleton or follow link https://imajs.io.
Installation
npm install ima-plugin-analytic-google ima-plugin-script-loader --save
// /app/build.js var vendors = common: 'ima-plugin-analytic-google' 'ima-plugin-analytic' 'ima-plugin-script-loader' ; /*Now is google analytic plugin available from: ns.ima.plugin.analytic.google.GoogleAnalytic;ns.ima.plugin.analytic.google.defaultDependencies; import { GoogleAnalytic, defaultDependencies } from 'ima-plugin-analytic-google';*/
// /app/config/settings.js prod: $Http: ... $Cache: ... $Page: ... plugin : analytic: google: service: 'UA-XXXXXXX-X'
// /app/config/services.js; var $window = oc;var $dispatcher = oc;var googleAnalytic = oc; if $window // insert analytic script to page and initialization analytic googleAnalytic; //set hit page view to analytic $dispatcher;
Version 1.0 notice
Since version 1.0 you need to additionally call a load()
method. The later you call this method the better.
If you don't have a specific point in your app where you know that the page has finished loading you can call the load()
method immediatelly after init()
method
if $window // insert analytic script to page and initialization analytic googleAnalytic; googleAnalytic; // ...
Dependencies
If you are looking more details, you should follow this links: https://github.com/seznam/IMA.js-plugin-analytic, https://github.com/seznam/IMA.js-plugin-script-loader