You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/javascript-feature-extensions.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.reviewer: mmcc
11
11
12
12
# Feature extensions for Application Insights JavaScript SDK (Click Analytics)
13
13
14
-
App Insights JavaScript SDK feature extensions are additional features that can be added to the Application Insights JavaScript SDK to enhance its functionality.
14
+
App Insights JavaScript SDK feature extensions are extra features that can be added to the Application Insights JavaScript SDK to enhance its functionality.
15
15
16
16
In this article, we cover the Click Analytics plugin that automatically tracks click events on web pages and uses data-* attributes on HTML elements to populate event telemetry.
1. Telemetry data generated from the click events are stored as `customEvents` in the Application Insights section of the Azure portal.
90
90
2. The `name` of the customEvent is populated based on the following rules:
91
-
1. The `id` provided in the `data-*-id`will be used as the customEvent name. For example, if the clicked HTML element has the attribute "data-sample-id"="button1", then "button1" will be the customEvent name.
92
-
2. If no such attribute exists and if the `useDefaultContentNameOrId` is set to `true` in the configuration, then the clicked element's HTML attribute `id` or content name of the element will be used as the customEvent name. If both `id` and content name are present, precedence is given to `id`.
93
-
3. If `useDefaultContentNameOrId` is false, then the customEvent name will be "not_specified".
91
+
1. The `id` provided in the `data-*-id`is used as the customEvent name. For example, if the clicked HTML element has the attribute "data-sample-id"="button1", then "button1" is the customEvent name.
92
+
2. If no such attribute exists and if the `useDefaultContentNameOrId` is set to `true` in the configuration, then the clicked element's HTML attribute `id` or content name of the element is used as the customEvent name. If both `id` and content name are present, precedence is given to `id`.
93
+
3. If `useDefaultContentNameOrId` is false, then the customEvent name is "not_specified".
94
94
95
95
> [!TIP]
96
-
> Our recommendations is to set`useDefaultContentNameOrId` to true for generating meaningful data.
96
+
> We recommend settings`useDefaultContentNameOrId` to true for generating meaningful data.
97
97
3.`parentDataTag` does two things:
98
-
1. If this tag is present, the plugin will fetch the `data-*` attributes and values from all the parent HTML elements of the clicked element.
99
-
2. To improve efficiency, the plugin uses this tag as a flag, when encountered it will stop itself from further processing the DOM (Document Object Model) upwards.
98
+
1. If this tag is present, the plugin fetches the `data-*` attributes and values from all the parent HTML elements of the clicked element.
99
+
2. To improve efficiency, the plugin uses this tag as a flag, when encountered it stops itself from further processing the DOM (Document Object Model) upwards.
100
100
101
101
> [!CAUTION]
102
102
> Once `parentDataTag` is used, the SDK will begin looking for parent tags across your entire application and not just the HTML element where you used it.
103
-
4.`customDataPrefix` provided by the user should always start with `data-`, for example `data-sample-`. In HTML, the `data-*` global attributes are called custom data attributes, that allow proprietary information to be exchanged between the HTML and its DOM representation by scripts. Older browsers (Internet Explorer, Safari) will drop attributes that it doesn't understand, unless they start with `data-`.
103
+
4.`customDataPrefix` provided by the user should always start with `data-`, for example `data-sample-`. In HTML, the `data-*` global attributes are called custom data attributes that allow proprietary information to be exchanged between the HTML and its DOM representation by scripts. Older browsers (Internet Explorer, Safari) drop attributes that it doesn't understand, unless they start with `data-`.
104
104
105
105
The `*` in `data-*` may be replaced by any name following the [production rule of XML names](https://www.w3.org/TR/REC-xml/#NT-Name) with the following restrictions:
106
106
- The name must not start with "xml", whatever case is used for these letters.
@@ -124,7 +124,7 @@ The following are some of the key properties captured by default when the plugin
124
124
| actionType | Action type that caused the click event. Can be left or right click. | CL |
125
125
| baseTypeSource | Base Type source of the custom event. | ClickEvent |
126
126
| clickCoordinates | Coordinates where the click event is triggered. | 659X47 |
127
-
| content | Placeholder to store additional`data-*` attributes and values. |[{sample1:value1, sample2:value2}]|
127
+
| content | Placeholder to store extra`data-*` attributes and values. |[{sample1:value1, sample2:value2}]|
128
128
| pageName | Title of the page where the click event is triggered. | Sample Title |
129
129
| parentId | ID or name of the parent element | navbarContainer |
130
130
@@ -144,8 +144,8 @@ The following are some of the key properties captured by default when the plugin
144
144
| urlCollectHash | Boolean | False | Enables the logging of values after a "#" character of the URL. |
145
145
| urlCollectQuery | Boolean | False | Enables the logging of the query string of the URL. |
146
146
| behaviorValidator | Function | Null | Callback function to use for the `data-*-bhvr` value validation. For more information, go to [behaviorValidator section](#behaviorvalidator).|
147
-
| defaultRightClickBhvr | String (or) number | '' | Default Behavior value when Right Click event has occurred. This value will be overridden if the element has the `data-*-bhvr` attribute. |
148
-
| dropInvalidEvents | Boolean | False | Flag to drop events that do not have useful click data. |
147
+
| defaultRightClickBhvr | String (or) number | '' | Default Behavior value when Right Click event has occurred. This value is overridden if the element has the `data-*-bhvr` attribute. |
148
+
| dropInvalidEvents | Boolean | False | Flag to drop events that don't have useful click data. |
149
149
150
150
### IValueCallback
151
151
@@ -159,17 +159,17 @@ The following are some of the key properties captured by default when the plugin
159
159
160
160
| Name | Type | Default | Default Tag to Use in HTML | Description |
| useDefaultContentNameOrId | Boolean | False | N/A |Collects standard HTML attribute for contentName when a particular element is not tagged with default customDataPrefix or when customDataPrefix is not provided by user. |
162
+
| useDefaultContentNameOrId | Boolean | False | N/A |Collects standard HTML attribute for contentName when a particular element isn't tagged with default customDataPrefix or when customDataPrefix isn't provided by user. |
163
163
| customDataPrefix | String |`data-`|`data-*`| Automatic capture content name and value of elements that are tagged with provided prefix. For example, `data-*-id`, `data-<yourcustomattribute>` can be used in the HTML tags. |
164
164
| aiBlobAttributeTag | String |`ai-blob`|`data-ai-blob`| Plugin supports a JSON blob attribute instead of individual `data-*` attributes. |
165
165
| metaDataPrefix | String | Null | N/A | Automatic capture HTML Head's meta element name and content with provided prefix when capture. For example, `custom-` can be used in the HTML meta tag. |
166
-
| captureAllMetaDataContent | Boolean | False | N/A | Automatic capture all HTML Head's meta element names and content. Default is false. If enabled this will override provided metaDataPrefix. |
166
+
| captureAllMetaDataContent | Boolean | False | N/A | Automatic capture all HTML Head's meta element names and content. Default is false. If enabled it overrides provided metaDataPrefix. |
167
167
| parentDataTag | String | Null | N/A | Stops traversing up the DOM to capture content name and value of elements when encountered with this tag. For example, `data-<yourparentDataTag>` can be used in the HTML tags.|
168
-
| dntDataTag | String |`ai-dnt`|`data-ai-dnt`| HTML elements with this attribute will be ignored by the plugin for capturing telemetry data.|
168
+
| dntDataTag | String |`ai-dnt`|`data-ai-dnt`| HTML elements with this attribute are ignored by the plugin for capturing telemetry data.|
169
169
170
170
### behaviorValidator
171
171
172
-
The behaviorValidator functions automatically checks that tagged behaviors in code conform to a pre-defined list. This ensures tagged behaviors are consistent with your enterprise's established taxonomy. It is not required or expected that most Azure Monitor customers will use these functions, but they're available for advanced scenarios. There are three different behaviorValidator callback functions exposed as part of this extension. However, users can use their own callback functions if the exposed functions do not solve your requirement. The intent is to bring your own behaviors data structure, the plugin uses this validator function while extracting the behaviors from the data tags.
172
+
The behaviorValidator functions automatically check that tagged behaviors in code conform to a pre-defined list. It ensures tagged behaviors are consistent with your enterprise's established taxonomy. It isn't required or expected that most Azure Monitor customers use these functions, but they're available for advanced scenarios. There are three different behaviorValidator callback functions exposed as part of this extension. However, users can use their own callback functions if the exposed functions don't solve your requirement. The intent is to bring your own behaviors data structure, the plugin uses this validator function while extracting the behaviors from the data tags.
Correlation generates and sends data that enables distributed tracing and powers the [application map](../app/app-map.md), [end-to-end transaction view](../app/app-map.md#go-to-details), and other diagnostic tools.
368
368
369
-
In JavaScript correlation is turned off by default in order to minimize the telemetry we send by default. To enable correlation please reference [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
369
+
JavaScript correlation is turned off by default in order to minimize the telemetry we send by default. To enable correlation, reference [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/javascript-framework-extensions.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Framework extensions for Application Insights JavaScript SDK
3
-
description: Learn how to install and use Javascript framework extensions for the Application Insights JavaScript SDK.
3
+
description: Learn how to install and use JavaScript framework extensions for the Application Insights JavaScript SDK.
4
4
services: azure-monitor
5
5
ms.tgt_pltfrm: ibiza
6
6
ms.topic: conceptual
@@ -13,7 +13,7 @@ ms.reviewer: mmcc
13
13
14
14
In addition to the core SDK, there are also plugins available for specific frameworks, such as the [React plugin](javascript-framework-extensions.md?tabs=react), the [React Native plugin](javascript-framework-extensions.md?tabs=reactnative), and the [Angular plugin](javascript-framework-extensions.md?tabs=angular).
15
15
16
-
These plugins provide additional functionality and integration with the specific framework.
16
+
These plugins provide extra functionality and integration with the specific framework.
17
17
18
18
## [React](#tab/react)
19
19
@@ -282,7 +282,7 @@ The React Native plugin for Application Insights JavaScript SDK collects device
282
282
283
283
### Requirements
284
284
285
-
You must be using a version >= 2.0.0 of `@microsoft/applicationinsights-web`. This plugin will only work in react-native apps. It will not work with [apps using the Expo framework](https://docs.expo.io/), therefore it will not work with Create React Native App.
285
+
You must be using a version >= 2.0.0 of `@microsoft/applicationinsights-web`. This plugin works in react-native apps. It doesn't work with [apps using the Expo framework](https://docs.expo.io/), therefore it doesn't work with Create React Native App.
Correlation generates and sends data that enables distributed tracing and powers the [application map](../app/app-map.md), [end-to-end transaction view](../app/app-map.md#go-to-details), and other diagnostic tools.
323
323
324
-
In JavaScript correlation is turned off by default in order to minimize the telemetry we send by default. To enable correlation please reference [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
324
+
JavaScript correlation is turned off by default in order to minimize the telemetry we send by default. To enable correlation, reference [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
325
325
326
326
#### PageView
327
327
328
-
If a custom `PageView` duration is not provided, `PageView` duration defaults to a value of 0.
328
+
If a custom `PageView` duration isn't provided, `PageView` duration defaults to a value of 0.
329
329
330
330
331
331
## [Angular](#tab/angular)
@@ -407,7 +407,7 @@ export class AppModule { }
407
407
408
408
Correlation generates and sends data that enables distributed tracing and powers the [application map](../app/app-map.md), [end-to-end transaction view](../app/app-map.md#go-to-details), and other diagnostic tools.
409
409
410
-
In JavaScript correlation is turned off by default in order to minimize the telemetry we send by default. To enable correlation please reference [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
410
+
JavaScript correlation is turned off by default in order to minimize the telemetry we send by default. To enable correlation, reference [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
411
411
412
412
#### Route tracking
413
413
@@ -418,7 +418,7 @@ The Angular Plugin automatically tracks route changes and collects other Angular
418
418
419
419
#### PageView
420
420
421
-
If a custom `PageView` duration is not provided, `PageView` duration defaults to a value of 0.
421
+
If a custom `PageView` duration isn't provided, `PageView` duration defaults to a value of 0.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/javascript-sdk-upgrade.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,4 +45,8 @@ If you're using the current application insights PRODUCTION SDK (1.0.20) and wan
45
45
});
46
46
```
47
47
48
-
Test in an internal environment to verify the monitoring telemetry is working as expected. If all works, update your API signatures appropriately to SDK v2 and deploy in your production environments.
48
+
Test in an internal environment to verify the monitoring telemetry is working as expected. If all works, update your API signatures appropriately to SDK v2 and deploy in your production environments.
49
+
50
+
## Next steps
51
+
- To learn more about the JavaScript SDK, see the [Application Insights JavaScript SDK documentation](javascript.md).
52
+
- To learn about the Kusto Query Language and querying data in Log Analytics, see the [Log query overview](../../azure-monitor/logs/log-query-overview.md).
0 commit comments