Shopify
On Shopify, you install ClickPatrol through Google Tag Manager. You use the same official ClickPatrol tag as on any other website. There is no ClickPatrol app in the Shopify App Store. The tag classifies ad visits on your storefront pages. Checkout works differently on Shopify, so what you can do with purchases is limited. Both are covered below.
What works on Shopify#
- Protection for your ad campaigns. Google Ads protection runs through the tracking template and your connected ad account. It does not run through your store. It works the same as for any other site.
- Classification on storefront pages. Your GTM container loads on home, collection, product, cart, blog and other theme pages, so ClickPatrol classifies ad visits there.
- ClickPatrol events in GTM. On those pages, you can use
ClickPatrol_LegitimateandClickPatrol_Suspiciousfor audiences and pixel triggers, like on any site. - Lead conversions on the storefront. A contact or newsletter form on a theme page can push
ClickPatrol_Conversion, as described in Conversion tracking.
Step 1: Add Google Tag Manager to your theme#
Skip this step when your GTM container already loads on your storefront.
- In the Shopify admin, go to Online Store, then Themes.
- Next to your live theme, open the menu and choose Edit code.
- Open
layout/theme.liquid. - Inside
<head>, paste the first GTM snippet as high as possible. - Right after the opening
<body>tag, paste the second GTM snippet, the<noscript>part. - Save.
The snippet belongs to that theme. If you switch to another theme, add it again.
Step 2: Add the ClickPatrol tag#
Install the official ClickPatrol tag in your container and have it fire on All Pages. The Google Tag Manager article walks you through the template, Your Unique ID and the triggers.
Stick to one install path only. If an older ClickPatrol script or app embed is still active in your theme, remove it, so visits are not classified twice.
Step 3: Connect your ad accounts#
In the Integration Hub of the ClickPatrol dashboard, connect Google Ads, Meta and your other channels. Nothing in Shopify replaces that step.
Step 4: Test on the storefront#
- Click Preview in GTM.
- Open a storefront page with
?source=fadded to the URL. This forces a test classification. - In Tag Assistant, confirm that the ClickPatrol tag fired and that a
ClickPatrol_LegitimateorClickPatrol_Suspiciousevent follows. - Publish the container.
Consent#
A GTM container in theme.liquid loads the same way as on any other website. Make sure your tags, including the ClickPatrol tag, follow the consent banner you use, for example through Google Consent Mode or the GTM integration of your consent app.
Checkout and thank-you pages#
Shopify checkout and the thank-you page do not load your theme. Because of that, your GTM container in theme.liquid and the ClickPatrol tag in it do not run there. That has four consequences.
- No purchase conversions to ClickPatrol from checkout. A purchase is completed in checkout, and the ClickPatrol tag is not present there. With this setup, purchases do not reach the ClickPatrol Conversion page. Lead conversions from storefront forms do.
- No ClickPatrol events in checkout. On checkout steps or the thank-you page, a tag that waits for
ClickPatrol_Legitimatedoes not fire. Protection is not affected, because the visit was already classified on the storefront. - Purchase events from Shopify apps are not gated. Purchase events sent by Shopify sales channel apps, such as the Google and Meta apps, run outside your theme container. Purchase events sent by custom pixels under Settings, Customer events do the same. A ClickPatrol trigger in GTM cannot hold them back.
- Custom pixels cannot see the storefront
dataLayer. Shopify runs custom pixels in a sandbox. They do not receive the ClickPatrol events pushed on theme pages.
Do you need purchase conversions from Shopify checkout in ClickPatrol? Contact support before you build a workaround, so we can check your setup with you.
Headless stores#
If your storefront is headless, such as Hydrogen, add GTM to your own front-end the same way you would on any website. When checkout runs on Shopify, the checkout limits above still apply.
Optional extras#
The ClickPatrol tag can also restore the Google Ads click ID in Safari. It can also extend the lifetime of advertising cookies. Both are off by default. See Restore the Google Ads click ID in Safari and Extend advertising cookie lifetime.
Was this article helpful?
Let us know so we can improve our documentation
Need Help?
If something isn't working or you have questions, our support team is here to help you.
Contact Support