Script Tutorials

In the docs

Please note that some of these are really old scripts but we're including them for legacy's sake:

Below you'll find three available scripts. iFrame, Dynamic Keyword Insertion, and Page Load Time Analysis.

iFrame Script

Here is the code to use for iframing an offer with Prosper202 ClickServer. Replace your-tracking-domain.com with the domain ClickServer runs on, plus its folder if you installed it in one, and replace XXXXXX with your landing page's ID: the number after lpip= in the landing page code from Step 7. Place the JavaScript at the end, and have the iframe src set to the landing page outbound link, not the PHP redirect code.

<html>
 	<head>
 	<title>Title Goes Here</title>
 	</head>
 	<body style="margin: 0px; padding: 0px;" scroll="no">
 	<iframe src="https://your-tracking-domain.com/tracking202/redirect/go.php?lpip=XXXXXX" style="border: 0px; width: 100%; height:100%;"></iframe>
 	<script src="https://your-tracking-domain.com/tracking202/static/landing.php?lpip=XXXXXX"></script>
 	</body>
</html>
Using an Iframe on the 2nd page, instead of redirecting through the affiliate link Sometimes you may just want a regular landing page as the first page the visitor sees, but then instead of having a link that redirects out to the offer destination url, you instead want the 2nd page to just be an iframe of the offer. So in this aspect the visitor never actually leaves your domain. They land on the first page, which is a regular page that tries to make them click through and then instead when they click through to redirect them to the offer, you instead have a page that iframes the offer. This makes it look like the user is still on your page. Below I will show you how to do this.

The basic concept is actually quite simple; instead of redirecting to the affiliate URL, we are now just going to have an iframe and paste the affiliate URL as the IFRAME SRC. You can do this by modifying the simple or advanced landing page PHP REDIRECT code by using the example below. All that is happening is instead of using the previous header() command which redirects the user, we now echo (which prints to HTML) the URL in the IFRAME SRC. See below:

<?php
  
//$tracking202outbound is where the user is supposed to be redirected to
  if (isset($_COOKIE['tracking202outbound'])) {
    $tracking202outbound = $_COOKIE['tracking202outbound'];
  } else {
    $tracking202outbound = 'https://your-tracking-domain.com/tracking202/redirect/lp.php?lpip=XXXXXX'
      . '&pci=' . urlencode($_COOKIE['tracking202pci'] ?? '');
  }

?>

Further down the same .php file, print that URL as the iframe src. htmlspecialchars() escapes it so it is safe to print inside the tag:

<html>
 <head>
 <title>Title Goes Here</title>
 </head>
 <body style="margin: 0px; padding: 0px;" scroll="no">
 <iframe src="<?php echo htmlspecialchars($tracking202outbound, ENT_QUOTES, 'UTF-8'); ?>"
 style="border: 0px; width: 100%; height:100%;"></iframe>
 </body>
</html>

Putting Dynamic Keywords in your Landing Pages

This shows how to dynamically display the keyword the user was searching for on your landing page. This is a simple script that prints the dynamic keyword on the page for users with Prosper202 installed. Below is an example landing page .php file that shows how to place dynamic keywords on your landing page!

Landing Page Code

<?php

//grab the t202 keyword, escaped so it is safe to print on your page
$keyword = htmlspecialchars($_GET['t202kw'] ?? '', ENT_QUOTES, 'UTF-8');

//now anywhere we call echo $keyword, it will display the dynamic kw!

//extra goodie, uncomment the line below if you would like to capitalize 
//the first character in each word
//$keyword = ucwords(strtolower($keyword)); 

?>

<html>
 <head>
 <!-- Display the Dynamic Keyword in the Title! -->
 <title><?php echo $keyword; ?></title>
 </head>
 <body>

 <!-- Display the Dynamic Keyword in the body's content! -->
 This is the content on my landing page! You were searching for <?php echo $keyword; ?>.

 </body>
</html> 
Anywhere you now call <?php echo $keyword; ?> in your .php file, it will print out the dynamic keyword insertion!

Landing Page Load Time Analysis

With quality scoring, taking into account how fast your landing page loads, is increasingly more important to build faster loading landing pages. And to analyze that we have a simple script that displays at the bottom of each page how long it took to load. It times how long your server takes to build the page, not how long the visitor's browser takes to show it. Below is the script that shows how to set this up.

Landing Page Code

<?php $microtimer = microtime(true); /*set the timer, this is to be placed at the top! */ ?>

<html>
 <head>
 <title>Title</title>
 </head>
 <body>
 
 Blah Blah Blah, this is my content!
 
 <?php //print on the screen how long this page took to load
 $seconds = microtime(true) - $microtimer;
 echo 'This page took ' . round($seconds, 3) . ' seconds to load.'; ?>
 
 </body>
</html> 
So now at the bottom of each page it will say: This page took xxxxx seconds to load.