@microsoft/applicationinsights-clickanalytics-js 2.8.5-nightly.2206-04 → 2.8.5-nightly.2206-06
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{ai.clck.2.8.5-nightly.2206-04.cjs.js → ai.clck.2.8.5-nightly.2206-06.cjs.js} +658 -566
- package/browser/ai.clck.2.8.5-nightly.2206-06.cjs.js.map +1 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.cjs.min.js +6 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.cjs.min.js.map +1 -0
- package/browser/{ai.clck.2.8.5-nightly.2206-04.gbl.js → ai.clck.2.8.5-nightly.2206-06.gbl.js} +658 -566
- package/browser/ai.clck.2.8.5-nightly.2206-06.gbl.js.map +1 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.gbl.min.js +6 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.gbl.min.js.map +1 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.integrity.json +66 -0
- package/browser/{ai.clck.2.8.5-nightly.2206-04.js → ai.clck.2.8.5-nightly.2206-06.js} +658 -566
- package/browser/ai.clck.2.8.5-nightly.2206-06.js.map +1 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.min.js +6 -0
- package/browser/ai.clck.2.8.5-nightly.2206-06.min.js.map +1 -0
- package/browser/ai.clck.2.cjs.js +657 -565
- package/browser/ai.clck.2.cjs.js.map +1 -1
- package/browser/ai.clck.2.cjs.min.js +2 -2
- package/browser/ai.clck.2.cjs.min.js.map +1 -1
- package/browser/ai.clck.2.gbl.js +657 -565
- package/browser/ai.clck.2.gbl.js.map +1 -1
- package/browser/ai.clck.2.gbl.min.js +2 -2
- package/browser/ai.clck.2.gbl.min.js.map +1 -1
- package/browser/ai.clck.2.js +657 -565
- package/browser/ai.clck.2.js.map +1 -1
- package/browser/ai.clck.2.min.js +2 -2
- package/browser/ai.clck.2.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.api.json +5 -2
- package/dist/applicationinsights-clickanalytics-js.d.ts +1 -1
- package/dist/applicationinsights-clickanalytics-js.js +657 -565
- package/dist/applicationinsights-clickanalytics-js.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.min.js +2 -2
- package/dist/applicationinsights-clickanalytics-js.min.js.map +1 -1
- package/dist/applicationinsights-clickanalytics-js.rollup.d.ts +1 -1
- package/dist-esm/Behaviours.js +1 -1
- package/dist-esm/ClickAnalyticsPlugin.js +13 -12
- package/dist-esm/ClickAnalyticsPlugin.js.map +1 -1
- package/dist-esm/DataCollector.js +21 -20
- package/dist-esm/DataCollector.js.map +1 -1
- package/dist-esm/Enums.js +1 -1
- package/dist-esm/Interfaces/Datamodel.js +1 -1
- package/dist-esm/__DynamicConstants.js +62 -0
- package/dist-esm/__DynamicConstants.js.map +1 -0
- package/dist-esm/applicationinsights-clickanalytics-js.js +1 -1
- package/dist-esm/common/Utils.js +45 -82
- package/dist-esm/common/Utils.js.map +1 -1
- package/dist-esm/events/PageAction.js +50 -49
- package/dist-esm/events/PageAction.js.map +1 -1
- package/dist-esm/events/WebEvent.js +40 -39
- package/dist-esm/events/WebEvent.js.map +1 -1
- package/dist-esm/handlers/AutoCaptureHandler.js +24 -22
- package/dist-esm/handlers/AutoCaptureHandler.js.map +1 -1
- package/dist-esm/handlers/DomContentHandler.js +61 -60
- package/dist-esm/handlers/DomContentHandler.js.map +1 -1
- package/package.json +8 -5
- package/src/ClickAnalyticsPlugin.ts +20 -27
- package/src/DataCollector.ts +9 -12
- package/src/Interfaces/Datamodel.ts +1 -1
- package/src/__DynamicConstants.ts +60 -0
- package/src/common/Utils.ts +28 -69
- package/src/events/PageAction.ts +19 -16
- package/src/events/WebEvent.ts +20 -18
- package/src/handlers/AutoCaptureHandler.ts +16 -16
- package/src/handlers/DomContentHandler.ts +15 -17
- package/types/ClickAnalyticsPlugin.d.ts +4 -4
- package/types/DataCollector.d.ts +2 -2
- package/types/__DynamicConstants.d.ts +48 -0
- package/types/common/Utils.d.ts +94 -96
- package/types/events/PageAction.d.ts +4 -4
- package/types/events/WebEvent.d.ts +4 -4
- package/types/handlers/AutoCaptureHandler.d.ts +3 -3
- package/types/handlers/DomContentHandler.d.ts +2 -2
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.clck.2.8.5-nightly.2206-04.cjs.js.map +0 -1
- package/browser/ai.clck.2.8.5-nightly.2206-04.cjs.min.js +0 -6
- package/browser/ai.clck.2.8.5-nightly.2206-04.cjs.min.js.map +0 -1
- package/browser/ai.clck.2.8.5-nightly.2206-04.gbl.js.map +0 -1
- package/browser/ai.clck.2.8.5-nightly.2206-04.gbl.min.js +0 -6
- package/browser/ai.clck.2.8.5-nightly.2206-04.gbl.min.js.map +0 -1
- package/browser/ai.clck.2.8.5-nightly.2206-04.integrity.json +0 -66
- package/browser/ai.clck.2.8.5-nightly.2206-04.js.map +0 -1
- package/browser/ai.clck.2.8.5-nightly.2206-04.min.js +0 -6
- package/browser/ai.clck.2.8.5-nightly.2206-04.min.js.map +0 -1
package/src/common/Utils.ts
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "../Interfaces/Datamodel";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const Prototype = "prototype";
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
* File containing utility functions.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
_InternalMessageId, _eInternalMessageId, arrForEach, createEnumStyle, hasDocument, hasOwnProperty, isNullOrUndefined, objExtend
|
|
8
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
9
|
+
import { IClickAnalyticsConfiguration } from "../Interfaces/Datamodel";
|
|
10
|
+
|
|
13
11
|
const DEFAULT_DONOT_TRACK_TAG = "ai-dnt";
|
|
14
12
|
const DEFAULT_AI_BLOB_ATTRIBUTE_TAG = "ai-blob";
|
|
15
13
|
const DEFAULT_DATA_PREFIX = "data-";
|
|
16
14
|
|
|
15
|
+
export const enum _eExtendedInternalMessageId {
|
|
16
|
+
CannotParseAiBlobValue = 101,
|
|
17
|
+
InvalidContentBlob = 102,
|
|
18
|
+
TrackPageActionEventFailed = 103
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
export const _ExtendedInternalMessageId = {
|
|
18
22
|
..._InternalMessageId,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
...createEnumStyle<typeof _eExtendedInternalMessageId>({
|
|
24
|
+
CannotParseAiBlobValue: _eExtendedInternalMessageId.CannotParseAiBlobValue,
|
|
25
|
+
InvalidContentBlob: _eExtendedInternalMessageId.InvalidContentBlob,
|
|
26
|
+
TrackPageActionEventFailed: _eExtendedInternalMessageId.TrackPageActionEventFailed
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type _ExtendedInternalMessageId = number | _eExtendedInternalMessageId | _eInternalMessageId;
|
|
31
|
+
|
|
23
32
|
|
|
24
33
|
/**
|
|
25
34
|
* Finds attributes in overrideConfig which are invalid or should be objects
|
|
@@ -30,7 +39,7 @@ export const _ExtendedInternalMessageId = {
|
|
|
30
39
|
export function removeNonObjectsAndInvalidElements(overrideConfig: IClickAnalyticsConfiguration, attributeNamesExpectedObjects: Array<string>): void {
|
|
31
40
|
removeInvalidElements(overrideConfig);
|
|
32
41
|
for (var i in attributeNamesExpectedObjects) {
|
|
33
|
-
if (
|
|
42
|
+
if (hasOwnProperty(attributeNamesExpectedObjects, i)) {
|
|
34
43
|
var objectName = attributeNamesExpectedObjects[i];
|
|
35
44
|
if (typeof overrideConfig[objectName] === "object") {
|
|
36
45
|
removeInvalidElements(overrideConfig[objectName]);
|
|
@@ -258,54 +267,6 @@ export function bracketIt(str: string): string {
|
|
|
258
267
|
return "[" + str + "]";
|
|
259
268
|
}
|
|
260
269
|
|
|
261
|
-
/**
|
|
262
|
-
* Pass in the objects to merge as arguments.
|
|
263
|
-
* @param obj1 - object to merge. Set this argument to 'true' for a deep extend.
|
|
264
|
-
* @param obj2 - object to merge.
|
|
265
|
-
* @param obj3 - object to merge.
|
|
266
|
-
* @param obj4 - object to merge.
|
|
267
|
-
* @param obj5 - object to merge.
|
|
268
|
-
* @returns The extended object.
|
|
269
|
-
*/
|
|
270
|
-
export function extend(obj?: any, obj2?: any, obj3?: any, obj4?: any, obj5?: any): any {
|
|
271
|
-
// Variables
|
|
272
|
-
var extended = {};
|
|
273
|
-
var deep = false;
|
|
274
|
-
var i = 0;
|
|
275
|
-
var length = arguments.length;
|
|
276
|
-
var objProto = Object[Prototype];
|
|
277
|
-
var theArgs = arguments;
|
|
278
|
-
|
|
279
|
-
// Check if a deep merge
|
|
280
|
-
if (objProto.toString.call(theArgs[0]) === "[object Boolean]") {
|
|
281
|
-
deep = theArgs[0];
|
|
282
|
-
i++;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// Merge the object into the extended object
|
|
286
|
-
var merge = (obj: Object) => {
|
|
287
|
-
for (var prop in obj) {
|
|
288
|
-
if (hasOwnProperty(obj, prop)) {
|
|
289
|
-
// If deep merge and property is an object, merge properties
|
|
290
|
-
if (deep && objProto.toString.call(obj[prop]) === "[object Object]") {
|
|
291
|
-
extended[prop] = extend(true, extended[prop], obj[prop]);
|
|
292
|
-
} else {
|
|
293
|
-
extended[prop] = obj[prop];
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
// Loop through each object and conduct a merge
|
|
300
|
-
for (; i < length; i++) {
|
|
301
|
-
var obj = theArgs[i];
|
|
302
|
-
merge(obj);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return extended;
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
|
|
309
270
|
export function validateContentNamePrefix ( config: IClickAnalyticsConfiguration, defaultDataPrefix: string) {
|
|
310
271
|
return isValueAssigned(config.dataTags.customDataPrefix) && (config.dataTags.customDataPrefix.indexOf(defaultDataPrefix) === 0);
|
|
311
272
|
}
|
|
@@ -355,7 +316,7 @@ export function mergeConfig(overrideConfig: IClickAnalyticsConfiguration): IClic
|
|
|
355
316
|
if(isValueAssigned(overrideConfig.dataTags)) {
|
|
356
317
|
overrideConfig.dataTags.customDataPrefix = validateContentNamePrefix(overrideConfig, DEFAULT_DATA_PREFIX) ? overrideConfig.dataTags.customDataPrefix : DEFAULT_DATA_PREFIX;
|
|
357
318
|
}
|
|
358
|
-
return
|
|
319
|
+
return objExtend(true, defaultConfig, overrideConfig);
|
|
359
320
|
}
|
|
360
321
|
}
|
|
361
322
|
|
|
@@ -379,6 +340,4 @@ export function BehaviorValueValidator (behaviorArray: string[]) {
|
|
|
379
340
|
|
|
380
341
|
export function BehaviorEnumValidator (enumObj: any) {
|
|
381
342
|
return (key: string) => enumObj[key] || "";
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
|
|
343
|
+
}
|
package/src/events/PageAction.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
+
import { strNotSpecified } from "@microsoft/applicationinsights-common";
|
|
7
|
+
import {
|
|
8
|
+
ICustomProperties, IDiagnosticLogger, ITelemetryItem, _eInternalMessageId, _throwInternal, eLoggingSeverity, getPerformance, objExtend,
|
|
9
|
+
objForEachKey
|
|
10
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
11
|
+
import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin";
|
|
12
|
+
import { getClickTarget } from "../DataCollector";
|
|
13
|
+
import { IClickAnalyticsConfiguration, IContentHandler, IPageActionOverrideValues, IPageActionTelemetry } from "../Interfaces/Datamodel";
|
|
14
|
+
import { bracketIt, extractFieldFromObject, isValueAssigned } from "../common/Utils";
|
|
15
|
+
import { WebEvent } from "./WebEvent";
|
|
16
|
+
|
|
14
17
|
export class PageAction extends WebEvent {
|
|
15
18
|
|
|
16
19
|
constructor(
|
|
@@ -84,7 +87,7 @@ export class PageAction extends WebEvent {
|
|
|
84
87
|
}
|
|
85
88
|
// Fill PartB
|
|
86
89
|
if (element) {
|
|
87
|
-
pageActionEvent.targetUri =
|
|
90
|
+
pageActionEvent.targetUri = getClickTarget(element);
|
|
88
91
|
|
|
89
92
|
elementContent = _self._contentHandler.getElementContent(element); // collect id,cn tags
|
|
90
93
|
|
|
@@ -116,7 +119,7 @@ export class PageAction extends WebEvent {
|
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
_sanitizePageActionEventContent(elementContent);
|
|
119
|
-
pageActionEvent.content = bracketIt(JSON.stringify(
|
|
122
|
+
pageActionEvent.content = bracketIt(JSON.stringify(objExtend(
|
|
120
123
|
elementContent,
|
|
121
124
|
overrideValues && overrideValues.contentTags ? overrideValues.contentTags : {})));
|
|
122
125
|
|
|
@@ -191,4 +194,4 @@ export class PageAction extends WebEvent {
|
|
|
191
194
|
public capturePageAction(element: Element, overrideValues?: IPageActionOverrideValues, customProperties?: { [name: string]: string | number | boolean | string[] | number[] | boolean[] | object }, isRightClick?: boolean): void {
|
|
192
195
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
193
196
|
}
|
|
194
|
-
}
|
|
197
|
+
}
|
package/src/events/WebEvent.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
} from "
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
+
import {
|
|
7
|
+
IDiagnosticLogger, IProcessTelemetryUnloadContext, ITelemetryUnloadState, IUnloadableComponent, getLocation, hasWindow, objExtend
|
|
8
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
9
|
+
import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin";
|
|
10
|
+
import { getPageName, getUri } from "../DataCollector";
|
|
11
|
+
import {
|
|
12
|
+
IClickAnalyticsConfiguration, IContentHandler, ICoreData, IOverrideValues, IPageActionTelemetry, IPageTags
|
|
13
|
+
} from "../Interfaces/Datamodel";
|
|
14
|
+
import { isValueAssigned } from "../common/Utils";
|
|
15
|
+
|
|
14
16
|
export class WebEvent implements IUnloadableComponent {
|
|
15
17
|
|
|
16
18
|
protected _pageTags: IPageTags;
|
|
@@ -56,10 +58,10 @@ export class WebEvent implements IUnloadableComponent {
|
|
|
56
58
|
|
|
57
59
|
_self.setBasicProperties = (event: IPageActionTelemetry, overrideValues: IOverrideValues) => {
|
|
58
60
|
if (!isValueAssigned(event.name)) {
|
|
59
|
-
event.pageName =
|
|
61
|
+
event.pageName = getPageName(_self._config, overrideValues);
|
|
60
62
|
}
|
|
61
63
|
if (!isValueAssigned(event.uri) && hasWindow) {
|
|
62
|
-
event.uri =
|
|
64
|
+
event.uri = getUri(_self._config, getLocation());
|
|
63
65
|
}
|
|
64
66
|
};
|
|
65
67
|
|
|
@@ -93,10 +95,10 @@ export class WebEvent implements IUnloadableComponent {
|
|
|
93
95
|
// Prepare the pageTags object that is mostly the same for all events. Event specific pageTags will be added inside event constructors.
|
|
94
96
|
|
|
95
97
|
if (_self._pageTagsCallback) {
|
|
96
|
-
_self._pageTags =
|
|
98
|
+
_self._pageTags = objExtend(true, _self._pageTags, _self._pageTagsCallback());
|
|
97
99
|
}
|
|
98
100
|
if (isValueAssigned(overrideValues.pageTags)) {
|
|
99
|
-
_self._pageTags =
|
|
101
|
+
_self._pageTags = objExtend(true, _self._pageTags, overrideValues.pageTags);
|
|
100
102
|
}
|
|
101
103
|
// If metadata is present add it to pageTags property
|
|
102
104
|
if (_self._metaTags) {
|
|
@@ -197,4 +199,4 @@ export class WebEvent implements IUnloadableComponent {
|
|
|
197
199
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
198
200
|
return null;
|
|
199
201
|
}
|
|
200
|
-
}
|
|
202
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
-
import {
|
|
7
|
-
IDiagnosticLogger,
|
|
8
|
-
|
|
9
|
-
} from "@microsoft/applicationinsights-core-js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { PageAction } from "../events/PageAction";
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
+
import {
|
|
7
|
+
IDiagnosticLogger, IProcessTelemetryUnloadContext, ITelemetryUnloadState, createUniqueNamespace, eventOff, eventOn, getDocument,
|
|
8
|
+
getWindow, isNullOrUndefined, mergeEvtNamespace
|
|
9
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
10
|
+
import { ClickAnalyticsPlugin } from "../ClickAnalyticsPlugin";
|
|
11
|
+
import { ActionType } from "../Enums";
|
|
12
|
+
import { IAutoCaptureHandler, IClickAnalyticsConfiguration, IPageActionOverrideValues } from "../Interfaces/Datamodel";
|
|
13
|
+
import { isElementDnt, isKeyboardEnter, isKeyboardSpace, isLeftClick, isMiddleClick, isRightClick } from "../common/Utils";
|
|
14
|
+
import { PageAction } from "../events/PageAction";
|
|
15
|
+
|
|
16
16
|
const clickCaptureInputTypes = { BUTTON: true, CHECKBOX: true, RADIO: true, RESET: true, SUBMIT: true };
|
|
17
17
|
|
|
18
18
|
export class AutoCaptureHandler implements IAutoCaptureHandler {
|
|
@@ -118,4 +118,4 @@ export class AutoCaptureHandler implements IAutoCaptureHandler {
|
|
|
118
118
|
public _doUnload(unloadCtx?: IProcessTelemetryUnloadContext, unloadState?: ITelemetryUnloadState, asyncCallback?: () => void): void | boolean {
|
|
119
119
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
120
120
|
}
|
|
121
|
-
}
|
|
121
|
+
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "../common/Utils";
|
|
11
|
-
|
|
12
|
-
import { IClickAnalyticsConfiguration, IContent, IContentHandler } from "../Interfaces/Datamodel";
|
|
13
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dynamicProto from "@microsoft/dynamicproto-js";
|
|
6
|
+
import {
|
|
7
|
+
IDiagnosticLogger, _eInternalMessageId, _throwInternal, eLoggingSeverity, getDocument, hasDocument, isNullOrUndefined, objExtend
|
|
8
|
+
} from "@microsoft/applicationinsights-core-js";
|
|
9
|
+
import { IClickAnalyticsConfiguration, IContent, IContentHandler } from "../Interfaces/Datamodel";
|
|
10
|
+
import { isValueAssigned, removeInvalidElements, walkUpDomChainWithElementValidation } from "../common/Utils";
|
|
11
|
+
|
|
14
12
|
const MAX_CONTENTNAME_LENGTH = 200;
|
|
15
13
|
|
|
16
14
|
export class DomContentHandler implements IContentHandler {
|
|
@@ -64,16 +62,16 @@ export class DomContentHandler implements IContentHandler {
|
|
|
64
62
|
} else {
|
|
65
63
|
// traverse up the DOM to find the closest parent with data-* tag defined
|
|
66
64
|
//contentElement = walkUpDomChainWithElementValidation(element, _self._isTracked, dataTagPrefix);
|
|
67
|
-
elementContent =
|
|
65
|
+
elementContent = objExtend(elementContent, _populateElementContent(element, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag));
|
|
68
66
|
}
|
|
69
67
|
} else {
|
|
70
|
-
elementContent =
|
|
68
|
+
elementContent = objExtend(elementContent, _populateElementContentwithDataTag(element, dataTagPrefix, parentDataTagPrefix, aiBlobAttributeTag));
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
removeInvalidElements(elementContent);
|
|
74
72
|
|
|
75
73
|
if (parentDataTagPrefix) {
|
|
76
|
-
elementContent =
|
|
74
|
+
elementContent = objExtend(elementContent, _getParentDetails(element, elementContent, dataTagPrefix, aiBlobAttributeTag ));
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
return elementContent;
|
|
@@ -394,4 +392,4 @@ export class DomContentHandler implements IContentHandler {
|
|
|
394
392
|
// @DynamicProtoStub -- DO NOT add any code as this will be removed during packaging
|
|
395
393
|
return null;
|
|
396
394
|
}
|
|
397
|
-
}
|
|
395
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { IPlugin, IConfiguration, IAppInsightsCore, BaseTelemetryPlugin, ITelemetryItem, IProcessTelemetryContext, ITelemetryPluginChain, ICustomProperties } from "@microsoft/applicationinsights-core-js";
|
|
2
|
+
* @copyright Microsoft 2020
|
|
3
|
+
*/
|
|
5
4
|
import { IConfig } from "@microsoft/applicationinsights-common";
|
|
5
|
+
import { BaseTelemetryPlugin, IAppInsightsCore, IConfiguration, ICustomProperties, IPlugin, IProcessTelemetryContext, ITelemetryItem, ITelemetryPluginChain } from "@microsoft/applicationinsights-core-js";
|
|
6
6
|
import { IPageActionTelemetry } from "./Interfaces/Datamodel";
|
|
7
|
-
import { BehaviorMapValidator, BehaviorValueValidator
|
|
7
|
+
import { BehaviorEnumValidator, BehaviorMapValidator, BehaviorValueValidator } from "./common/Utils";
|
|
8
8
|
export { BehaviorMapValidator, BehaviorValueValidator, BehaviorEnumValidator };
|
|
9
9
|
export declare class ClickAnalyticsPlugin extends BaseTelemetryPlugin {
|
|
10
10
|
identifier: string;
|
package/types/DataCollector.d.ts
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare const _DYN_EXTENSION_CONFIG = "extensionConfig";
|
|
2
|
+
export declare const _DYN_PAGE_ACTION_PAGE_TAG0 = "pageActionPageTags";
|
|
3
|
+
export declare const _DYN_TRACK_PAGE_ACTION = "trackPageAction";
|
|
4
|
+
export declare const _DYN_LENGTH = "length";
|
|
5
|
+
export declare const _DYN_TAG_NAME = "tagName";
|
|
6
|
+
export declare const _DYN_TO_UPPER_CASE = "toUpperCase";
|
|
7
|
+
export declare const _DYN_PATHNAME = "pathname";
|
|
8
|
+
export declare const _DYN_ADD_EVENT_LISTENER = "addEventListener";
|
|
9
|
+
export declare const _DYN_PAGE_NAME = "pageName";
|
|
10
|
+
export declare const _DYN_CORE_DATA = "coreData";
|
|
11
|
+
export declare const _DYN_REQUEST_URI = "requestUri";
|
|
12
|
+
export declare const _DYN_GET_ATTRIBUTE = "getAttribute";
|
|
13
|
+
export declare const _DYN_PARENT_NODE = "parentNode";
|
|
14
|
+
export declare const _DYN_CUSTOM_DATA_PREFIX = "customDataPrefix";
|
|
15
|
+
export declare const _DYN_INDEX_OF = "indexOf";
|
|
16
|
+
export declare const _DYN_DATA_TAGS = "dataTags";
|
|
17
|
+
export declare const _DYN_USE_DEFAULT_CONTENT_1 = "useDefaultContentNameOrId";
|
|
18
|
+
export declare const _DYN_AI_BLOB_ATTRIBUTE_TA2 = "aiBlobAttributeTag";
|
|
19
|
+
export declare const _DYN_CAPTURE_ALL_META_DAT3 = "captureAllMetaDataContent";
|
|
20
|
+
export declare const _DYN_BEHAVIOR_VALIDATOR = "behaviorValidator";
|
|
21
|
+
export declare const _DYN_NAME = "name";
|
|
22
|
+
export declare const _DYN_DATA = "data";
|
|
23
|
+
export declare const _DYN_PAGE_TYPE = "pageType";
|
|
24
|
+
export declare const _DYN_PROPERTIES = "properties";
|
|
25
|
+
export declare const _DYN_ACTION_TYPE = "actionType";
|
|
26
|
+
export declare const _DYN_BEHAVIOR = "behavior";
|
|
27
|
+
export declare const _DYN_CLICK_COORDINATES = "clickCoordinates";
|
|
28
|
+
export declare const _DYN_CONTENT = "content";
|
|
29
|
+
export declare const _DYN_REF_URI = "refUri";
|
|
30
|
+
export declare const _DYN_PARENT_ID = "parentId";
|
|
31
|
+
export declare const _DYN_CAPTURE_PAGE_ACTION = "capturePageAction";
|
|
32
|
+
export declare const _DYN_SET_COMMON_PROPERTIE4 = "setCommonProperties";
|
|
33
|
+
export declare const _DYN_GET_ELEMENT_CONTENT = "getElementContent";
|
|
34
|
+
export declare const _DYN__GET_VALID_BEHAVIOR = "_getValidBehavior";
|
|
35
|
+
export declare const _DYN_CONTENT_NAME = "contentName";
|
|
36
|
+
export declare const _DYN__TRACE_LOGGER = "_traceLogger";
|
|
37
|
+
export declare const _DYN_CLICK_COORDINATE_X = "clickCoordinateX";
|
|
38
|
+
export declare const _DYN_CLICK_COORDINATE_Y = "clickCoordinateY";
|
|
39
|
+
export declare const _DYN__CONFIG = "_config";
|
|
40
|
+
export declare const _DYN_PARENT_DATA_TAG = "parentDataTag";
|
|
41
|
+
export declare const _DYN__PAGE_TAGS = "_pageTags";
|
|
42
|
+
export declare const _DYN__PAGE_TAGS_CALLBACK = "_pageTagsCallback";
|
|
43
|
+
export declare const _DYN__META_TAGS = "_metaTags";
|
|
44
|
+
export declare const _DYN_SET_BASIC_PROPERTIES = "setBasicProperties";
|
|
45
|
+
export declare const _DYN__PAGE_TYPE_META_TAG = "_pageTypeMetaTag";
|
|
46
|
+
export declare const _DYN__BEHAVIOR_META_TAG = "_behaviorMetaTag";
|
|
47
|
+
export declare const _DYN_PARENT_ELEMENT = "parentElement";
|
|
48
|
+
export declare const _DYN_ATTRIBUTES = "attributes";
|