octue / planex-site

The octue website front end
https://planex-site.vercel.app
0 stars 0 forks source link

Google Analytics #11

Closed thclark closed 3 years ago

thclark commented 3 years ago

Feature request

Use Case

We want to have google analytics embedded so that we can understand how people are using the site.

Current state

We have a GA account; just need to embed the script in the page appropriately - perhaps there's a gatsby plugin for this?

thclark commented 3 years ago

Just came across this configuration used previously for engineers-for-doctors


        {
          resolve: `gatsby-plugin-google-analytics`,
          options: {
                // The property ID; the tracking code won't be generated without it
                trackingId: "UA-161607784-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",
                // Any additional optional fields
                // sampleRate: 5,
                // siteSpeedSampleRate: 10,
                cookieDomain: "engineers-for-doctors.org",
          },
AndyClifton commented 3 years ago

@thclark My memory is fuzzy but I suspect google analytics also sets a cookie. Therefore we need a cookie notice, which I don't think we have at this time. -> New issue?