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
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,6 +173,8 @@ When you define the `data-parentid` or `data-*-parentid` attribute, the plug-in
173
173
174
174
If you declare `parentDataTag` and define the `data-parentid` or `data-*-parentid` attribute, precedence is given to `data-parentid` or `data-*-parentid`.
175
175
176
+
If the "Click Event rows with no parentId value" telemetry warning appears, see [Fix the "Click Event rows with no parentId value" warning](/troubleshoot/azure/azure-monitor/app-insights/javascript-sdk-troubleshooting#fix-the-click-event-rows-with-no-parentid-value-warning).
177
+
176
178
For examples showing which value is fetched as the `parentId` for different configurations, see [Examples of `parentid` key](#examples-of-parentid-key).
177
179
178
180
> [!CAUTION]
@@ -250,6 +252,8 @@ To reduce the bytes you pass, pass in the number value instead of the full text
250
252
251
253
#### Sample usage with behaviorValidator
252
254
255
+
Here's a sample of what a behavior map validator might look like. Yours could look different, depending on your organization's taxonomy and the events you collect.
256
+
253
257
```js
254
258
var clickPlugin =Microsoft.ApplicationInsights.ClickAnalyticsPlugin;
255
259
var clickPluginInstance =newclickPlugin();
@@ -446,6 +450,8 @@ The following examples show which value is fetched as the `parentId` for differe
446
450
447
451
### Example 1
448
452
453
+
In example 1, the `parentDataTag` isn't declared and `data-parentid` or `data-*-parentid` isn't defined in any element.
For example 1, for clicked element `<Button>`, the value of `parentId` is `“not_specified”`, because `parentDataTag` is not declared and the `data-parentid` or `data-*-parentid` is not defined in any element.
474
+
For clicked element `<Button>`, the value of `parentId` is `“not_specified”`, because `parentDataTag` is not declared and the `data-parentid` or `data-*-parentid` is not defined in any element.
469
475
470
476
### Example 2
471
477
478
+
In example 2, `parentDataTag` is declared and `data-parentid` is defined.
For example 2, for clicked element `<Button>`, the value of `parentId` is `parentid2`. Even though `parentDataTag` is declared, the `data-parentid` definition takes precedence. If the `data-parentid` attribute was defined within the div element with `className=”test2”`, the value for `parentId` would still be `parentid2`.
499
+
For clicked element `<Button>`, the value of `parentId` is `parentid2`. Even though `parentDataTag` is declared, the `data-parentid` definition takes precedence. If the `data-parentid` attribute was defined within the div element with `className=”test2”`, the value for `parentId` would still be `parentid2`.
492
500
493
-
### Example 3
501
+
### Example 3
502
+
503
+
In example 3, `parentDataTag` is declared and the `data-parentid` or `data-*-parentid` attribute isn’t defined.
For example 3, for clicked element `<Button>`, because `parentDataTag` is declared and the `data-parentid` or `data-*-parentid` attribute isn’t defined, the value of `parentId` is `test6parent`. It's `test6parent` because when `parentDataTag` is declared, the plug-in fetches the value of the `id` or `data-*-id` attribute from the parent HTML element that is closest to the clicked element. Because `data-group="buttongroup1"` is defined, the plug-in finds the `parentId` more efficiently.
525
+
For clicked element `<Button>`, because `parentDataTag` is declared and the `data-parentid` or `data-*-parentid` attribute isn’t defined, the value of `parentId` is `test6parent`. It's `test6parent` because when `parentDataTag` is declared, the plug-in fetches the value of the `id` or `data-*-id` attribute from the parent HTML element that is closest to the clicked element. Because `data-group="buttongroup1"` is defined, the plug-in finds the `parentId` more efficiently.
516
526
517
527
If you remove the `data-group="buttongroup1"` attribute, the value of `parentId` is still `test6parent`, because `parentDataTag` is still declared.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/javascript-sdk-configuration.md
+91-2Lines changed: 91 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ The Azure Application Insights JavaScript SDK provides configuration for trackin
22
22
23
23
These configuration fields are optional and default to false unless otherwise stated.
24
24
25
+
For instructions on how to add SDK configuration, see [Add SDK configuration](./javascript-sdk.md#optional-add-sdk-configuration).
26
+
25
27
| Name | Type | Default |
26
28
|------|------|---------|
27
29
| accountId<br><br>An optional account ID, if your app groups users into accounts. No spaces, commas, semicolons, equals, or vertical bars | string | null |
@@ -91,7 +93,7 @@ These configuration fields are optional and default to false unless otherwise st
91
93
92
94
Starting from version 2.6.0, the Azure Application Insights JavaScript SDK provides instance-based cookie management that can be disabled and re-enabled after initialization.
93
95
94
-
If you disabled cookies during initialization using the `disableCookiesUsage` or `cookieCfg.enabled` configurations, you can re-enable them using the `setEnabled` function of the ICookieMgr object.
96
+
If you disabled cookies during initialization using the `disableCookiesUsage` or `cookieCfg.enabled` configurations, you can re-enable them using the `setEnabled` function of the [ICookieMgr object](https://microsoft.github.io/ApplicationInsights-JS/webSdk/applicationinsights-core-js/interfaces/ICookieMgr.html).
95
97
96
98
The instance-based cookie management replaces the previous CoreUtils global functions of `disableCookies()`, `setCookie()`, `getCookie()`, and `deleteCookie()`.
97
99
@@ -121,9 +123,85 @@ Source map support helps you debug minified JavaScript code with the ability to
121
123
> [!div class="checklist"]
122
124
> - Compatible with all current integrations on the **Exception Details** panel
123
125
> - Supports all current and future JavaScript SDKs, including Node.JS, without the need for an SDK upgrade
126
+
127
+
### Link to Blob Storage account
128
+
129
+
Application Insights supports the uploading of source maps to your Azure Storage account blob container. You can use source maps to unminify call stacks found on the **End-to-end transaction details** page. You can also use source maps to unminify any exception sent by the [JavaScript SDK][ApplicationInsights-JS] or the [Node.js SDK][ApplicationInsights-Node.js].
130
+
131
+

132
+
133
+
#### Create a new storage account and blob container
134
+
135
+
If you already have an existing storage account or blob container, you can skip this step.
136
+
137
+
1.[Create a new storage account][create storage account].
138
+
1.[Create a blob container][create blob container] inside your storage account. Set **Public access level** to **Private** to ensure that your source maps aren't publicly accessible.
139
+
140
+
> [!div class="mx-imgBorder"]
141
+
>
142
+
143
+
#### Push your source maps to your blob container
144
+
145
+
Integrate your continuous deployment pipeline with your storage account by configuring it to automatically upload your source maps to the configured blob container.
146
+
147
+
You can upload source maps to your Azure Blob Storage container with the same folder structure they were compiled and deployed with. A common use case is to prefix a deployment folder with its version, for example, `1.2.3/static/js/main.js`. When you unminify via an Azure blob container called `sourcemaps`, the pipeline tries to fetch a source map located at `sourcemaps/1.2.3/static/js/main.js.map`.
148
+
149
+
##### Upload source maps via Azure Pipelines (recommended)
150
+
151
+
If you're using Azure Pipelines to continuously build and deploy your application, add an [Azure file copy][azure file copy] task to your pipeline to automatically upload your source maps.
152
+
153
+
> [!div class="mx-imgBorder"]
154
+
> 
155
+
156
+
#### Configure your Application Insights resource with a source map storage account
157
+
158
+
You have two options for configuring your Application Insights resource with a source map storage account.
159
+
160
+
##### End-to-end transaction details tab
161
+
162
+
From the **End-to-end transaction details** tab, select **Unminify**. Configure your resource if it's unconfigured.
163
+
164
+
1. In the Azure portal, view the details of an exception that's minified.
165
+
1. Select **Unminify**.
166
+
1. If your resource isn't configured, configure it.
167
+
168
+
##### Properties tab
169
+
170
+
To configure or change the storage account or blob container that's linked to your Application Insights resource:
171
+
172
+
1. Go to the **Properties** tab of your Application Insights resource.
173
+
1. Select **Change source map Blob Container**.
174
+
1. Select a different blob container as your source map container.
175
+
1. Select **Apply**.
176
+
177
+
> [!div class="mx-imgBorder"]
178
+
> 
179
+
180
+
#### Troubleshooting
181
+
182
+
This section offers troubleshooting tips for common issues related to the uploading of source maps to your Azure Storage account blob container.
183
+
184
+
##### Required Azure role-based access control settings on your blob container
185
+
186
+
Any user on the portal who uses this feature must be assigned at least as a [Storage Blob Data Reader][storage blob data reader] to your blob container. Assign this role to anyone who might use the source maps through this feature.
187
+
188
+
> [!NOTE]
189
+
> Depending on how the container was created, this role might not have been automatically assigned to you or your team.
190
+
191
+
##### Source map not found
192
+
193
+
1. Verify that the corresponding source map is uploaded to the correct blob container.
194
+
1. Verify that the source map file is named after the JavaScript file it maps to and uses the suffix `.map`.
195
+
196
+
For example, `/static/js/main.4e2ca5fa.chunk.js` searches for the blob named `main.4e2ca5fa.chunk.js.map`.
197
+
1. Check your browser's console to see if any errors were logged. Include this information in any support ticket.
198
+
199
+
### View the unminified callstack
124
200
125
201
To view the unminified callstack, select an Exception Telemetry item in the Azure portal, find the source maps that match the call stack, and drag and drop the source maps onto the call stack in the Azure portal. The source map must have the same name as the source file of a stack frame, but with a `map` extension.
126
202
203
+
If you experience issues that involve source map support for JavaScript applications, see [Troubleshoot source map support for JavaScript applications](/troubleshoot/azure/azure-monitor/app-insights/javascript-sdk-troubleshooting#troubleshoot-source-map-support-for-javascript-applications).
@@ -149,6 +227,8 @@ The static classes were changed to const objects that reference the new exported
149
227
150
228
### Tree shaking deprecated functions and replacements
151
229
230
+
This section only applies to you if you're using the deprecated functions and you want to optimize package size. We recommend using the replacement functions to reduce size and support all the versions of Internet Explorer.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/javascript-sdk.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,17 @@ ms.reviewer: mmcc
12
12
13
13
The Microsoft Azure Monitor Application Insights JavaScript SDK collects usage data which allows you to monitor and analyze the performance of JavaScript web applications. This is commonly referred to as Real User Monitoring or RUM.
14
14
15
+
The Application Insights JavaScript SDK has a base SDK and several plugins for additional capabilities.
16
+
17
+
:::image type="content" source="media/javascript-sdk/conceptual-diagram-javascript-sdk.png" alt-text="Conceptual diagram that shows the Application Insights JavaScript SDK, its plugins/extensions, and their relationship to each other." lightbox="media/javascript-sdk/conceptual-diagram-javascript-sdk.png":::
18
+
15
19
We collect page views by default. But if you want to also collect clicks by default, consider adding the [Click Analytics Auto-Collection plug-in](./javascript-feature-extensions.md):
16
20
17
21
- If you're adding a [framework extension](./javascript-framework-extensions.md), which you can [add](#optional-add-advanced-sdk-configuration) after you follow the steps to get started below, you'll have the option to add Click Analytics when you add the framework extension.
18
22
- If you're not adding a framework extension, [add the Click Analytics plug-in](./javascript-feature-extensions.md) after you follow the steps to get started.
19
23
24
+
We provide the [Debug plugin](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-debugplugin-js/README.md) and [Performance plugin](https://github.com/microsoft/ApplicationInsights-JS/blob/main/extensions/applicationinsights-perfmarkmeasure-js/README.md) for debugging/testing. In rare cases, it's possible to build your own extension by adding a [custom plugin](https://github.com/microsoft/ApplicationInsights-JS/blob/e4be62c0aa9318b540157118b729bb0c4d8b6c6e/API-reference.md#custom-extension).
25
+
20
26
## Prerequisites
21
27
22
28
- Azure subscription: [Create an Azure subscription for free](https://azure.microsoft.com/free/)
@@ -142,7 +148,7 @@ If you want to use the extra features provided by plugins for specific framework
142
148
-**Page View** for Azure Monitor Application Insights Real User Monitoring
143
149
-**Custom Event** for the Click Analytics Auto-Collection plug-in.
144
150
145
-
It might take a few minutes for data to show up in the portal.
151
+
It might take a few minutes for data to show up in the portal. If the only data you see showing up is a load failure exception, see [Troubleshoot SDK load failure for JavaScript web apps](/troubleshoot/azure/azure-monitor/app-insights/javascript-sdk-troubleshooting#troubleshoot-sdk-load-failure-for-javascript-web-apps).
146
152
147
153
:::image type="content" source="media/javascript-sdk/confirm-data-flowing.png" alt-text="Screenshot of the Application Insights Transaction search pane in the Azure portal with the Page View option selected. The page views are highlighted." lightbox="media/javascript-sdk/confirm-data-flowing.png":::
0 commit comments