Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Track customers using Shopify’s built in analytics on headless stores

License

Notifications You must be signed in to change notification settings

NordcomInc/react-shopify-analytics

Repository files navigation

react-shopify-analytics

License npm Contributors Codacy Badge TODO Badge FIXME Badge

Shopify Analytics for headless e-commerce sites. Built for Sweet Side of Sweden with ❤️. Based on hydrogen analytics but made for any react application.

Why use react-shopify-analytics?

  • Stupidly simple (Pretty much just fetch).
  • Written in TypeScript.
  • Actively maintained.
  • Open Source with an actually free license (MIT).
  • 0/ZERO/NADA/NOLL dependencies.

Getting started

It's as simple as 1-2-3!

1. Install

npm i react-shopify-analytics

2. Import

import { ShopifyAnalyticsProvider } from 'react-shopify-analytics';

3. Use

<ShopifyAnalyticsProvider
    shopId={123456789} // Required
    sessionId="session_token" // Required
    userId="user_token" // Required
    route="/products/hello-world" // Required
/>