BetweenAffiliates.com

Methods

Introduction

There are as for now, four different ways of displaying ads on your site. There are examples of them on the main page, but here we will go a little bit more in depth on each of them to make sure that they are used correctly. In all the examples below we use the prefixes in order to be clear what is what. All the prefixes can be omitted in most cases, and the type part of the url as well (so, /t:link/ and /t:image/ is not required).

Image and link

Image with link may not be the best option for any use, but it has the benefit of being directly written html by you so that you have full control over the link and image tag if you need to add styles or change dimensions. Both the script and iframe option deliver image and link, but you do not need to think about more than one url.

You have to add a the /v:number/ versioning in order for the link to know what image it is connected to.

It is important that you should use the t: to define the type, that the url of the link has /t:link/ and that the url of the image has /t:image/ and that they otherwise are identical as this is the only way to link them together as one. You may also need to manually add the attribute referrerpolicy="no-referrer-when-downgrade" to both tags in order for us to track the origin properly. There reason the type is needed is because the automatic detection is lost if the user uses proxies. Script is the default, and is the only exception.

<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 the added benefit to the other options with image, that, as for now, it will stay the same size all the time regardless if that width="" and height="" attributes are provided. It loads the ad within the iframe as html provided from betweenaffiliates.com. In order for the iframe to be without quirks you need to add attributes like frameBorder="0" and scrolling="no", that may be a bit offsetting to remember.

<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 network uses a script tag, and it may well be the best option. It looks simple, a tag with nothing more than the source to it - and the ad magically appears. You do not need to use /t:script/ as it is the default. The script tag can be deferred to load after the page itself, but with the downside that you have to deal with change of flow when the ad appears. The script itself is very simple. It translates the url you send in and gives you back the image with the link configured. Here as well, in order for it to work properly, you may need to ad referrerpolicy="no-referrer-when-downgrade" to the script tag. The added benefit here is that there are a few more tracking options here that we may use, as browser language and if dark or light mode is the preferred option(but the features here are not yet implemented).

<script src="https://betweenaffiliates.com/c:fiverr/t:script/w:600/h:200/v:3"></script>

Link

Link is different from the rest in the sense that there is no image involved. You can deliver a link in a iframe and a script too. You add the link as any other, and provide the text inside. If the link is fetched via script or iframe, we put in the affiliate name and product name as default. Using a script tag to deliver a link may be used in a future improvement to copy on click your discount code to the users clipboard automatically.

<a href="https://betweenaffiliates.com/fiverr:pro/u:between-movies/t:link">
    Affiliate link to fiverr pro
</a>

Html

When wanting to get the html from the server-side, or in javascript, you can call it with the t:html and it will build the correct t:link adn t:image pair.

echo file_get_contents("https://betweenaffiliates.com/fiverr:pro/t:html/600/200");