Skip to content

Instantly share code, notes, and snippets.

View xandrco's full-sized avatar

Alexandr C xandrco

View GitHub Profile
@xandrco
xandrco / cpalead_php_postback_example.php
Created November 22, 2023 15:09
CPAlead Postback PHP example
<?php
/*
* Revised Postback Example Script.
*
* This script demonstrates a more secure and robust way of handling a postback.
* Please ensure you modify it according to your specific requirements.
*/
// Database credentials
define("DB_HOST", "localhost");
@xandrco
xandrco / cpalead_reversals_api_response.txt
Created November 20, 2023 17:35
CPAlead Reversals API Response
{
"status": "success",
"total": 2,
"reversals": [
{
"id": 1,
"subid": "127.0.0.1",
"ip": "127.0.0.1",
"country": "US",
"amount": 1.23,
@xandrco
xandrco / cpalead_conversion_api_response.txt
Created November 20, 2023 17:08
CPAlead Conversions API response
{
"status": "success",
"total": 2,
"conversions": [
{
"amount": 1.23,
"offer_id": 1321,
"country": "US",
"timestamp": 1699978573
},
@xandrco
xandrco / cpalead_offers_code_example.txt
Created November 20, 2023 16:38
Offers list code example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CPAlead JSON API Example</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/5.1.3/css/bootstrap.min.css" integrity="sha384-1BmE4kP5vv0mR4KZaZ+5n5zRr+Zj8q8F2FwXqPWHKE5CkZK3uHZF6nIncHUz8d2T" crossorigin="anonymous">
<style>
body { padding-top: 50px; }
@xandrco
xandrco / offers_api.txt
Created November 20, 2023 16:18
CPAlead Offers API Response
{
"status": "success",
"number_offers": 2,
"country": "US",
"devices": null,
"offers": [
{
"id": 1129,
"title": "World Of Tanks",
"description": "Complete Bootcamp And Get Next Level Tank (New Users Only)",
@xandrco
xandrco / purchase.php
Created November 1, 2018 13:48
purchase.php
<?php
// Purchase form: http://your-site.com/purchase.php?click_id={CLICK_ID} - parameter click_id={CLICK_ID} is required for purchase
if($_REQUEST['type'] == 'purchase') {
// Getting data from purchase page. Is your job to filter fake purchases
if(is_purchase_is_valid() == 1) { // is_purchase_is_valid() - that is validation function in your system
$click_id = $_POST['click_id']; // Here is click_id from submitted form
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
@xandrco
xandrco / signup-en.php
Created August 9, 2018 14:36
Sign Up En
<?php
// Sign up form: http://your-site.com/signup.php?click_id={CLICK_ID} - parameter click_id={CLICK_ID} is required for sign up
if($_REQUEST['type'] == 'sign_up') {
// Getting data from sign up and validating it. Is your job to filter fake sign ups / purchases
if(is_user_valid() == 1) { // is_user_valid() - that is validation function in your system
$click_id = $_POST['click_id']; // Here is click_id from submitted form
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
@xandrco
xandrco / medical-billing-signup.php
Created April 30, 2018 18:05
medical-billing-signup
<?php
/*
This is /medical-billing-signup page. Tracking URL to that page should be:
https://www.bikham.com/medical-billing-signup/?click_id={CLICK_ID}&publisher_id={PUBLISHER_ID} - it is set in CPAlead advertising panel.
On that page, in form is attached click_id value, from $_GET['click_id'] parameter. It is added in hidden input and sent to form execution function.
*/
// ... Here is any code ...
// Here is form receiver function - where is processes data from form: (Can be in another file, in example is POST method)
@xandrco
xandrco / file.php
Created April 28, 2018 10:59
Advertiser postback
<?php
// Sign up form: http://your-site.ru/signup.php?click_id={CLICK_ID} - parameter click_id={CLICK_ID} is required for page, where shoudl be done conversion (sign up / complete form)
if($_REQUEST['type'] == 'sign_up') {
// Getting values from form and valiadation them. Sometime can be fake value, like fdsudf@dsfsd.com
if(is_data_valid() == 1) { // is_user_valid() - this is your function for validating
$click_id = $_POST['click_id']; // click_id from form which we submitted.
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
@xandrco
xandrco / signup.php
Created March 14, 2018 18:43
пример postback
<?php
// Форма регистрации: http://your-site.ru/signup.php?click_id={CLICK_ID} - параметр click_id={CLICK_ID} обязателен для ссылки на страницу регистрации
if($_REQUEST['type'] == 'sign_up') {
// Получаем данные с формы и проверяем все на валидность. Иногда бывает фейковый трафик с email типа fdsudf@dsfsd.com
if(is_user_valid() == 1) { // is_user_valid() - это ваша кастомная функция валидации пользователя
$click_id = $_POST['click_id']; // Тот самый click_id с формы