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: docs/docs/adding-analytics.md
+11-7
Original file line number
Diff line number
Diff line change
@@ -26,24 +26,28 @@ You should now have a Tracking ID; take note of it, as your website will need to
26
26
27
27
You can find this tracking ID later by going to `Admin > Tracking Info > Tracking Code`.
28
28
29
-
## Using `gatsby-plugin-gtag`
29
+
## Using `gatsby-plugin-google-gtag`
30
30
31
31
Now, it's time to configure Gatsby to send page views to your Google Analytics account.
32
32
33
-
We are going to use `gatsby-plugin-gtag`. For other analytics options (including Google Tag Manager), check [other Gatsby analytics plugins](#other-gatsby-analytics-plugins).
33
+
We are going to use `gatsby-plugin-google-gtag`. For other analytics options (including Google Tag Manager), check [other Gatsby analytics plugins](#other-gatsby-analytics-plugins).
34
34
35
35
```shell
36
-
npm install gatsby-plugin-gtag
36
+
npm install gatsby-plugin-google-gtag
37
37
```
38
38
39
39
```js:title=gatsby-config.js
40
40
module.exports= {
41
41
plugins: [
42
42
{
43
-
resolve:`gatsby-plugin-gtag`,
43
+
resolve:`gatsby-plugin-google-gtag`,
44
44
options: {
45
-
// replace `UA-XXXXXXXXX-X` with your own Google Analytics Tracking ID
46
-
trackingId:`UA-XXXXXXXX-X`,
45
+
// You can add multiple tracking ids and a pageview event will be fired for all of them.
46
+
trackingIds: [
47
+
"GA-TRACKING_ID", // Google Analytics / GA
48
+
"AW-CONVERSION_ID", // Google Ads / Adwords / AW
49
+
"DC-FLOODIGHT_ID", // Marketing Platform advertising products (Display & Video 360, Search Ads 360, and Campaign Manager)
50
+
],
47
51
},
48
52
},
49
53
],
@@ -52,7 +56,7 @@ module.exports = {
52
56
53
57
> Note: Read more about [gatsby-config.js](/docs/gatsby-config/)
54
58
55
-
Full documentation for the plugin can be found [here](/packages/gatsby-plugin-gtag/).
59
+
Full documentation for the plugin can be found [here](/packages/gatsby-plugin-google-gtag/).
56
60
57
61
There are a number of extra configuration options--both with the Gatsby plugin and also in your Google Analytics account--so you can tailor things to meet your website's needs.
0 commit comments