remove GA script tag and use Gatsby plugin (#756)

This commit is contained in:
Vim 2021-09-27 13:54:10 -07:00 committed by GitHub
commit ca7d688623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 5 deletions

View file

@ -9,6 +9,46 @@ module.exports = {
},
pathPrefix: `${process.env.PATH_PREFIX}`,
plugins: [
{
resolve: `gatsby-plugin-google-analytics`,
options: {
// The property ID; the tracking code won't be generated without it
trackingId: 'UA-33523145-1',
// Defines where to place the tracking script - `true` in the head and `false` in the body
head: false,
// Setting this parameter is optional
anonymize: true,
// Setting this parameter is also optional
respectDNT: true,
// Avoids sending pageview hits from custom paths
// exclude: ['/preview/**', '/do-not-track/me/too/'],
// Delays sending pageview hits on route update (in milliseconds)
pageTransitionDelay: 0,
// Enables Google Optimize using your container Id
// optimizeId: 'YOUR_GOOGLE_OPTIMIZE_TRACKING_ID',
// Enables Google Optimize Experiment ID
// experimentId: 'YOUR_GOOGLE_EXPERIMENT_ID',
// Set Variation ID. 0 for original 1,2,3....
// variationId: 'YOUR_GOOGLE_OPTIMIZE_VARIATION_ID',
// Defers execution of google analytics script after page load
defer: false,
// Any additional optional fields
sampleRate: 5,
siteSpeedSampleRate: 10,
cookieDomain: 'screeningtool.geoplatform.gov',
// defaults to false
enableWebVitalsTracking: true,
},
},
{
resolve: 'gatsby-plugin-sass',
options: {