Anyone here has this simple script?

xanaIDE

Power Member
Joined
Sep 19, 2020
Messages
520
Reaction score
339
So the script is about rotating AdSense ad units. for example, you want to make 3 ad units in the same placement, and the script will show a different and random ad unit for each user.
This is to reduce ad units CTR.
 
Quick php code:

$ad[1] = "you first ad unit code";
$ad[2] = "you second ad unit code";
$ad[3] = "you third ad unit code";

$currentAd = rand(1,3);

echo $ad[$currentAd];
 
Quick php code:

$ad[1] = "you first ad unit code";
$ad[2] = "you second ad unit code";
$ad[3] = "you third ad unit code";

$currentAd = rand(1,3);

echo $ad[$currentAd];
I have some HTML websites, will this script work on them? Sorry, I'm not really a techy guy.
 
I have some HTML websites, will this script work on them? Sorry, I'm not really a techy guy.
Are the websites hosted on a Linux server? If yes, you can edit the .html extension to .php to use the code above.
 
Back
Top