Important! Attentive’s tag is installed on your Shopify website as part of the Shopify integration setup process. We recommend following our Shopify integration guide rather than installing the tag manually, as described in this article. Also, if you use Shopify’s Checkout Extensibility feature set, the steps described below don't apply. Please leverage the latest version of our Shopify integration, which supports Checkout Extensibility.
If you're currently using Shopify, you can add the Attentive tag to your Shopify-hosted website to collect behavioral events (such as product views, cart adds, and purchases). If you prefer to manually set up the Shopify tag, you can complete the following procedures.
Prerequisite
Contact our White Glove team (whiteglove@attentivemobile.com) or your Customer Success Manager at Attentive for your organization's unique Attentive tag.
Add the Attentive tag using Shopify
- Log into your myshopify.com account.
- Click Settings in the bottom-left corner.
- Click Checkout on the Settings page.
- Scroll to the Additional scripts field and paste the Attentive tag (collected in the Prerequisite section).
For example:<script src="https://cdn.attn.tv/EXAMPLE/dtag.js"></script>
- (Optional) Add the
first_time_accessed
property to the Additional scripts field to prevent your analytics from counting customers more than once. This prevents the same purchase from being tracked multiple times if the user revisits the status page to check on the order. See Run scripts only on first visit for more information. - Click Save. This enables our tag to execute on the Thank You page and track purchase activity.
- Return to the homepage and click Online Store from the left sidebar.
- Click Actions on your theme, and then select Edit code from the drop-down.
- Click theme.liquid in the Layout section.
- Scroll to the bottom of the page, and then paste in the Attentive tag (collected in the Prerequisite section) above the closing </body> tag.
For example:<script src="https://cdn.attn.tv/EXAMPLE/dtag.js"></script>
- Click Save.
Verify implementation of the tag
- Visit the URL where you’ve implemented the tag. If the tag is implemented correctly, you'll see several network requests including
https://cdn.attn.tv/attn.js
- Navigate to your cart or checkout pages to make sure the behavior in the previous step appears on all pages of the customer journey.