Welcome to the ApucashMedia Publisher Integration Guide. This documentation will walk you through the complete process of setting up your account, integrating our offerwall into your website, and configuring postback notifications to track conversions in real-time.
Account Setup
Creating Your First Placement
A placement represents where your offerwall will appear on your website. Follow these steps to create your first placement:
-
1
Navigate to Placements:
Log into your dashboard and locate the Placements section in the sidebar navigation.
-
2
Add New Placement:
Click the "Add Placement" button to begin creating a new placement.
-
3
Configure Settings:
Fill in the required information including your website URL, placement name, and virtual currency settings.
-
4
Submit for Review:
Once submitted, our team will review your placement within 24-48 hours.
Your placement will need to be approved before you can begin integration. You'll receive an email notification once your placement is approved.
Iframe Integration
Embedding the Offerwall
Once your placement is approved, you can integrate our offerwall into your website using a simple iframe. This method ensures seamless integration without requiring complex backend setup.
Integration Code
<iframe
src="https://ApucashMedia.com/offerwall2.php?api_key=YOUR_PLACEMENT_API_KEY&user_id=USER_UNIQUE_ID"
width="100%"
height="800"
frameborder="0"
style="border: none; border-radius: 8px;">
</iframe>
Required Parameters
| Parameter | Description |
|---|---|
| api_key | Your unique placement api key found in the placements list on your dashboard. |
| user_id | Your user's unique identifier from your system. This is crucial for tracking conversions and crediting the correct user. |
Always replace USER_UNIQUE_ID with your actual user's ID dynamically. Never use a static value, as this will prevent proper conversion tracking.
Implementation Example (PHP)
<?php
// Get the logged-in user's ID from your session/database
$userId = $_SESSION['user_id'];
$placementId = 'YOUR_PLACEMENT_ID';
$offerwallUrl = "https://ApucashMedia.com/offerwall2.php?placement_id={$placementId}&user_id={$userId}";
?>
<iframe
src="<?php echo htmlspecialchars($offerwallUrl); ?>"
width="100%"
height="800"
frameborder="0"
style="border: none; border-radius: 8px;">
</iframe>
Postback Configuration
Real-Time Conversion Tracking
Postback URLs allow you to receive real-time notifications when users complete offers. Configure your postback URL in your placement settings to automatically credit users when conversions occur.
Setting Up Your Postback URL
Navigate to your placement settings and enter your postback URL using the macros below. Our system will replace these macros with actual values when sending notifications.
https://yourwebsite.com/api/credit-user.php?user_id={subid1}&amount={currency_amount}&offer={offer_name}&status={status}&security_hash=YOUR_SECRET
Available Macros
Use these macros in your postback URL to receive conversion data. All macros are case-insensitive.
| Macro | Description |
|---|---|
| {subid1} | The user ID you passed in the iframe URL. Use this to identify which user completed the offer. |
| {click_id} | User click for every conversion. |
| {payout} | Publisher payout amount in USD (e.g., 0.75). This is how much you'll earn from this conversion. |
| {currency_amount} | Virtual currency amount to credit the user (e.g., 750 coins). Based on your conversion rate. |
| {currency_name} | Your virtual currency name as configured in placement settings (e.g., Coins, Gems, Points). |
| {offer_name} | The name of the completed offer for logging and display purposes. |
| {ip_address} | The user's IP address for fraud prevention and verification. |
| {status} | Conversion status: approved, pending, or rejected. |
Always implement server-side validation and use a secret security hash to verify postback authenticity. Never trust postback data without verification.
Example Postback Handler (PHP)
<?php
// credit-user.php - Example postback handler
$secret = "your secret key";
// 1. Get parameters
$userId = $_GET['user_id'];
$amount = $_GET['amount'];
$offerName = $_GET['offer'];
$status = $_GET['status'];
$securityHash = $_GET['security_hash'];
$hash = md5($userId.$amount.$offerName.$secret);
// 2. Verify security hash (implement your own verification)
if ($hash !== $securityHash) {
http_response_code(403);
exit('Invalid security hash');
}
// 3. Process only approved conversions
if ($status === 'approved') {
// Credit user in your database
$stmt = $pdo->prepare("UPDATE users SET balance = balance + ? WHERE id = ?");
$stmt->execute([$amount, $userId]);
// Log the conversion
$logStmt = $pdo->prepare("INSERT INTO conversion_log (user_id, amount, offer_name, timestamp) VALUES (?, ?, ?, NOW())");
$logStmt->execute([$userId, $amount, $offerName]);
echo "OK"; // Always return "OK" for successful processing
} else {
echo "PENDING"; // Or handle pending/rejected status
}
?>
Need Help?
Our support team is here to assist you with integration, troubleshooting, and optimization. We typically respond within 24 hours.