Skip to content
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

Feat: Added Shopify Analytics #1318

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

oybek-daniyarov
Copy link

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

  • Product page view
  • All Collection page view
  • Single collection page view
  • Product page view
  • Product page view with variants

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

  • Install ngrok: First, visit ngrok's website to download and install ngrok. This tool will create a secure tunnel to
    your localhost, making it accessible over the internet.
  • Set Up a Custom Domain with ngrok: After installation, set up a custom domain through ngrok. This step is crucial as
    it ensures URL consistency, which helps maintain the cookies required for Shopify analytics.
  • Expose Your Local Development Server: Suppose your local development server runs on port 3000. You can then
    expose it to the internet with the following ngrok command:
ngrok http --domain=YOUR_NGROK_DOMAIN 3000

Screenshot from Shopify dashboard

image image
a4a16dba-bc68-44c3-852e-e8445b4bba7c.mp4

Copy link

vercel bot commented Apr 1, 2024

@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.

@oybek-daniyarov oybek-daniyarov marked this pull request as ready for review April 1, 2024 16:14
@oybek-daniyarov oybek-daniyarov marked this pull request as draft April 1, 2024 18:26
@oybek-daniyarov oybek-daniyarov marked this pull request as ready for review April 3, 2024 20:07
@lucaslosi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants