Closed abwhb closed 1 year ago
Hey @frehner - Can you give me an update on this issue?
Thank you for reporting this - There are still many parts of analytics dashboards that we are still working towards fixing for Hydrogen and Headless app.
From the looks of it, you have everything setup properly, we'll investigate into this.
Actually, @blittle notice that the cookies isn't setup properly. Please make sure the domain is set with
useShopifyCookies({
hasUserConsent: true,
domain: 'luxhomedecor.com',
})
@wizardlyhel @blittle Thanks! I'll add domain to useShopifyCookies
and see if that fixes the conversion summary
@wizardlyhel @wizardlyhel updating useShopifyCookies
fixed the issue. Thanks!
@wizardlyhel I am having the same issues with the conversion summary as well, the only difference is that I'm using a headless Next.js storefront with Hydrogen sales channel tokens. I have set up useShopifyCookies
with the domain
parameter just like you mentioned before. Do you have any input on why is it not working for me or if I can provide any additional information?
@Chadyka
_shopify_y
and _shopify_s
when navigating to checkout? and with cookie domain set to the top level domain? (ie. myshop.com
)https://monorail-edge.shopifysvc.com/unstable/produce_batch
on every page navigation in your nextjs app? You can use sendShopifyAnalytics
for sending analytics to Shopify@wizardlyhel
[storename].myshopify.com
https://monorail-edge.shopifysvc.com/unstable/produce_batch
is present in network requests with sendShopifyAnalytics
on every page, once for every analytics action_shopify_y
cookie seems to be consistent on the two domains mentioned above. However on checkout page [storename].myshopify.com
has 2 _shopify_y
cookies, one is the same as on the Next store, the other is a new one and doesn't match any other shopify cookie. There is also a _shopify_y
cookie from the checkout.myshopify.com
domain that matches the original from the Next store. The _shopify_s
cookie is only present on [storename].myshopify.com
and the Next store. It's a complicated explanation so I'll attach some images to make it clearer.[storename].myshopify.com
checkout.myshopify.com
[storename].myshopify.com
checkout.myshopify.com
were not available (maybe due to incognito mode not allowing third party cookies?)@Chadyka You can't assign checkout.showme.hu
domain to your online store?
@wizardlyhel sorry, I must have misunderstood your reply. I'll check back once I tested this.
@wizardlyhel after changing the online store domain to checkout.showme.hu
the cookies are matching between the Next store and checkout in an incognito session. However, in a normal session I'm getting 2 sets of cookies from showme-shop-live.myshopify.com
and showme.hu
on the Next storefront.
After that, the checkout page checkout.showme.hu
now contains correct cookies for the top level domain.
Even after this, the first visited page in conversion summary is /checkout/cn/[cart-token]
2 sets of the same cookie is fine. The other set is under 'showme-shop-live.myshopify.com' which get set by the online store checkout and won't be accessible by JS anyways.
Give it at least 24hrs to 48hrs to for session data correct over time and make sure you are picking a session that started after you have made the domain change to see if it started working for you.
Hey @wizardlyhel, I wanted to get back to you about this issue. I have been doing analytics event testing on my store and I was also checking if the conversion summary would pick up. The things we discussed earlier are working as expected, however, the conversion summary still only shows checkout as the first page a user landed on. Do you have any further ideas on how I could track down the source of this issue?
I don't see the cookie values being send along with the sendShopifyAnalytics
. Filter the network tab for product_batch
request. You should see relatively the same payload as the screenshot that I have attached.
I think somehow the cookie isn't set before the Shopify analytics event is sent. That is why the conversion summary still thinks the first landing page is checkout
Hey @wizardlyhel, I believe to have solved the issue as I have been unable to reproduce your example with the missing tokens since a couple days. However, conversion summary is still showing the checkout as the first viewed page. Can you check if you can reproduce your example from before?
@Chadyka I think yours might be a slightly different issue. Your shop have many channels coming in which builds your order reports. Ones that might look odd are ones that comes directly to checkout from Linkpop, Instagram, Facebook ... etc. These won't have a first landing page at the url you expect, these will have checkout url as their first landing page because there is no connection in session cookie.
@wizardlyhel Would it make sense to use the LocalStorage
of the client to store the tokens and use them instead of just getClientBrowserParameters()
to collect the cookies/tokens? Should I set some other variables that getClientBrowserParameters
collects to handle analytics better?
@Chadyka At least for that particular report you are indicating, it won't be possible to make the session association because they are from a completely different domains. Cookies are inaccessible across domains for security reasons. These orders are coming from other sales channels that is not Hydrogen. So it would be more accurately look at them from the sales by referrer report instead.
What is the location of your example repository?
No response
Which package or tool is having this issue?
Hydrogen
What version of that package or tool are you using?
2023.4.0
What version of Remix are you using?
1.15
Steps to Reproduce
Make a purchase on hydrogen store
Expected Behavior
Conversion summary should show summary of the session that was converted
Actual Behavior
Conversion summary shows checkout as the first page visited.