Chord Commerce Event Tracking
...
Using with Shopify
Web Pixel
Installation
1min
to install the chord web pixel on your shopify store ask the chord team for the full web pixel code (see the example below) navigate to settings > customer events in your shopify store select add custom pixel enter "chord analytics" as the name for your pixel select add pixel review the customer privacy settings, and see our guide to consent management docid\ dbkzuyyjshkx7dzhisfez to understand how these settings will impact your event tracking in the code text box, copy and paste the provided web pixel code before you publish the provided web pixel, you need to update the settings const variables at the very top of the javascript code see the configuration docid\ qmm8kz1wshyjhs9qbh0vm for a detailed explanation of each const variable after you've updated the const variables, select save once the pixel has been saved successfully, you can select connect to enable the pixel on your shopify store once you select connect , the pixel will immediately load and start tracking events, so make sure you finalize the pixel settings first // settings const chord oms id = '' const chord store id = '' const chord tenant id = '' const default locale = 'en us' const cdp domain = '' const cdp write key = '' const store domain = '' const pixel version = '0 1 0' let customerprivacystatus = init customerprivacy let currency = init data cart? cost? totalamount currencycode let locale = default locale api customerprivacy subscribe('visitorconsentcollected', (event) => { customerprivacystatus = event customerprivacy }) analytics subscribe('page viewed', page) // this code is for illustrative purposes and is not to be used as is // please ask the chord team for the full snippet async function getcategorypreferences() { return { analytics customerprivacystatus? analyticsprocessingallowed, marketing customerprivacystatus? marketingallowed, preferences customerprivacystatus? preferencesprocessingallowed, sale of data customerprivacystatus? saleofdataallowed, } } async function getoptions() { const categorypreferences = (await getcategorypreferences()) || {} return { consent { categorypreferences, }, page { path init context document location pathname, url init context document location href, }, } } async function getmeta() { if (!currency) { currency = await browser cookie get('cart currency') } return { i18n { currency, locale, }, ownership { oms id chord oms id, store id chord store id, tenant id chord tenant id, }, platform { name 'shopify', type 'web', }, store { domain store domain, }, version { major 3, minor 0, patch 0, }, } } async function page() { const options = await getoptions() const meta = await getmeta() return segment page( { options page, meta, }, options ) }