MatrixAI / Polykey-Docs

Documentation for Polykey
https://polykey.com/docs/
GNU General Public License v3.0
1 stars 5 forks source link

JavaScript Error: 'window.gtag is not a function' Impeding Google Tag Manager Integration #94

Closed CryptoTotalWar closed 4 months ago

CryptoTotalWar commented 4 months ago

Describe the bug

In the deployed version of our Docusaurus site, we are encountering a JavaScript error in the browser console stating TypeError: window.gtag is not a function. This issue seems to affect the functionality of Google Analytics tracking on the site.

To Reproduce

  1. npm start the repo in local development
  2. click on any page of the docs
  3. Observe the error window.gtag is not a function in the console log.
  4. The error occurs on each page load, affecting all pages where Google Analytics tracking is expected to function.

Expected behavior

Google Analytics should track page views without any errors. The window.gtag function should be defined and work correctly to send tracking information to Google Analytics.

Screenshots

image

Platform (please complete the following information)

Additional context

Encountered a JavaScript error: window.gtag is not a function, suggesting issues with the script execution of Google Tag Manager's (gtag.js). This issue persists across multiple browsers and rollback attempts, affecting potential user engagement tracking across the documentation site.

Here's some context from the last PR that was related to gtag implementation but its related to the polykey.com repo... i haven't checked there yet if the same problem/warning is persisting. https://github.com/MatrixAI/polykey.com/pull/45

I also have access to the Google Analytics account to verify the ID, etc.

Notify maintainers

linear[bot] commented 4 months ago

PRO-204 JavaScript Error: 'window.gtag is not a function' Impeding Google Tag Manager Integration

shafiqihtsham commented 4 months ago

Closing for now as issue is no longer occurring @CryptoTotalWar .

image

Just got it again.

CryptoTotalWar commented 4 months ago

It still works fine... but we will need to investigate this when we're looking into the Google Analytics stuff. We can keep this closed for now...