Chord Commerce Event Tracking
Using with Shopify
Server Event Tracking
5min
when installed on your storefront, chord typically sends tracking events to the cdp from two sources your website front end, either using the chord shopify web pixel or @chordcommerce/analytics , and chord's server events service, which sends tracking events from a shopify custom source function in your cdp workspace in response to webhook triggers from shopify when chord provisions your cdp workspace, it will include chord's shopify webhook source this code listens for webhook events from shopify and transforms them into cdp events requirements locate chord's webhook source in your cdp workspace, named "shopify webhooks " chord typically creates this webhook source as part of your cdp workspace provisioning you'll need to update the settings of this source during the create an admin api key step, and you'll need the webhook url of this source during the create webhook subscriptions step if you can't find the source or aren't sure which one it is, please contact chord installation there are two steps to configuring server events creating an admin api key and adding it to the cdp source; and subscribing the cdp source to shopify webhook events creating an admin api key chord's cdp source requires an admin api key with the read orders scope to retrieve order details from shopify to generate this admin api key, we recommend creating a custom shopify app in your shopify account for chord, and using the admin api access token from this custom app this makes it easy to manage access create a new custom app in your shopify admin by navigating to settings > apps and sales channels > develop apps > create an app once the app is created, click configure admin api scopes choose read orders only and hit save on the overview tab, you should see a prompt to install to get your access token click install app now you should see this copy the admin api access token in your cdp workspace, navigate to your chord webhook source and view the settings under settings > connection enter the admin api access token you just created in the access token or accesstoken settings field, and save changes creating webhook subscriptions in your cdp workspace, navigate to your chord webhook source and find the webhook url for the source under the configure your webhook heading now you'll create webhook subscriptions in shopify you can create webhook subscriptions either via the shopify admin or the admin api you can use the admin api access token you created for chord to create the subscription via the admin api create a subscription for each server event you'd like chord to send to the cdp each subscription will have the same address, which is the url you copied from your cdp source the following webhook topics are supported checkouts/create sends chord's "checkout created" event orders/create sends chord's "order completed" event refunds/create sends chord's "order refunded" event shopify's webhook testing doesn't include a payload that matches a real webhook payload, so we recommend completing a test transaction in your shopify store to verify that server events are flowing as expected you can view the cdp events in the debugger tab of the shopify webhook source in your cdp workspace storefront configuration to associate server events and front end storefront events with the same session, the website front end needs to save a few browser identifiers as attributes on the cart or order, so they can be retrieved later by the server source and included in cdp events see unifying data across sources docid\ fymi5g8ewb yypyh gu4o for more details