Installing Algonomy Clickstream JS SDK in Shopify

The Algonomy Clickstream JavaScript SDK enables real-time tracking of customer interactions on your Shopify storefront. It acts as the core tracking layer responsible for capturing events, enriching payloads, managing sessions, and sending data to rCDP.

Installing the SDK is a mandatory prerequisite for enabling Shopify Clickstream Event Instrumentation, including No-Code and Pixel-based tracking.

Note: The SDK must be loaded on all storefront pages to ensure complete and consistent event tracking.

Why Install the JS SDK

  • Captures clickstream events across the storefront

  • Enriches events with session, device, and page metadata

  • Ensures standardized payload structure

  • Handles communication with rCDP APIs

Tip: Install the SDK once at the theme level to automatically enable tracking across all pages.

Steps to Install JS SDK

  1. Log in to your Shopify Admin panel

  2. Navigate to Online StoreThemes

  3. Select your active theme and click Edit Code

  4. Open the file layout/theme.liquid

  5. Add the SDK script before the closing </body> tag

  6. Save the changes

Add SDK Script

<script src="https://cdn.algonomy.com/rcdp-js-sdk.min.js"></script>
			

Example Placement

{{ content_for_layout }}

<script src="https://cdn.algonomy.com/rcdp-js-sdk.min.js"></script>

</body>
</html>
			

Important: Ensure the SDK is placed inside the global layout file so it loads on every page.

What Happens After Installation

  • The SDK initializes automatically when the page loads

  • User sessions are tracked across pages

  • Event payloads are constructed and enriched

  • Data is sent to rCDP endpoints in real time

How It Works

  1. The SDK loads when the storefront page is rendered

  2. It initializes session tracking and user context

  3. Subsequent instrumentation layers (No-Code or Pixel) trigger events

  4. The SDK enriches and sends events to rCDP

The SDK works as the foundation layer. All Shopify tracking methods depend on it.

Verify SDK Installation

  1. Open your Shopify storefront in a browser

  2. Open Developer Tools (F12)

  3. Go to the Network tab

  4. Check for requests to Algonomy endpoints

  5. Ensure no JavaScript errors are present

Note: If the SDK is installed correctly, you should see network calls triggered during page interactions.

Troubleshooting

  • Ensure the script is added before the closing </body> tag

  • Check for script blocking by browser extensions

  • Verify CDN accessibility

  • Confirm no syntax errors in theme.liquid

Always test in an incognito window to avoid caching or extension interference.

Next Steps

  • Proceed to Shopify No-Code Instrumentation

  • Or implement Shopify Pixel Instrumentation