Before you start
- You are an administrator on the WordPress site.
- Your game is saved in SpinLoop. Nothing shows to visitors until it is live.
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>2. Add it to your site
Pick one of these two ways. The first one is easier and survives theme updates.
Option A: a header and footer plugin
- In WordPress admin, go to Plugins, then Add New.
- Search for a header and footer code plugin, such as WPCode, then install and activate it.
- Open the plugin's header and footer screen (in WPCode it is Code Snippets, then Header & Footer).
- Paste the snippet into the Footer box.
- Save.
Option B: your child theme's footer
Only do this with a child theme, or a theme update will remove the snippet.
- Go to Appearance, then Theme File Editor.
- Open footer.php in your child theme.
- Paste the snippet on the line just above
</body>. - Click Update File.
Block themes (the ones edited with the Site Editor) do not have a footer.php to edit, so use Option A.
3. Allow your site's address
In the Install tab, under Where it can run, add your site's address, for example:
https://yourshop.com
If you also use a staging site, add it on its own line.
4. Check it works
- Click Test install in the Install tab.
- Open your site in another tab and browse a page or two.
- The Install tab shows "Installed" once we see the snippet running.
If it does not show
- Caching plugin. Clear your cache after adding the snippet. If the game still does not show, exclude
embed.jsfrom any "delay JavaScript", "defer" or "combine" setting. - Security plugin. Some plugins add a Content Security Policy. See the notes in the guide for any other site.
- Seen it already? The frequency cap hides the game for a while after someone has seen it. Try a private window.