Methods
Introduction
There are five different ways of displaying ads on your site. There are examples of them on the main page, but here we go a bit more in depth on each to make sure they're used correctly. In all the examples below we use the prefixes to be clear about what's what, but almost all of them can be omitted in practice — including the type itself (so /t:link/ and /t:image/ usually aren't required; see Type for when they are).
Image and link
Image with link may not be the best option for every use case, but it has the benefit of being plain HTML written by you, so you have full control over both tags if you need to add styles or change dimensions. Both the script and iframe options deliver image and link together, so you only need to think about one URL — with this option you manage both yourself.
You have to add /v:number/ versioning so the link tag knows which image it's connected to.
It's important to explicitly set t: on both tags — /t:link/ on the link, /t:image/ on the image — and to otherwise keep the two URLs identical, since that's the only way we can tell they belong together. You may also need to add the attribute referrerpolicy="no-referrer-when-downgrade" to both tags so we can track the origin page properly. The type has to be explicit here because automatic detection can be unreliable once a request goes through a proxy or ad blocker. Script is the only format where the type can be safely left out, since it's the default.
<a href="https://betweenaffiliates.com/c:fiverr/t:link/w:600/h:200/v:12">
<img
width="600"
height="200"
src="https://betweenaffiliates.com/c:fiverr/t:image/w:600/h:200/v:12"
/>
</a>
Iframe
Iframe has an edge over the image-based options: the space it occupies stays a fixed size regardless of what's loaded inside it, since the width/height attributes are set on the iframe itself rather than on the ad. It loads the ad as HTML served from betweenaffiliates.com. To avoid quirks (extra scrollbars, a stray border) you'll want frameBorder="0" and scrolling="no" on the tag, which are easy to forget.
<iframe
width="600"
height="200"
frameborder="0"
scrolling="no"
src="https://betweenaffiliates.com/fiverr:pro/t:iframe/w:600/h:200/v:2"
></iframe>
Script
Most ad networks use a script tag, and it may well be the best option here too. It's simple — a tag with nothing more than a source URL, and the ad appears. You don't need /t:script/ since it's the default. The script can be deferred to load after the rest of the page, at the cost of a layout shift once the ad appears. It's a thin wrapper: it takes the URL you provide and writes out the image and link it resolves to. As with the other formats, you may need referrerpolicy="no-referrer-when-downgrade" on the tag for tracking to work properly. Loading via script also leaves room for extra signals we could use for matching later, like browser language or light/dark mode preference — not implemented yet, but on the list.
<script src="https://betweenaffiliates.com/c:fiverr/t:script/w:600/h:200/v:3"></script>
Link
Link is different from the rest in that there's no image involved — just a plain <a> tag pointing straight at the affiliate offer, which redirects on click. You provide the link text yourself. If a link is fetched via script or iframe instead, we fill in the affiliate and product name as default text. A planned future improvement is using the script version of a link to automatically copy a discount code to the user's clipboard on click.
<a href="https://betweenaffiliates.com/fiverr:pro/u:between-movies/t:link">
Affiliate link to fiverr pro
</a>
Html
When you want the HTML directly, whether server-side or in JavaScript, use t:html and it'll build the correct t:link and t:image pair for you in one response.
echo file_get_contents("https://betweenaffiliates.com/fiverr:pro/t:html/600/200");