Comments (12)
@ttonyh I have just released v0.5.6 with the manual tracking removed.
If another issue persists, please open a separate issue.
from nuxt-gtag.
I have incorporated the initial page_view
into the plugin itself. Available in v0.5.5.
Please test it. Feedback much appreciated!
from nuxt-gtag.
@ttonyh Thanks for verifying. I believe so, too, since gtag.js will handle tracking all by itself. If someone wants to force the initial page_view
, he may do so manually:
if (process.client) {
// Send initial `page_view` event
useGtag('event', 'page_view', {
page_location: window.location.href,
page_path: useRoute().path,
page_title: document.title,
})
}
So everyone is happy. 🙂
from nuxt-gtag.
Same issue
from nuxt-gtag.
Mmmh… That's unfortunate. Any idea why Google Analytics might not pick up the initial page_view
?
from nuxt-gtag.
Is this being looked at? I feel like this is a major bug.
from nuxt-gtag.
It seems that the module is correctly setting up Google Analytics, but it's not sending the initial page_view
event. You can manually track the initial visit by sending a page_view
event after the Google Analytics script is loaded.
// Send initial `page_view` event
useGtag('event', 'page_view', {
page_location: window.location.href,
page_path: useRoute().path,
page_title: document.title,
})
from nuxt-gtag.
Thanks for the quick fix!
In my case, sending events has never worked with this plugin (or GA4?) unless I add send_to: 'G-...' to the event parameters, so that piece of code won't work.
Has anyone experienced the same problem?
from nuxt-gtag.
@soylomass Are you sure the GA ID is set in your nuxt.config.ts
? Please create a separate issue including your Nuxt configuration if that issue persists. Thanks!
from nuxt-gtag.
I have incorporated the initial
page_view
into the plugin itself. Available in v0.5.5. Please test it. Feedback much appreciated!
Thanks for the update.
I just tested it and it still does not seem to work.. In incognito and first page load, analytics only gets the event name 'first_visit'. The 'page_view' is still not being recognised by Google Analytics.
from nuxt-gtag.
@mroddev Have you tried verifying the page_view
event by using the Google Analytics Debugger extension:
https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna
It seems to be working based on the output of the extension.
More info for debugging:
https://support.google.com/analytics/answer/7201382?hl=en
from nuxt-gtag.
@johannschopplich I think the addition is causing the page_view
to register twice.
from nuxt-gtag.
Related Issues (20)
- Types for public runtime config HOT 1
- Tracking events when gtag not set up HOT 1
- Nuxt 2 compatibility HOT 4
- useTrackEvent typing improvement HOT 1
- Multiple tracking IDs HOT 3
- Nuxt 3.8.1
- Consent management HOT 6
- Nuxt types are missing after installing the module HOT 1
- Google Ads conversion linker HOT 1
- Automatic `page_view` events on router change HOT 3
- Data not collecting in SSG mode HOT 4
- Disable tracking while in development HOT 2
- Own subdomain as proxy
- Analytics Hits Not Registered After Update to 1.2.0 HOT 1
- Module option `initCommands` won't trigger HOT 1
- Persist consent state in session HOT 17
- Update documentation on nuxt.com/modules/gtag HOT 1
- Uncaught TypeError: `gtag` is not a function HOT 8
- Destructured method `gtag` is `undefined` HOT 3
- Uncaught TypeError: Cannot read properties of undefined (reading 'is_legacy_loaded') HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt-gtag.