Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-plugin-google-gtag]: Page and Title do not match in Analytics Dashboard #11592

Closed
krismorf opened this issue Feb 6, 2019 · 7 comments
Assignees
Labels
good first issue Issue that doesn't require previous experience with Gatsby status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@krismorf
Copy link
Contributor

krismorf commented Feb 6, 2019

Description

gatsby-plugin-google-gtag records an event when the user navigates through the site. I can see the events in my Analytics Dashboard but the Page Title is 1 iteration behind.

In Google Analytics this shows as:

Page Page Title Pageviews
/ (not set) 1
/page-1/ Home 1
/page-2/ Page 1 1
/page-3/ Page 2 1

Steps to reproduce

//gatsby-config.js
{
  resolve: `gatsby-plugin-google-gtag`,
  options: {
    trackingIds: [
      config.googleAnalyticsID, // Google Analytics / GA
    ],
    gtagConfig: {
      anonymize_ip: true,
      cookie_expires: 0,
    },
    pluginConfig: {
      head: false,
    },
  },
},

Environment

  System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node
    npm: 6.7.0 - ~/.nvm/versions/node/v10.15.1/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 72.0.3626.96
    Firefox: 65.0
    Safari: 12.0.3
  npmPackages:
    gatsby: ^2.0.118 => 2.0.118 
    gatsby-image: ^2.0.29 => 2.0.29 
    gatsby-plugin-canonical-urls: ^2.0.10 => 2.0.10 
    gatsby-plugin-feed: ^2.0.13 => 2.0.13 
    gatsby-plugin-google-gtag: ^1.0.13 => 1.0.13 
    gatsby-plugin-manifest: ^2.0.17 => 2.0.17 
    gatsby-plugin-netlify: ^2.0.10 => 2.0.10 
    gatsby-plugin-netlify-cache: ^1.0.0 => 1.0.0 
    gatsby-plugin-netlify-cms: ^3.0.12 => 3.0.12 
    gatsby-plugin-no-sourcemaps: ^2.0.2 => 2.0.2 
    gatsby-plugin-offline: ^2.0.23 => 2.0.23 
    gatsby-plugin-react-helmet: ^3.0.6 => 3.0.6 
    gatsby-plugin-robots-txt: ^1.4.0 => 1.4.0 
    gatsby-plugin-sharp: ^2.0.20 => 2.0.20 
    gatsby-plugin-sitemap: ^2.0.5 => 2.0.5 
    gatsby-plugin-styled-components: ^3.0.5 => 3.0.5 
    gatsby-plugin-typescript: ^2.0.7 => 2.0.7 
    gatsby-remark-images: ^3.0.3 => 3.0.3 
    gatsby-remark-relative-images: ^0.2.1 => 0.2.1 
    gatsby-source-filesystem: ^2.0.20 => 2.0.20 
    gatsby-transformer-remark: ^2.2.4 => 2.2.4 
    gatsby-transformer-sharp: ^2.1.13 => 2.1.13 
  npmGlobalPackages:
    gatsby-cli: 2.4.9
@sidharthachatterjee
Copy link
Contributor

@krismorf Does this only occur for / or other pages as well?

I'm not sure but might be related to gatsby-plugin-offline and the initial app shell not having the meta stuff in head.

@sidharthachatterjee sidharthachatterjee added the type: question or discussion Issue discussing or asking a question about Gatsby label Feb 8, 2019
@krismorf
Copy link
Contributor Author

krismorf commented Feb 9, 2019

@sidharthachatterjee With gatsby-plugin-offline disabled the (not set) value is fixed but same behavior when navigating through pages.

Actually the (not set) value shows some times in the dashboard.

@Greegko
Copy link

Greegko commented Feb 13, 2019

#9139 Google Analytics plugin has the same issue, it is about header tags update and events fire synchronisation issue.

@wardpeet wardpeet added good first issue Issue that doesn't require previous experience with Gatsby status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. labels Feb 15, 2019
@gi-alec
Copy link

gi-alec commented Feb 20, 2019

related to nfl/react-helmet#189
also an issue with gatsby-plugin-google-tagmanager

@JacobBlomgren
Copy link
Contributor

I'd like to work on this 🙋‍♂️

@cbravo
Copy link
Contributor

cbravo commented Jan 15, 2020

@JacobBlomgren The way this is set up there is no clear way to me to turn off page level tracking. My use case is that I want to enable users the ability to opt out of tracking entirely. Is there any method to do that which I am missing?

@griessel-jc
Copy link

@JacobBlomgren The way this is set up there is no clear way to me to turn off page level tracking. My use case is that I want to enable users the ability to opt out of tracking entirely. Is there any method to do that which I am missing?

I believe there is a config you can do "respectDNT: true" - https://www.gatsbyjs.com/plugins/gatsby-plugin-google-gtag/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

No branches or pull requests

8 participants