You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite the above configuration, the scripts are not loading during SSR, and Google Analytics tracking is not working. When inspecting the browser's developer tools, I can see that the script tags are not being added.
💡 What I've Tried
Adding scripts in app.head.script using defineNuxtConfig
Creating a plugins/gtag.client.js file and setting up the plugin
Checking the presence of script tags in the browser's developer tools
🙏 Question
What configuration is necessary to load scripts during SSR using app.head.script in Nuxt 3? Also, what steps do I need to take to ensure Google Analytics tracking functions correctly?
I would greatly appreciate any guidance on this matter. Thank you in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Scripts in
app.head.scriptnot loading during SSR in Nuxt BridgeDemo: https://stackblitz.com/edit/github-svkdwc-46v9d3?file=nuxt.config.ts
Is it that [email protected], which is used by Nuxt2/Bridge, does not support the syntax of Nuxt3?
Problem
I have added scripts to
app.head.scriptusingdefineNuxtConfigin Nuxt 3, but the scripts are not loading during server-side rendering (SSR).Configuration
I have set up the scripts in
defineNuxtConfigas follows:Additionally, I have created a
plugins/gtag.client.jsfile and set up the plugin as follows:🤔 Problem Details
Despite the above configuration, the scripts are not loading during SSR, and Google Analytics tracking is not working. When inspecting the browser's developer tools, I can see that the script tags are not being added.
💡 What I've Tried
app.head.scriptusingdefineNuxtConfigplugins/gtag.client.jsfile and setting up the plugin🙏 Question
What configuration is necessary to load scripts during SSR using
app.head.scriptin Nuxt 3? Also, what steps do I need to take to ensure Google Analytics tracking functions correctly?I would greatly appreciate any guidance on this matter. Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions