Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Step 1 - update your list of DPS

  • Open the Usercentrics Shopify App. Go to the 'Technologies' tab and select 'Third-Party Technologies.' Find and remove the 'All My Shopify Trackings' DPS (or any similarly broad DPS related to Shopify Tracking that you have set up).

  • Add three new predefined Data Processing Services:

    • In the "Categories" section, choose To do this, first select the category where you want your DPS to appear .In the "in the 'Categories' section. Then, in the 'Third-Party Technologies" ' section, add the following Technologiestechnologies:

      • Shopify Analytics” (Template ID: ZQOx-TM97Y3rLe)

      • Shopify Marketing” (Template ID: zixK7I8y1mhf1D)

      • Shopify Preferences” (Template ID: T4PQQdTkrEofhd)

      (warning) note: it should have the exact same name as listed above)

...

  • Navigate to your Shopify layout and open the theme.liquid file.

  • Locate the Shopify Consent Tracking API script within your HTML. You can refer to this old documentation to confirm you've identified the correct script.

  • Remove the old script and replace it with the new script provided below, placing it at the bottom of your <head> section.

Code Block
<script type="text/javascript">
      window.Shopify.loadFeatures(
        [{ name: 'consent-tracking-api', version: '0.1' }], 
        error => {
          if (error) throw error
          console.log('** Shopify Consent Tracking API loaded')
          const syncTrackingConsent = consentObj => {
            window.Shopify.customerPrivacy.setTrackingConsent(consentObj, () => {
              console.log("** UC consent synced with Shopify Customer Privacy API")
              console.log("- Shopify consent:")
              console.log(window.Shopify.customerPrivacy.currentVisitorConsent())
              console.log("--------------------------")
            })
          }
          window.addEventListener("ucEvents", function (e) {
            if (e.detail && e.detail.event == "consent_status") {
              analyticsConsent = e.detail['Shopify Analytics']
              marketingConsent = e.detail['Shopify Marketing']
              preferencesConsent = e.detail['Shopify Preferences']
              console.log('** Usercentrics consent:')
              console.log("- action: " + e.detail.action)
              console.log("- type: " + e.detail.type)
              console.log("- Analytics: " + analyticsConsent)
              console.log("- Marketing: " + marketingConsent)
              console.log("- Preferences: " + preferencesConsent)
              let consentObj = {}
              switch (e.detail.action) {
                case 'onDenyAllServices':
                  consentObj = {
                    analytics: false,
                    marketing: false,
                    preferences: false,
                    sale_of_data: false
                  }
                  break;
                case 'onAcceptAllServices':
                case 'onNonEURegion':
                  consentObj = {
                    analytics: true,
                    marketing: true,
                    preferences: true,
                    sale_of_data: true
                  }
                  break;
                default:
                  consentObj = {
                    analytics: analyticsConsent,
                    marketing: marketingConsent,
                    preferences: preferencesConsent
                  }
              }
              syncTrackingConsent(consentObj)
            }
          })
        }
      )
    </script>

...