Checking service

WordPress, Shopify, Tag Manager and no-code tools

Add Swoop Ads to the tools you already use.

Add Swoop Ads to the tools you already use. Every integration puts the same Spot on your page, keeps your visitors' data to itself and sets no cookies.

Before you start#

  1. Open the app and add a Spot (see getting started).
  2. Copy the public Spot key. It starts with pk_ and is safe to put on a page. The secret key starts with sk_: it never goes into a plugin, a theme or a tag.

The tag starts once per page, so use one Swoop Ads unit on a page. A second unit on the same page is ignored.

WordPress#

Works with WordPress 5.8 or newer and PHP 7.4 or newer.

  1. In Plugins > Add New > Upload Plugin choose the WordPress zip and press Install Now, then Activate.
  2. Open Settings > Swoop Ads, paste your Spot key and press Save Changes.
  3. Pick a layout: Inline blends into the page, Banner is a short strip, Button opens a popup.
  4. Place it: add the Swoop Ads block in the editor, type a shortcode, or choose Add automatically before or after the content of the page types you pick.
Shortcode
text
[swoop_ads]
[swoop_ads unit="banner"]
[swoop_ads unit="button" label="Earn rewards"]
[swoop_ads placement="pk_YOUR_SPOT_KEY" height="480"]
Theme file
php
<?php echo do_shortcode( '[swoop_ads unit="banner"]' ); ?>
  • Administrators do not see ads by default, so your own visits stay out of your numbers. Untick the option to test as yourself.
  • Each page and post has a No automatic ad on this page switch.
  • Shop checkout, cart and account pages never show ads.
  • Deleting the plugin removes its settings and page switches. Nothing else is stored.

Shopify#

The Shopify package is a theme app extension: a block you add in the theme editor and an optional floating button. It needs no permissions on your store and stores nothing. Because it is part of an app, it goes live through a Shopify app that carries it.

  1. Install the Shopify CLI and create an app:
    shell
    shopify app init
  2. Unzip the Shopify package and copy the extensions/swoop-ads folder into the extensions folder of your app.
  3. Deploy it, then install the app on your store:
    shell
    shopify app deploy
  4. In Online Store > Themes > Customize open a page, press Add block (or Add section) and pick Swoop Ads under Apps. Paste your Spot key.
  5. Optional: under App embeds switch on Swoop Ads popup for a floating button on every page.

The block shows nothing on the cart page and nothing while the key is empty or is not a public key. In the theme editor it shows a reminder so you can see where it will sit. Do not use the block and the popup embed together: only the first one starts.

Google Tag Manager#

Use this when you can edit your tags but not the code of your site.

  1. In Tag Manager open Templates > Tag Templates > New, open the menu (three dots) and choose Import. Pick swoop-ads.tpl from the Tag Manager package and save.
  2. Create a tag of type Swoop Ads, paste your Spot key, pick Inline and type the selector of the element that should hold it (for example #earn-here).
  3. Fire it on Window Loaded for the pages you want. Preview, then publish.
html (Custom HTML tag)
<div id="earn-here"></div>
<script src="https://offers.kre8.fun/widget/offerwall.js" data-placement="pk_YOUR_SPOT_KEY" data-target="#earn-here" async></script>

Zapier, Make and other no-code tools#

Swoop Ads can tell your tools when a person earns a reward: set a reward callback URL on your Spot. The call is signed, and no-code triggers do not check a signature, so we ship a small relay that checks it and passes on only real, first-time events. The recipes (relay, direct hook, in-tool check) are in the Tag Manager and recipes package.

Check reward notifications in your own code#

The verifier packages check the signature, reject calls older than five minutes and ignore repeats. They have no dependencies and share test vectors, so all three agree byte for byte.

Node
js
import { receive, MemoryDedupe } from './swoop-postback.mjs'

const dedupe = new MemoryDedupe() // use your database or Redis in production

// raw = the request body exactly as received
const r = receive({ secret: process.env.SPOT_SECRET, headers: req.headers, rawBody: raw, dedupe })
if (r.status === 'rejected') return res.status(401).end()
if (r.status === 'ok') grantReward(r.payload) // 'duplicate' is a retry: answer 200 and do nothing
res.status(200).end()
Python
python
import os
import swoop_postback as sp

dedupe = sp.MemoryDedupe()  # use your database or Redis in production

r = sp.receive(os.environ["SPOT_SECRET"], request.headers, request.get_data(), dedupe)
if r["status"] == "rejected":
    return "", 401
if r["status"] == "ok":
    grant_reward(r["payload"])
return "", 200
PHP
php
<?php
require 'SwoopPostback.php';

$raw = file_get_contents('php://input');
$dedupe = new Swoop\FileDedupe(sys_get_temp_dir() . '/swoop-events.txt');
$r = Swoop\Postback::receive(getenv('SPOT_SECRET'), getallheaders(), $raw, $dedupe);
if ($r['status'] === 'rejected') { http_response_code(401); exit; }
if ($r['status'] === 'ok') { grant_reward($r['payload']); }
http_response_code(200);

Downloads#

Each file is built from the same source every time. Check the fingerprint (SHA-256) after you download: on a Mac or Linux run shasum -a 256 file.zip, on Windows certutil -hashfile file.zip SHA256.

PackageFileSHA-256
Tag Manager template and recipesswoop-ads-gtm-and-recipes-0.1.0.zipda9c255e4f5b…7cf6cae6
Shopify theme extensionswoop-ads-shopify-extension-0.2.0.zipf587a242b27c…9ff09505
WordPress pluginswoop-ads-wordpress-0.2.0.zip960ac2a68e41…b6bfffaa
Notification verifiers (JS, Python, PHP)swoop-postback-verifiers-0.1.0.zipcdb27b3cdb77…df7e83ef

One list with every fingerprint: SHA256SUMS.

Troubleshooting#

What you seeWhat to check
Nothing shows on the pageThe Spot key must start with pk_ and match a Spot whose site list includes this site. Look at the page source for the script line. In WordPress, administrators are skipped by default; test signed out or untick the option.
It shows once, not twiceOnly one unit per page starts. Remove the extra shortcode, block or automatic placement.
The frame is blank or very smallA cache or security plugin may block the script from the Swoop Ads server, or a page builder removed the script line. Allow the script and the frame from the server shown in Settings.
The popup button does nothingThe popup needs the script of the page to load first. Wait a second after the page opens, then press the button again. Check that nothing else on the page already defines GullyOfferwall.
Nothing on cart or checkoutThat is on purpose: ads never show where money moves.
The key is refused in SettingsPublic keys start with pk_. Secret keys (sk_) are never accepted, so a secret pasted by mistake is not saved. Rotate the secret in the app if you shared it.
Notifications answer 401Verify against the raw body, with the Spot secret and the same timestamp, nonce and signature headers. A body that was parsed and written out again no longer matches. Server clocks should be within five minutes.
The same event arrives twiceThat is a retry: the event id in X-Gully-Event-Id is the same. Answer 200 and ignore it.

Still stuck? See the FAQ or ask in the help of the app.