angulartics2

  • Version 10.0.0
  • Published
  • 1.3 MB
  • 1 dependency
  • MIT license

Install

npm i angulartics2
yarn add angulartics2
pnpm add angulartics2

Overview

Vendor-agnostic web analytics for Angular2 applications

Index

Variables

variable ANGULARTICS2_TOKEN

const ANGULARTICS2_TOKEN: any;

    Classes

    class AngularRouterTracking

    class AngularRouterTracking implements RouterlessTracking {}
    • Track Route changes for applications using Angular's default router

      https://angular.io/api/router/Router

    constructor

    constructor(router: any, location: any);

      method prepareExternalUrl

      prepareExternalUrl: (url: string) => string;

        method trackLocation

        trackLocation: (settings: any) => any;

          class Angulartics2

          class Angulartics2 {}

            constructor

            constructor(tracker: RouterlessTracking, setup: Angulartics2Token);

              property eventTrack

              eventTrack: any;

                property exceptionTrack

                exceptionTrack: any;

                  property pageTrack

                  pageTrack: any;

                    property setAlias

                    setAlias: any;

                      property setSuperProperties

                      setSuperProperties: any;

                        property setSuperPropertiesOnce

                        setSuperPropertiesOnce: any;

                          property settings

                          settings: Angulartics2Settings;

                            property setUsername

                            setUsername: any;

                              property setUserProperties

                              setUserProperties: any;

                                property setUserPropertiesOnce

                                setUserPropertiesOnce: any;

                                  property userTimings

                                  userTimings: any;

                                    method clearUrl

                                    protected clearUrl: (url: string) => string;
                                    • Removes id's from tracked route. EX: /project/12981/feature becomes /project/feature

                                      Parameter url

                                      current page path

                                    method filterDeveloperMode

                                    filterDeveloperMode: <T>() => any;
                                    • filters all events when developer mode is true

                                    method matchesExcludedRoute

                                    protected matchesExcludedRoute: (url: string) => boolean;
                                    • Use string literals or regular expressions to exclude routes from automatic pageview tracking.

                                      Parameter url

                                      location

                                    method trackUrlChange

                                    protected trackUrlChange: (url: string) => void;

                                      class Angulartics2Module

                                      class Angulartics2Module {}

                                        method forRoot

                                        static forRoot: (settings?: Partial<Angulartics2Settings>) => any;

                                          class Angulartics2On

                                          class Angulartics2On implements AfterContentInit {}

                                            constructor

                                            constructor(elRef: any, angulartics2: Angulartics2, renderer: any);

                                              property angulartics2On

                                              angulartics2On: string;

                                                property angularticsAction

                                                angularticsAction: string;

                                                  property angularticsCategory

                                                  angularticsCategory: string;

                                                    property angularticsLabel

                                                    angularticsLabel: string;

                                                      property angularticsProperties

                                                      angularticsProperties: any;

                                                        property angularticsValue

                                                        angularticsValue: string;

                                                          method eventTrack

                                                          eventTrack: (event: Event) => void;

                                                            method ngAfterContentInit

                                                            ngAfterContentInit: () => void;

                                                              class Angulartics2OnModule

                                                              class Angulartics2OnModule {}

                                                                class DefaultConfig

                                                                class DefaultConfig implements Angulartics2Settings {}

                                                                  property appInsights

                                                                  appInsights: {};

                                                                    property developerMode

                                                                    developerMode: boolean;

                                                                      property ga

                                                                      ga: {};

                                                                        property gst

                                                                        gst: {};

                                                                          property gtm

                                                                          gtm: {};

                                                                            property pageTracking

                                                                            pageTracking: {
                                                                            autoTrackVirtualPages: boolean;
                                                                            basePath: string;
                                                                            excludedRoutes: any[];
                                                                            clearIds: boolean;
                                                                            clearHash: boolean;
                                                                            clearQueryParams: boolean;
                                                                            idsRegExp: RegExp;
                                                                            };

                                                                              class RouterlessTracking

                                                                              class RouterlessTracking {}

                                                                                method prepareExternalUrl

                                                                                prepareExternalUrl: (url: string) => string;

                                                                                  method trackLocation

                                                                                  trackLocation: (settings: Angulartics2Settings) => any;

                                                                                    Interfaces

                                                                                    interface Angulartics2Settings

                                                                                    interface Angulartics2Settings {}

                                                                                      property appInsights

                                                                                      appInsights: Partial<AppInsightsSettings>;

                                                                                        property developerMode

                                                                                        developerMode: boolean;
                                                                                        • Disable page tracking

                                                                                        property ga

                                                                                        ga: Partial<GoogleAnalyticsSettings>;

                                                                                          property gst

                                                                                          gst: Partial<GoogleGlobalSiteTagSettings>;

                                                                                            property gtm

                                                                                            gtm: Partial<GoogleTagManagerSettings>;

                                                                                              property pageTracking

                                                                                              pageTracking: Partial<PageTrackingSettings>;

                                                                                                interface Angulartics2Token

                                                                                                interface Angulartics2Token {}

                                                                                                  property settings

                                                                                                  settings: Partial<Angulartics2Settings>;

                                                                                                    interface AppInsightsSettings

                                                                                                    interface AppInsightsSettings {}

                                                                                                      property userId

                                                                                                      userId: string;

                                                                                                        interface EventTrack

                                                                                                        interface EventTrack {}

                                                                                                          property action

                                                                                                          action: string;

                                                                                                            property properties

                                                                                                            properties: any;

                                                                                                              interface GoogleAnalyticsSettings

                                                                                                              interface GoogleAnalyticsSettings {}

                                                                                                                property additionalAccountNames

                                                                                                                additionalAccountNames: string[];
                                                                                                                • array of additional account names (only works for analyticsjs)

                                                                                                                property anonymizeIp

                                                                                                                anonymizeIp: boolean;

                                                                                                                  property transport

                                                                                                                  transport: string;
                                                                                                                  • see https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#transport

                                                                                                                  property userId

                                                                                                                  userId: any;

                                                                                                                    interface GoogleGlobalSiteTagSettings

                                                                                                                    interface GoogleGlobalSiteTagSettings {}

                                                                                                                      property anonymizeIp

                                                                                                                      anonymizeIp?: boolean;

                                                                                                                        property customMap

                                                                                                                        customMap?: {
                                                                                                                        [key: string]: string;
                                                                                                                        };

                                                                                                                          property trackingIds

                                                                                                                          trackingIds: any;

                                                                                                                            property userId

                                                                                                                            userId?: any;

                                                                                                                              interface GoogleTagManagerSettings

                                                                                                                              interface GoogleTagManagerSettings {}

                                                                                                                                property userId

                                                                                                                                userId: any;

                                                                                                                                  interface PageTrack

                                                                                                                                  interface PageTrack {}

                                                                                                                                    property path

                                                                                                                                    path: string;

                                                                                                                                      interface PageTrackingSettings

                                                                                                                                      interface PageTrackingSettings {}

                                                                                                                                        property autoTrackVirtualPages

                                                                                                                                        autoTrackVirtualPages: boolean;

                                                                                                                                          property basePath

                                                                                                                                          basePath: string;

                                                                                                                                            property clearHash

                                                                                                                                            clearHash: boolean;
                                                                                                                                            • drop contents of url after hash marker /callback#authcode=1234 -> /callback

                                                                                                                                            property clearIds

                                                                                                                                            clearIds: boolean;
                                                                                                                                            • drop ids from url /sections/123/pages/456 -> /sections/pages

                                                                                                                                            property clearQueryParams

                                                                                                                                            clearQueryParams: boolean;
                                                                                                                                            • drop query params from url /sections/123/pages?param=456&param2=789 -> /sections/123/pages

                                                                                                                                            property excludedRoutes

                                                                                                                                            excludedRoutes: (string | RegExp)[];

                                                                                                                                              property idsRegExp

                                                                                                                                              idsRegExp: RegExp;
                                                                                                                                              • used with clearIds, define the matcher to clear url parts

                                                                                                                                              interface TrackNavigationEnd

                                                                                                                                              interface TrackNavigationEnd {}

                                                                                                                                                property url

                                                                                                                                                url: string;

                                                                                                                                                  interface UserTimings

                                                                                                                                                  interface UserTimings {}
                                                                                                                                                  • https://developers.google.com/analytics/devguides/collection/analyticsjs/user-timings

                                                                                                                                                  property timingCategory

                                                                                                                                                  timingCategory: string;
                                                                                                                                                  • A string for categorizing all user timing variables into logical groups (e.g. 'JS Dependencies').

                                                                                                                                                  property timingLabel

                                                                                                                                                  timingLabel?: string;
                                                                                                                                                  • A string that can be used to add flexibility in visualizing user timings in the reports (e.g. 'Google CDN').

                                                                                                                                                  property timingValue

                                                                                                                                                  timingValue: number;
                                                                                                                                                  • The number of milliseconds in elapsed time to report to Google Analytics (e.g. 20).

                                                                                                                                                  property timingVar

                                                                                                                                                  timingVar: string;
                                                                                                                                                  • A string to identify the variable being recorded (e.g. 'load').

                                                                                                                                                  Package Files (9)

                                                                                                                                                  Dependencies (1)

                                                                                                                                                  Dev Dependencies (0)

                                                                                                                                                  No dev dependencies.

                                                                                                                                                  Peer Dependencies (3)

                                                                                                                                                  Badge

                                                                                                                                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/angulartics2.

                                                                                                                                                  • Markdown
                                                                                                                                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/angulartics2)
                                                                                                                                                  • HTML
                                                                                                                                                    <a href="https://www.jsdocs.io/package/angulartics2"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>