Skip to content

Instantly share code, notes, and snippets.

View xandrco's full-sized avatar

Alexandr C xandrco

View GitHub Profile
@xandrco
xandrco / cpalead_leads_api
Last active August 25, 2017 14:11
CPAlead - Leads API
[
{
"id": "335",
"campid": "6576",
"ip": "95.105.102.104",
"subid": "156961",
"subid2": null,
"subid3": null,
"earn": "0.15",
"ddate": "2017-07-25",
@xandrco
xandrco / cpalead_postback_offerwall_page.php
Last active December 28, 2017 14:58
cpalead_postback_offerwall_page
<?php
/**
* ATTENTION! This code is used only as example. You should use your variables name and offerwall URL.
* This code can be used on page, where offerwall should appear.
* We will check if user is signed in inside website or application. If yes - will show offerwall.
* $userId = should have value of signed in user, which will complete offers. We will use it as subid value.
*/
// Your application code ...
@xandrco
xandrco / postback.php
Created December 28, 2017 15:54
postback.php
<?php
/*
* Postback Example Script. This script is meant to only be a rough outline of
* how a postback should operate, and not necessarily used out of the box.
*
* subid value, which will come in postback is user id as was provided in example from documentation page.
* Number of points will come inside 'virtual_currency' parameter.
*
* Copyright 2017. CPAlead, LLC. All Rights Reserved
*/
@xandrco
xandrco / postback.php
Last active December 28, 2017 17:47
postback.php
<?php
/**
* This is an example of Postback file for saving conversions into database.
* Do not forget to change values for database connection.
*/
// Define your password, set to blank "" for no password. (optional).
$your_postback_password = "";
@xandrco
xandrco / postback.php
Last active December 28, 2017 17:51
postback.php
<?php
/**
* This is an example of Postback file for rewarding publisher for completing offer.
* Do not forget to change values for database connection.
*/
// Define your password, set to blank "" for no password. (optional).
$your_postback_password = "";
@xandrco
xandrco / submit.php
Created January 12, 2018 13:58
Example of using postback for advertisers.
/*
* $pin_submited - This is condition for conversion
* $_POST['click_id'] - This is our click id, which is sent to you in tracking url.
* For example, your tracking URL is http://yourdomain.com/submit_pin.php?click_id={CLICK_ID}&subid=any_parameter_for_your_platform
*/
<?php
// .... Your code
?>
<form id="form_for_submiting_number" method="POST>
/*
* $purchased - This is condition for conversion
* $_POST['click_id'] - This is our click id, which is sent to you in tracking url.
* For example, your tracking URL is http://yourdomain.com/purchase.php?click_id={CLICK_ID}&subid=any_parameter_for_your_platform
*/
<?php
// .... Your code
?>
<form id="form_for_purchasing_anything" method="POST>
@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 с формы
@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 / 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)