Skip to content

Commit 81a2d09

Browse files
committed
enable gtag analytics.
1 parent 9903b90 commit 81a2d09

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

gatsby-config.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ module.exports = {
7777
}
7878
},
7979
{
80-
resolve: "gatsby-plugin-google-analytics",
80+
resolve: "gatsby-plugin-google-gtag",
8181
options: {
82-
trackingId: "UA-156016480-1",
83-
head: true,
84-
}
82+
// You can add multiple tracking ids and a pageview event will be fired for all of them.
83+
trackingIds: [
84+
"330707515" // Google Analytics / GA
85+
],
86+
},
8587
},
8688
{
8789
resolve: `gatsby-theme-blog-core`,

jekyll/_config.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,10 @@ social:
7474
links: # An array of links to social media profiles
7575

7676
# Analytics
77-
analytics:
78-
provider : "google" # false (default), "google", "google-universal", "custom"
79-
google:
80-
tracking_id : "UA-2030587-2"
81-
77+
# analytics:
78+
# provider : "google" # false (default), "google", "google-universal", "custom"
79+
# google:
80+
# tracking_id : "UA-2030587-2"
8281

8382
# Site Author
8483
author:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"gatsby": "^4.22.0",
1010
"gatsby-plugin-feed": "^4.22.0",
1111
"gatsby-plugin-gatsby-cloud": "^4.22.0",
12-
"gatsby-plugin-google-analytics": "^4.22.0",
12+
"gatsby-plugin-google-gtag": "^4.22.0",
1313
"gatsby-plugin-image": "^2.22.0",
1414
"gatsby-plugin-manifest": "^4.22.0",
1515
"gatsby-plugin-offline": "^5.22.0",
@@ -55,4 +55,4 @@
5555
"bugs": {
5656
"url": "https://github.com/gatsbyjs/gatsby/issues"
5757
}
58-
}
58+
}

0 commit comments

Comments
 (0)