-
Notifications
You must be signed in to change notification settings - Fork 295
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
Third-party analytics in Hydrogen not firing on page navigation #2223
Comments
I can't reproduce the issue you are showing me. I ran Did you run |
Ahh I don't think I ran |
Hello @wizardlyhel thanks for your patience. So I ran
I've manually added the checkout domain, which I believe is the same as the But still getting the same issue :/ |
Follow this doc to setup consent in Shopify admin - https://shopify.dev/docs/storefronts/headless/hydrogen/analytics/consent
Are you linked to a Shopify storefront? You can run |
Ahh okay managed to get this working, it was user error 😅 So I had the <Analytics.Provider
cart={data.cart}
shop={data.shop}
consent={data.consent}
canTrack={() => {
return true;
)}
> Where it needs to be <Analytics.Provider
cart={data.cart}
shop={data.shop}
consent={data.consent}
canTrack={() => {
try {
return true;
} catch (e) {}
return false
)}
> I missed the comment in the docs that says this needs to only run on the client |
What is the location of your example repository?
https://github.com/stevenbister/hydrogen-gtm-example
Which package or tool is having this issue?
Hydrogen
What version of that package or tool are you using?
2024.4.3
What version of Remix are you using?
2.9.2
Steps to Reproduce
When the repo above is running, open the console
Navigate to any product page
Expected Behavior
I would expect to see the subscription data to be logged to the console and the event pushed to the datalayer
Actual Behavior
Nothing happens unless I forcibly refresh the page
Screen.Recording.2024-06-07.at.16.22.48.mov
Not sure if I'm missing something but seems like this should fire whenever the page location changes?
The text was updated successfully, but these errors were encountered: