Skip to content

Commit 422d76d

Browse files
Merge pull request #235271 from v-jbasden/v-jbasden-add-advanced-configuration-section
Changing "Configuration" heading to "Advanced configuration" and related updates
2 parents cdd5b8e + 757219d commit 422d76d

File tree

1 file changed

+35
-41
lines changed

1 file changed

+35
-41
lines changed

articles/azure-monitor/app/javascript-feature-extensions.md

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,9 @@ In this article, we cover the Click Analytics plug-in that automatically tracks
1919

2020
## Get started
2121

22-
Users can set up the Click Analytics Autocollection plug-in via npm.
22+
Users can set up the Click Analytics Auto-Collection plug-in via snippet or NPM.
2323

24-
### npm setup
25-
26-
Install the npm package:
27-
28-
```bash
29-
npm install --save @microsoft/applicationinsights-clickanalytics-js @microsoft/applicationinsights-web
30-
```
31-
32-
```js
33-
34-
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
35-
import { ClickAnalyticsPlugin } from '@microsoft/applicationinsights-clickanalytics-js';
36-
37-
const clickPluginInstance = new ClickAnalyticsPlugin();
38-
// Click Analytics configuration
39-
const clickPluginConfig = {
40-
autoCapture: true
41-
};
42-
// Application Insights Configuration
43-
const configObj = {
44-
connectionString: "YOUR CONNECTION STRING",
45-
extensions: [clickPluginInstance],
46-
extensionConfig: {
47-
[clickPluginInstance.identifier]: clickPluginConfig
48-
},
49-
};
50-
51-
const appInsights = new ApplicationInsights({ config: configObj });
52-
appInsights.loadAppInsights();
53-
```
54-
55-
## Snippet setup
24+
### Snippet setup
5625

5726
Ignore this setup if you use the npm setup.
5827

@@ -86,6 +55,37 @@ Ignore this setup if you use the npm setup.
8655
</script>
8756
```
8857

58+
### npm setup
59+
60+
Install the npm package:
61+
62+
```bash
63+
npm install --save @microsoft/applicationinsights-clickanalytics-js @microsoft/applicationinsights-web
64+
```
65+
66+
```js
67+
68+
import { ApplicationInsights } from '@microsoft/applicationinsights-web';
69+
import { ClickAnalyticsPlugin } from '@microsoft/applicationinsights-clickanalytics-js';
70+
71+
const clickPluginInstance = new ClickAnalyticsPlugin();
72+
// Click Analytics configuration
73+
const clickPluginConfig = {
74+
autoCapture: true
75+
};
76+
// Application Insights Configuration
77+
const configObj = {
78+
connectionString: "YOUR CONNECTION STRING",
79+
extensions: [clickPluginInstance],
80+
extensionConfig: {
81+
[clickPluginInstance.identifier]: clickPluginConfig
82+
},
83+
};
84+
85+
const appInsights = new ApplicationInsights({ config: configObj });
86+
appInsights.loadAppInsights();
87+
```
88+
8989
## Use the plug-in
9090

9191
1. Telemetry data generated from the click events are stored as `customEvents` in the Application Insights section of the Azure portal.
@@ -135,13 +135,13 @@ The following key properties are captured by default when the plug-in is enabled
135135
| --------------------- | ---------------------------------------|-----------------|
136136
| timeToAction | Time taken in milliseconds for the user to click the element since the initial page load. | 87407 |
137137

138-
## Configuration
138+
## Advanced configuration
139139

140140
| Name | Type | Default | Description |
141141
| --------------------- | -----------------------------------| --------| ---------------------------------------------------------------------------------------------------------------------------------------- |
142142
| auto-Capture | Boolean | True | Automatic capture configuration. |
143143
| callback | [IValueCallback](#ivaluecallback) | Null | Callbacks configuration. |
144-
| pageTags | String | Null | Page tags. |
144+
| pageTags | Object | Null | Page tags. |
145145
| dataTags | [ICustomDataTags](#icustomdatatags)| Null | Custom Data Tags provided to override default tags used to capture click data. |
146146
| urlCollectHash | Boolean | False | Enables the logging of values after a "#" character of the URL. |
147147
| urlCollectQuery | Boolean | False | Enables the logging of the query string of the URL. |
@@ -366,12 +366,6 @@ var appInsights = new Microsoft.ApplicationInsights.ApplicationInsights({
366366
appInsights.loadAppInsights();
367367
```
368368

369-
## Enable correlation
370-
371-
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.
372-
373-
JavaScript correlation is turned off by default to minimize the telemetry we send by default. To enable correlation, see the [JavaScript client-side correlation documentation](./javascript.md#enable-distributed-tracing).
374-
375369
## Sample app
376370

377371
[Simple web app with the Click Analytics Autocollection Plug-in enabled](https://go.microsoft.com/fwlink/?linkid=2152871)

0 commit comments

Comments
 (0)