Shopify

Add the Lienks snippet to the theme of your Shopify store.

Before you start

Create your site and copy its site ID first (see Quick start).

Add the snippet

In your Shopify admin, go to Online Store → Themes, open Edit code and choose layout/theme.liquid. Add the snippet right before </head>:

<script defer src="https://app.lienks.com/a.js" data-site="YOUR_SITE_ID"></script>

Track a custom event

Call window.lienks?.event('signup_clicked') wherever something should be counted. More in Custom events.

<button onclick="window.lienks?.event('signup_clicked')">Sign up</button>

Add it to a section or template file of your theme.

Check that it works

Open your site. The first pageview shows up in the dashboard. If nothing arrives, see Troubleshooting.

Good to know

  • Make a copy of your theme as a backup before you edit it.
  • If you switch themes later, add the snippet to the new theme as well.
  • The snippet covers the pages of your Online Store. The checkout is a separate area of Shopify and isn’t covered by your theme’s code.