Cashback world
Autor: IULIAN D.Buongiorno,
io dovrei integrare in un sito internet che ho costruito, uno script php redirect e anche uno script php tracking pixel. Mi potete dire dove inserirli per non creare casini.
Grazie
questi sono i due script
PHP - Redirect Script
<?php
// Open session for cookie handling.
session_start();
//
// Change URL to the default landing page/homepage.
$defaultUrl = "http://www.example.com/";
//
// The domain under which this script is installed.
$domain = "example.com";
if (!empty($_GET["tduid"]))
{
$cookieDomain = "." . $domain;
setcookie("TRADEDOUBLER", $_GET["tduid"], (time() + 3600 * 24 * 365), "/", $cookieDomain); //
// If you do not use the built-in session functionality in PHP, modify
// the following expression to work with your session handling routines.
$_SESSION["TRADEDOUBLER"] = $_GET["tduid"];
}
if (empty($_GET["url"]))
$url = $defaultUrl;
else
$url = urldecode(substr(strstr($_SERVER["QUERY_STRING"], "url"), 4));
header("Location: " . $url);
?>
2.
PHP - Tracking Pixel Script
<?php
// Open session for cookie handling.
session_start();
//
// Your organization ID; provided by Cashback World.
$organization = xxxx;
//
// Event ID; provided by Cashback World.
$event = xxxx;
//
// Value of the sale; sale specific value has to be assigned dynamically out of the shop database. The orderValue is the basis for the commission paid to Cashback World.
$orderValue = "0.00";
//
// Currency of the sale. For example “USD” for US-Dollar, or “EUR” for Euro.
$currency = "EUR";
//
// A unique identifier for the transaction. You should assign your internal shop order number dynamically out of your shop database. For a sale, this is typically the order number which is also shown to a customer in the order confirmation.
$orderNumber = "xxxxxxxx";
//
// Event type:
// true = Sale
// false = Lead
$isSale = true;
//
// Encrypted connection on this page:
// true = Yes (https)
// false = No (http)
$isSecure = true;
//
// If you do not use the built-in session functionality in PHP, modify
// the following expressions to work with your session handling routines.
$tduid = "";
if (!empty($_SESSION["TRADEDOUBLER"]))
$tduid = $_SESSION["TRADEDOUBLER"];
//
// OPTIONAL: You may transmit a list of items ordered in the reportInfo parameter. See chapter reportInfo (3.4.7.) at the “Tracking Implementation” Manual for details.
$reportInfo = "";
$reportInfo = urlencode($reportInfo);
//
/***** IMPORTANT: *****/
/***** In most cases, you should not edit anything below this line. *****/
if (!empty($_COOKIE["TRADEDOUBLER"]))
$tduid = $_COOKIE["TRADEDOUBLER"];
if ($isSale)
{
$domain = "tbs.tradedoubler.com";
$checkNumberName = "orderNumber";
}
else
{
$domain = "tbl.tradedoubler.com";
$checkNumberName = "leadNumber";
$orderValue = "1";
}
//Create the checksum. See chapter checksum (3.4.1.) at the “Tracking Implementation” Manual for details.
checksum = "v04" . md5($secretcode . $orderNumber . $orderValue);
if ($isSecure)
$scheme = "https";
else
$scheme = "http";
$trackBackUrl = $scheme . "://" . $domain . "/report"
. "?organization=" . $organization
. "&event=" . $event
. "&" . $checkNumberName . "=" . $orderNumber
. "&checksum=" . $checksum
. "&tduid=" . $tduid
. "&type=iframe"
. "&reportInfo=" . $reportInfo;
if ($isSale)
{
$trackBackUrl
.= "&orderValue=" . $orderValue
. "¤cy=" . $currency
}
echo "<iframe src=\"" . $trackBackUrl . "\" frameborder=\"0\" width=\"1\" height=\"1\"></iframe>"; ?>
Grazie mille
Non entrando in merito allo scopo dello script se sono aperture di sessione vanno messe prima di qualunque altra cosa nella pagina.
Comunque meglio chiedere a chi ti ha fornito il codice