vercel / commerce

Next.js Commerce
https://demo.vercel.store
MIT License
10.54k stars 3.88k forks source link

Feat: Added Shopify Analytics #1318

Open oybek-daniyarov opened 3 months ago

oybek-daniyarov commented 3 months ago

Implementation of Shopify analytics with verce/commerce

Analytics have been enabled for the following events.

✅ Page view ✅ Add to cart (add to cart event, it will also enable tracking on checkout page and purchase event)

Todo

(I already have ready solution, but I'm afraid PR will get larger) I can do it in follow-up PR

For Shopify's ADD_TO_CART analytics to function correctly, it's important to note that they will not work with localhost links directly due to cookie handling.

To enable these analytics features during local development, we can use ngrok

ngrok http --domain=YOUR_NGROK_DOMAIN 3000

Screenshot from Shopify dashboard

image image

https://github.com/vercel/commerce/assets/100561459/2b846c2b-8b4a-4f9d-8cdf-9b300a1702ad

vercel[bot] commented 3 months ago

@oybek-daniyarov is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

lucaslosi commented 2 months ago

just implemented this on my ecommerce, and worked as intended. thanks