Sdk
Shopify App
Reward repeat visits and actions in your Shopify storefront.
There is no packaged Shopify app yet, but you can integrate Streakfox today using theme edits and webhooks.
1) Add the widget script
Include the widget script in theme.liquid (or a theme app embed if you have one):
<script
src="https://cdn.streakfox.com/widget.js"
data-project="YOUR_PROJECT_ID"
data-event="visit"
data-position="bottom-right"
async
></script>2) Trigger storefront events
Call window.streak() after key actions like add-to-cart or checkout initiation:
<script>
document.addEventListener('click', (event) => {
if ((event.target as HTMLElement).closest('[data-streak-add-to-cart]')) {
window.streak?.('add_to_cart');
}
});
</script>3) Track purchases server-side
Use Shopify webhooks to send purchase events from your backend to /v1/e so orders are recorded even if the customer blocks scripts.
Recommended patterns
- Keep project IDs in theme settings or environment variables.
- Use distinct
eventvalues for key funnel steps (add_to_cart, checkout, purchase). - Alias logged-in customers with a short-lived alias token if you need cross-device continuity.