Integration‎ > ‎

Displaying Offers

TapjoyOffers  is a way to display a multitude of offers to your users. This is an all-in-one solution that provides your users with payment options in addition to offers to complete.


I. Displaying offers with our Encrypted Parameters IFrame (Recommended)

1) Unzip and upload the Tapjoy PHP Class files onto your server. You will need to modify one of the files and enter details about your application.

2)  Edit config.tapjoy.php with the application ID and application secret key (both can be found in the Onboarding tool)


<?php

    
  
define( 'APP_ID', '8d14cd6d8a84acd86146dcXXXXXXXXX
' );                         
       define( 'APP_SHARED_SECRET', '1908772561XXXXX' );

?>

    

3)  Please review to the sample demo.php file provided in the Tapjoy PHP Class files.  Here, you will construct an array object containing the SNUID, along with other optional parameters such as the affiliate ID, currency name (This parameter is also set via our Onboarding Tool, but setting this parameter will override that value set in the Onboarding Tool), and dynamic exchange rate.

3a) Please also set the 'uidSource' value accordingly according to the Social Network:

   1 = Facebook Third Party ID
   2 = Myspace Third Party ID
   0 = All Else

4) Once you have set all the data, you can render the iframe code by calling: $tapjoy->renderOffersURL()


<?php


require_once 'class.tapjoy.php';

$tapjoy = new TapJoy();

$user_id = '';  // Set SNUID here

// Set user data
$request_data = array (
    'snuid'       =>    $user_id,  // Required
    'affl'        =>    $affl,  // Optional
    'vcurr'       =>    $currency_name,  // Optional
    'exchRate'    =>    $exchange_rate,  // Optional
    'uidSource'   =>    1,  // Enter 1 if the snuid is a Facebook third-Party ID
                            // Enter 2 if the snuid is a MySpace third-Party ID
                            // Otherwise, enter 0
    'issue_ts'    =>    time()
);


$tapjoy->renderOffersURL($request_data, 700, 2400);


?>


5) Please review demo.php and class.tapjoy.com files for other optional integration points and detailed comments.


III. Displaying offers in a Facebook FBML modal

- To load the Tajjoy Offers IFrame in a Facebook modal (overlay), please see  the sample FBML code below.

<?php

require_once 'class.tapjoy.php';

$tapjoy = new TapJoy();

$user_id = '';  // Set SNUID here

// Set user data
$request_data = array (
    'snuid'       =>    $user_id,  // Required
    'affl'        =>    $affl,  // Optional
    'vcurr'       =>    $currency_name,  // Optional
    'exchRate'    =>    $exchange_rate,  // Optional
    'uidSource'   =>    1,  // Enter 1 if the snuid is a Facebook third-Party ID
                            // Enter 2 if the snuid is a MySpace third-Party ID
                            // Otherwise, enter 0
    'issue_ts'    =>    time()
);

$tapjoyOffersURL = $tapjoy->getOffersURL($request_data);

?>

<fb:dialog id="tapjoyFrame" cancel_button="1" width="720">
    <fb:dialog-title>Earn Points</fb:dialog-title>  
    <fb:dialog-content>
        <fb:iframe src="<?php echo $tapjoyOffersURL; ?>" height="550" width="710" scrolling="yes" frameborder="0"</fb:iframe>
    </fb:dialog-content>
</fb:dialog>

<div>
    <a href="#" clicktoshowdialog="
tapjoyFrame" style="font-weight:bold;font-size:14px;">Earn Points</a>
<div>



III. Displaying offers in an IFrame

To request an offer page in an IFrame, please use the format below:

http://pub.myofferpal.com/[APPLICATION_ID]/showoffers.action?snuid=[user id]

The parameters for TapjoyOffers are explained in the table below:

Key 

Description

Required/ Optional

APPLICATION_ID

Unique identifier provided in the Tapjoy URL.

What is my application id?

Required

SNUID

Social Network User ID

What is a SNUID?

Required

Example TapjoyOffers request:

            http://pub.myofferpal.com/[APPLICATION_ID]/showoffers.action?snuid=[SNUID]


Attachments (1)

  • tapjoy-php-class.zip - on Dec 4, 2010 2:31 PM by Offerpal Admin (version 1)
    3k View Download

Sign in  |  Recent Site Activity  |  Terms  |  Report Abuse  |  Print page  |  Powered by Google Sites