Coder Social home page Coder Social logo

ng-pendo's Introduction

Deprecated

This is no longer the correct way to install Pendo into your application. Instructions on installation are provided upon creating a new Pendo subscription. Head over to Pendo to get started.

ng-pendo v1.1.0

Please note that the most recent installation snippet (found in your install settings) makes this integration unnecessary, but it is fine to continue using it.

Pendo.io AngularJS module

Installation

$ npm i --save ng-pendo

Use

Provide your api key:

window.pendo_options = {
    apiKey: 'replace this with your api key',
    usePendoAgentAPI: true
};

Include $pendolytics in your AngularJS modules:

angular.module('your-app', [...,'$pendolytics',...]);

When you have access to the visitor information use it to identify the visitor:

getVisitorInformationFromSomewhere().then(function (visitor) {
    $pendolytics.identify({
        visitor: {
            id: visitor.id,
            role: visitor.role,
            email: visitor.email
        },
        account: {
            id: visitor.accountId
        }
    });
});

Note that your api key needs to be set before your Angular application is bootstrapped, otherwise $pendolytics will not find the key, and will use an older version of the Pendo Agent. If you prefer to set your api key after Angular bootstraps, you can delay $pendolytics from automatically starting with a config block, for example:

angular.module('your-app').config(function ($pendolyticsProvider) {
    $pendolyticsProvider.doNotAutoStart();
});

Then you can manually start $pendolytics when you are ready:

angular.module('your-app').run(function ($pendolytics) {
    // Set your API key and identify the visitor
    $pendolytics.initialize({
        apiKey: 'your key',
        visitor: {
            id: 'visitor id'
        },
        account: {
            id: 'account id'
        }
    });
    // Load the Pendo agent and start collecting data and displaying guides
    $pendolytics.bootstrap();
});

ng-pendo's People

Contributors

mdellanoce avatar brec-c avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.