LiveSession provides an SDK package to install script in your favorite framework. This tool also lets you work more easily with LiveSesion API. We’ve prepared some examples of installing tracking code in Angular.
Start with installing LiveSesion SDK:
npm i @livesession/sdk
Angular usage
Import SDK into your main app component
Import
OnInit
from@angular/core
Implement
OnInit
and call LiveSession init method inngOnInit
function
// app.component.ts
import ls from '@livesession/sdk'
export class AppComponent implemets OnInit {
ngOnInit(){
ls.init("YOUR_TRACK_ID");
ls.newPageView();
}
}
If you want more information about configuration, go to LiveSesion Developers or read instructions on LiveSesion SDK’s Github page.