/* * Microsoft.ApplicationInsights, 3.4.1 * Copyright (c) Microsoft and contributors. All rights reserved. * * Microsoft Application Insights Team * https://github.com/microsoft/ApplicationInsights-JS#readme * * --------------------------------------------------------------------------- * This is a single combined (rollup) declaration file for the package, * if you require a namespace wrapped version it is also available. * - Namespaced version: types/applicationinsights-clickanalytics-js.namespaced.d.ts * --------------------------------------------------------------------------- */ import { BaseTelemetryPlugin } from '@microsoft/applicationinsights-core-js'; import { IAppInsightsCore } from '@microsoft/applicationinsights-core-js'; import { IConfig } from '@microsoft/applicationinsights-core-js'; import { IConfiguration } from '@microsoft/applicationinsights-core-js'; import { ICustomProperties } from '@microsoft/applicationinsights-core-js'; import { IEventTelemetry } from '@microsoft/applicationinsights-core-js'; import { IPlugin } from '@microsoft/applicationinsights-core-js'; import { IProcessTelemetryContext } from '@microsoft/applicationinsights-core-js'; import { ITelemetryItem } from '@microsoft/applicationinsights-core-js'; import { ITelemetryPluginChain } from '@microsoft/applicationinsights-core-js'; /** * @copyright Microsoft 2020 */ export declare enum Behavior { UNDEFINED = 0, NAVIGATIONBACK = 1, NAVIGATION = 2, NAVIGATIONFORWARD = 3, APPLY = 4, REMOVE = 5, SORT = 6, EXPAND = 7, REDUCE = 8, CONTEXTMENU = 9, TAB = 10, COPY = 11, EXPERIMENTATION = 12, PRINT = 13, SHOW = 14, HIDE = 15, MAXIMIZE = 16, MINIMIZE = 17, BACKBUTTON = 18, STARTPROCESS = 20, PROCESSCHECKPOINT = 21, COMPLETEPROCESS = 22, SCENARIOCANCEL = 23, DOWNLOADCOMMIT = 40, DOWNLOAD = 41, SEARCHAUTOCOMPLETE = 60, SEARCH = 61, SEARCHINITIATE = 62, TEXTBOXINPUT = 63, VIEWCART = 82, ADDWISHLIST = 83, FINDSTORE = 84, CHECKOUT = 85, REMOVEFROMCART = 86, PURCHASECOMPLETE = 87, VIEWCHECKOUTPAGE = 88, VIEWCARTPAGE = 89, VIEWPDP = 90, UPDATEITEMQUANTITY = 91, INTENTTOBUY = 92, PUSHTOINSTALL = 93, SIGNIN = 100, SIGNOUT = 101, SOCIALSHARE = 120, SOCIALLIKE = 121, SOCIALREPLY = 122, CALL = 123, EMAIL = 124, COMMUNITY = 125, VOTE = 140, SURVEYCHECKPOINT = 145, REGISTRATIONINITIATE = 161, REGISTRATIONCOMPLETE = 162, CANCELSUBSCRIPTION = 163, RENEWSUBSCRIPTION = 164, CHANGESUBSCRIPTION = 165, REGISTRATIONCHECKPOINT = 166, CHATINITIATE = 180, CHATEND = 181, TRIALSIGNUP = 200, TRIALINITIATE = 201, SIGNUP = 210, FREESIGNUP = 211, PARTNERREFERRAL = 220, LEARNLOWFUNNEL = 230, LEARNHIGHFUNNEL = 231, SHOPPINGINTENT = 232, VIDEOSTART = 240, VIDEOPAUSE = 241, VIDEOCONTINUE = 242, VIDEOCHECKPOINT = 243, VIDEOJUMP = 244, VIDEOCOMPLETE = 245, VIDEOBUFFERING = 246, VIDEOERROR = 247, VIDEOMUTE = 248, VIDEOUNMUTE = 249, VIDEOFULLSCREEN = 250, VIDEOUNFULLSCREEN = 251, VIDEOREPLAY = 252, VIDEOPLAYERLOAD = 253, VIDEOPLAYERCLICK = 254, VIDEOVOLUMECONTROL = 255, VIDEOAUDIOTRACKCONTROL = 256, VIDEOCLOSEDCAPTIONCONTROL = 257, VIDEOCLOSEDCAPTIONSTYLE = 258, VIDEORESOLUTIONCONTROL = 259, ADBUFFERING = 283, ADERROR = 284, ADSTART = 285, ADCOMPLETE = 286, ADSKIP = 287, ADTIMEOUT = 288, OTHER = 300 } export declare function BehaviorEnumValidator(enumObj: any): (key: string) => any; export declare function BehaviorMapValidator(map: any): (key: string) => any; export declare function BehaviorValueValidator(behaviorArray: string[]): (key: string) => string; export declare class ClickAnalyticsPlugin extends BaseTelemetryPlugin { identifier: string; priority: number; static Version: string; constructor(); initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void; processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void; /** * Logs a page action event. * @param IPageActionTelemetry - The page action event to log. * @param customProperties - Additional data used to filter events and metrics. Defaults to empty. */ trackPageAction(pageAction?: IPageActionTelemetry, customProperties?: ICustomProperties): void; } /** * ClickAnalytics Configuration */ export declare interface IClickAnalyticsConfiguration { /** * Automatic capture configuration. Default is true */ autoCapture?: boolean; /** * Callbacks configuration */ callback?: IValueCallback; /** * Page tags */ pageTags?: { [name: string]: string | number | boolean | string[] | number[] | boolean[] | object; }; /** * Core data configuration */ coreData?: ICoreData; /** * Custom Data Tags provided to ovverride default tags used to capture click data. */ dataTags?: ICustomDataTags; /** * Validator to use for the data-bhvr value */ behaviorValidator?: (value: string | number) => string | number; /** * Default Behavior value when Right Click event has occured. This * value will be ovverriden if the element has the data-*-bhvr attribute present. */ defaultRightClickBhvr?: string | number; /** * Flag to drop events that do not have custom event names, no parentId and no data in content (basically no useful click data). * Default will be false */ dropInvalidEvents?: boolean; /** * Enables the logging of values after a "#" character of the URL. Default is "false." */ urlCollectHash?: boolean; /** * Enables the logging of the query string of the URL. Default is "false." */ urlCollectQuery?: boolean; /** * A list of element types to track. Default is "undefined" which means default elements ["a", "button", "area", "input"] are tracked. * If set, it will combine with the default element types. */ trackElementTypes?: string; } /** * Content interface */ export declare interface IContent { /** * Friendly name (Content Name) of the content to be used reporting/visualization purposes */ cN?: string; /** * Unique identifier (friendly names allowed) of the content (Content Id) as designated by the content provider. * The name should be unique per contentSource such that the two make up the compound key and such that the contentId can be * looked up in the contentSource for additional metadata. */ id?: string; /** * User specified custom content properties */ [name: string]: string | number | boolean | string[] | number[] | boolean[] | object | undefined; } /** * Core data configuration */ export declare interface ICoreData { /** * document.referrer is the default. This is used to override the default value. */ referrerUri?: string; /** * window.location.href is the default. This is used to override the default value. */ requestUri?: string; /** * Default page name is derived from the url. This is used to override the default. */ pageName?: string; /** * PageType is captured from a meta tag named awa-pageType. This is used to override the value or bypass defining meta tags. */ pageType?: string; } /** * Custom Data Tags Configuration */ export declare interface ICustomDataTags { /** * When a particular element is not tagged with content name prefix or content name prefix is not provided by user, this flag is used to collect standard HTML attribute for contentName and id. */ useDefaultContentNameOrId?: boolean; /** * Automatic capture content name and value of elements which are tagged with provided prefix */ customDataPrefix?: string; /** * Click Analytics supports a JSON blob content meta data tagging instead of individual data-* attributes. The default attribute is data-ai-blob. This property allows for changing that attribute name. */ aiBlobAttributeTag?: string; /** * Automatic capture metadata name and content with provided prefix */ metaDataPrefix?: string; /** * Automatic capture all metadata names and content. Default is false. If enabled this will override provided metaTagPrefix. */ captureAllMetaDataContent?: boolean; /** * Stop traversing up the DOM to capture content name and value of elements when encountered with this tag */ parentDataTag?: string; /** * Custom attribute Tag to not track telemetry data */ dntDataTag?: string; } export { ICustomProperties } /** * Override values interface */ export declare interface IOverrideValues { /** * One of the awa.behavior values. */ behavior?: string | number; /** * Page name */ pageName?: string; /** * Page type */ pageType?: string; /** * KVP to be added to the page tags collected */ pageTags?: any; /** * Indicates if the event was fired automatically */ isAuto?: boolean; } export declare interface IPageActionOverrideValues extends IOverrideValues { /** * Uri of the referrer page */ refUri?: string; /** * One of the awa.actionType values */ actionType?: string; /** * Target uri for PageAction events */ targetUri?: string; /** * Click coordinates relative to the top left of the fully rendered content area in the browser */ clickCoordinateX?: number; /** * Click coordinates relative to the top left of the fully rendered content area in the browser */ clickCoordinateY?: number; /** * KVP of the content */ content?: any; /** * KVPs to be added to the content tags collected on a Page Action event; extends the items in the Content blob in Page Action events */ contentTags?: any; } /** * Page Action event */ export declare interface IPageActionTelemetry extends IEventTelemetry { /** * Target uri for PageAction events */ targetUri?: string; /** * One of the awa.actionType values */ actionType?: string; /** * One of the awa.behavior values. */ behavior?: string | number; /** * X, Y representing the absolute co-ordinates withrespect to topleft corner of the page. This should be normalized for the screen resolution to provide better heat map. */ clickCoordinates?: string; /** * JSON-formatted array of content acted upon */ content?: any; /** * Version indicating content version which aids in parsing the content. */ contentVer?: string; /** * Uri of the referrer, this is a convinence for adaptors to just leverage PageAction for click analytics without linking it to the respective Page Views. */ refUri?: string; /** * Time taken in milliseconds since the user saw the page and took the action (such as click on a link, etc.). This will be in seconds. */ timeToAction?: number; /** * A relative or absolute URL that identifies the page or other item. Defaults to the window location. */ uri?: string; /** * Page type */ pageType?: string; /** * Title of the page */ pageName?: string; /** * Content Id (Parent Id) of the parent in which the content was located; */ parentId?: string; } /** * PageTags format */ export declare interface IPageTags { /** * Meta data tags */ metaTags?: { [name: string]: string; }; /** * Any other page tag */ [name: string]: string | number | boolean | string[] | number[] | boolean[] | object | undefined; } /** * Value Callbacks configuration */ export declare interface IValueCallback { /** * Function to override the default pageName capturing behavior. */ pageName?: () => string; /** * A callback function to augument the default pageTags collected during pageAction event. */ pageActionPageTags?: (element?: Element) => IPageTags; /** * A callback function to populate customized contentName. */ contentName?: (element?: any, useDefaultContentName?: boolean) => string; } export { }