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.
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
Steps to Install JS SDK
-
Log in to your Shopify Admin panel
-
Navigate to Online Store → Themes
-
Select your active theme and click Edit Code
-
Open the file layout/theme.liquid
-
Add the SDK script before the closing </body> tag
-
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>
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
-
The SDK loads when the storefront page is rendered
-
It initializes session tracking and user context
-
Subsequent instrumentation layers (No-Code or Pixel) trigger events
-
The SDK enriches and sends events to rCDP
Verify SDK Installation
-
Open your Shopify storefront in a browser
-
Open Developer Tools (F12)
-
Go to the Network tab
-
Check for requests to Algonomy endpoints
-
Ensure no JavaScript errors are present
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
Next Steps
-
Proceed to Shopify No-Code Instrumentation
-
Or implement Shopify Pixel Instrumentation