Docs / Shopify

Shopify Integration

Protect your Shopify store from click fraud in under two minutes.

Option 1: Install from the Shopify App Store (recommended)

The ClickLens app installs the tag through a Theme App Extension, so you never edit theme code, and bills through Shopify. It also adds the checkout pixel that reports completed orders, which a manual theme install cannot see.

  1. Visit the ClickLens app in the Shopify App Store.
  2. Click Install and authorize the app.
  3. Select a plan. Paid plans include a 14-day free trial, or start on the free plan.
  4. The app creates your ClickLens site and configures the tracking tag.
  5. Enable the ClickLens block in your theme — go to Online Store → Themes → Customize, then toggle the ClickLens app block on.

Sessions appear in your ClickLens dashboard within a few minutes of the first visit.

Option 2: Theme App Extension

If you've installed the ClickLens Shopify app, the Theme App Extension is already available. This injects the tag without editing theme code.

  1. Go to Online Store → Themes in your Shopify admin.
  2. Click Customize on your active theme.
  3. In the theme editor, find the App embeds section (usually in the left sidebar under the theme settings icon).
  4. Toggle ClickLens Tracking Tag on.
  5. Enter your Site Key if not pre-filled (found in the ClickLens app under Settings).
  6. Click Save.

Option 3: Manual theme code installation

If you prefer not to install the app, you can add the tracking tag directly to your theme code. This works with any Shopify plan.

  1. Go to Online Store → Themes → Edit Code.
  2. Open theme.liquid from the Layout section.
  3. Paste the following snippet just before the closing </head> tag:
<script>window.clicklens=window.clicklens||function(){(window.clicklens.q=window.clicklens.q||[]).push(arguments)};</script>
<script defer src="https://app.clicklens.io/t.js"
  data-site="YOUR_SITE_KEY"
  data-cl-token="YOUR_BEACON_TOKEN"
  data-endpoint="https://app.clicklens.io/api/v1/beacon">
</script>

Paste both lines. The first is a queue that catches any clicklens('conversion', …) call made before the deferred tag has loaded; leave it out and a thank-you page that converts on load records nothing.

Replace YOUR_SITE_KEY and YOUR_BEACON_TOKEN with the values from your ClickLens dashboard (Settings → Site Settings). The installation guide documents every attribute.

Conversion tracking

Installing the ClickLens app also adds a checkout web pixel. A completed checkout is reported on its own, with the order total and currency, stitched to the visit that led to it — nothing to add for that. For a conversion outside checkout, a quote form or a newsletter sign-up, call this from its confirmation screen:

clicklens('conversion', { type: 'lead', value: 49, currency: 'USD' });

The checkout pixel needs the app. Checkout runs on Shopify's own pages, which never execute your theme code, so a store on Option 3: Manual theme code installation above sees the storefront visit but never the order. Install the app if you want completed checkouts reported as conversions.

Site key configuration

Your site key uniquely identifies your store in ClickLens. You can find it in two places:

  • ClickLens Shopify app: Open the app in your Shopify admin and go to Settings. Your site key is displayed on the page.
  • ClickLens dashboard: Log in at app.clicklens.io, go to Settings → Site Settings.

Verifying the installation

  1. Visit your store in a private browser window with extensions off, so an ad blocker cannot swallow the beacon.
  2. Right-click and select View Page Source.
  3. Search for t.js — you should see the ClickLens script tag in the <head>.
  4. In ClickLens, go to Sessions. Your visit should appear as a new session within a few minutes.

Shopify app features

Inside your Shopify admin, the app gives you:

  • Dashboard: View traffic quality metrics, human/suspect/bot breakdowns, and trends over time.
  • Sessions: Browse individual sessions with detailed scoring breakdowns.
  • Traffic Sources: See which UTM sources and mediums are sending the most bot traffic.
  • Exclusions: Manage IP and fingerprint exclusion rules to block repeat offenders (Growth plan and above).
  • Automatic tag installation: Theme App Extension installs the tag without editing theme code.

Pricing

Paid plans include a 14-day free trial, and a free plan is available. Billing is handled natively through Shopify.

Plan Price Sessions/month
Starter $49/month 10,000
Growth $149/month 50,000
Pro $399/month 200,000

FAQ

Will the tag slow down my store?

No. The tracking tag is about 13 KB gzipped, loads asynchronously with the defer attribute, and has no measurable impact on your store's page speed or Core Web Vitals.

Does it work with all Shopify themes?

Yes. The Theme App Extension works with all Online Store 2.0 themes. For older themes, use the manual installation method by editing theme.liquid.

Can I use ClickLens without the Shopify app?

Yes. You can sign up at app.clicklens.io and add the tag manually to your theme code. The app adds Shopify billing, the Theme App Extension install, and the checkout pixel that reports completed orders as conversions.

What data does ClickLens collect?

ClickLens collects browser signals (canvas fingerprint, WebGL data, automation markers, mouse/keyboard patterns) to detect bots. It does not collect personal information, form contents, or payment details. See our Tag Security page for details.