Skip to content
SpinLoop

How to add a spin-to-win popup to Shopify

Paste one line into theme.liquid, just above the closing body tag.

Written by the SpinLoop team. Last reviewed .

Before you start

  • Your game is saved in SpinLoop. You can paste the snippet before the game is live: nothing shows to visitors until you turn it on.
  • You can edit your theme code in Shopify. Staff accounts need the "Themes" permission.

1. Copy your snippet

In SpinLoop, open your game and go to the Install tab. Copy the snippet. It looks like this, with your own game id:

<script src="https://app.getspinloop.com/embed.js" data-campaign="c_0123456789abcdef" async></script>
Example only. Copy your own snippet: the game id is different for every game.

2. Paste it into theme.liquid

  1. In Shopify admin, go to Online Store, then Themes.
  2. Next to your current theme, open the ... menu and choose Edit code.
  3. In the Layout folder, open theme.liquid.
  4. Find the closing </body> tag near the end of the file. Use Ctrl+F (or Cmd+F on a Mac) and search for </body>.
  5. Paste the snippet on the line just above </body>.
  6. Click Save.

Pasting it in theme.liquid puts it on every storefront page. The triggers you set in SpinLoop decide which pages actually show the game.

3. Allow your store's addresses

The game only loads on sites you list. In the Install tab, under Where it can run, add every address your store uses, one per line:

https://yourstore.myshopify.com
https://yourstore.com

www and the bare domain count as the same site, so you only need one of them.

4. Check it works

  1. Click Test install in the Install tab.
  2. Open your store in another tab and browse a page or two.
  3. The Install tab shows "Installed" once we see the snippet running on one of your addresses.

If you set a delay or a scroll trigger, wait for it, or open the page with a fresh private window so the frequency cap does not hide the game.

If it does not show

  • Still waiting after a few minutes? Check the snippet is above </body> in the theme that is published, not in a draft copy.
  • Wrong address? Your store may redirect to a domain you did not list. Copy the address from your browser bar into Where it can run.
  • Seen it already? The frequency cap hides the game for a while after someone has seen it. Try a private window.
  • Game paused or not live? The snippet does nothing until the game is live in SpinLoop.

Questions

Will the game show on the Shopify checkout?

No. Shopify's checkout does not load your theme's layout file, so the game only appears on your storefront pages.

What happens if I switch themes?

The snippet lives in the theme you edited. Paste it into the new theme's theme.liquid file too before you publish it.

Is there a Shopify app instead?

Not yet. A theme app embed is planned for a later version. For now the snippet is the way to install.