Logo

documentations

Web Integration

If you wish to integrate the offer wall on your website, this page describes the steps needed to do so.

# Placing your wall

Step 1: Obtain your wall code
Web Intergration
Step 3: Adding the iframe to your site
You will take both of the pieces of information obtained in Step 1 & 2 and create an iframe using the following guideline: https://www.rovista.co/offerwall/API_KEY/USER_ID

For Example:

<iframe frameborder='0' style='width: 100%; height: 100%; min-height: 100vh;' src='http://test.local/offerwall/[API_KEY]/[USER_ID]'></iframe>

Postback Information

This page describes how a postback works.

# What is a Postback?

A postback allows you to receive notifications on your server every time your account receives a conversion. This is necessary in order for you to be able to provide your users with rewards. For example, whenever you receive a conversion, you may wish to be notified what the payout, user ID, and point value is.

Example Postback URL:

http://yoururl.com/postback/?subId={subId}&offer_name={offer_name}&offer_id={offer_id}&reward={reward}&payout={payout}

Available Macros:

You may add any of the following macros to your postback URLs. They will be replaced with the corresponding values.
Macro Replaced Value Variable Type
{subId} USER ID String or Integer
{offer_name} Name of the offer as displayed on the Rovista Media dashboard String
{offer_id} ID of the offer as displayed on the Rovista Media dashboard String
{reward} Number of points/credits the user should be rewarded with Decimal or Integer
{payout} Number of points/credits by dollar the user not required Decimal or Integer
{ip} ip address for request country code offer completed not required String
{status} Number of [1-2] (1) is Completed & (2) is Chargeback not required Decimal or Integer

PHP Postback Examples

See some sample code for capturing postbacks on your server.

# PHP PDO Example

This an example of a plain PHP script handling Postbacks with a PDO database connection .
<?php

/**
* the Postbacks Section and the Postback Information heading.
*/
define('Rovista_IP', '162.213.255.33'); // Note: as noted above change the IP to match what is in your affiliate panel.
$ip = $_SERVER['REMOTE_ADDR'];

// Connection Info
$DB_HOST = 'DB_HOST';
$DB_USER = 'DB_USER';
$DB_PASS = 'DB_PASS';
$DB_NAME = 'DB_DBNAME';
$DB_PORT = 3306;


/**
* Check the Remote Address is Rovista
* if it is not throw an Exception
*/

if($ip !== MyDuty_IP)
{
    // Process or Persist Data here inline or via a function call.
    exit("0");
}

/**
*PDO DB Connection
*/

try{
    $conn = new PDO("mysql:host={$DB_HOST}; port={$DB_PORT}; dbname={$DB_NAME}", $DB_USER, $DB_PASS);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
}catch(PDOException $err) {
    exit($err->getMessage());
}

/**
* the parameter is getting passed by the URL Parameter By $_GET Request
*/

$subId = isset($_GET['subId']) ? $_GET['subId'] : null;
$offer_name = isset($_GET['offer_name']) ? $_GET['offer_name'] : null;
$offer_id = isset($_GET['offer_id']) ? $_GET['offer_id'] : null;
$reward = isset($_GET['reward']) ? $_GET['reward'] : null;
$payout = $_GET['payout'] ?? null;

if($subId && $offer_name && $offer_id && $reward) {
    // Insert Query to Database Table
    $query = "INSERT INTO transactions VALUES(NULL, '$subId', '$offer_name', '$offer_id', '$reward', '$payout')";
    if($conn->exec($query)) {
        exit("1");
    }else {
        exit("0");
    }
}else {
    exit("0");
}