ngx-jixie-analytics
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Ngx Jixie Analytics

This package is a library for integrate jixie analytics in your angular project and inspired by angular-tag-manager.

Getting Started

In your Angular project run

npm i --save ngx-jixie-analytics

After installing it you need to provide your account id:

providers: [
    ...
    {
        provide: 'jixieAccountId',  
        useValue: YOUR_ACCOUNT_ID
    }
]

Or use the module's forRoot method

import { 
    NgxJixieAnalyticsModule 
} from 'ngx-jixie-analytics';

imports: [
    ...
    NgxJixieAnalyticsModule.forRoot({
      accountid: YOUR_ACCOUNT_ID,
    })
]

inject the analyticService in your controller

constructor(
    ...
    private analyticService: JixieAnalyticService,
) { }

then you can start pushing events on your jixie:

const jixieTag = {
  // accountid automatically added when `pushTag`.
  email: user.email ?
    this.analyticService.hash(user.email) : '',
  action: "viewitem",
  parameters:{
      itemid:"54fg4",
      price:"23.21",
      currency:"USD",
      availability: "instock"
  }
};

this.analyticService.pushTag(jixieTag);

if you want to receive tags without pushing events simply call the function to enable it

this.analyticService.addJixieToDom();

Authors


Agung Yuliyanto
💻

Package Sidebar

Install

npm i ngx-jixie-analytics

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

53.1 kB

Total Files

19

Last publish

Collaborators

  • agung96tm