• Welcome to affLIFT!
    We are happy you have decided to check out our awesome affiliate marketing forum. Register your account today to join our amazing community!
  • 30% off for ad tracking & automation! Leading affiliates & media buyers use RedTrack for 5-minute cost updates, campaign management, smart rules, CAPI integrations with FB, TikTok, Google Ads, Bing, etc.
    Get 30% OFF!

Guide 🛡️ Protect your landing pages from direct access (script for Skro tracker)

CrakRevenue

dood

🚀
Staff Member
Community Leader
Joined
May 2, 2018
Messages
2,951
Last month I created and shared a script that can protect your landing pages from direct access if you use BeMob as a tracker. Since landing page protection is a paid feature in BeMob, I’ve decided to create a script that works with Skro tracker, since they offer that feature in their free plan.

Skro also provides PHP and JS code, but I wanted to create a script that works with CloudFlare Pages.

Anyway, the PHP code looks like this:

Code:
     const PROTECTION_TOKEN =  ''; // Your landing protection token
     const KEY_TTL =  '30 minutes'; // How long KEY  should be valid. Valid formats are  explained here: http://php.net/manual/en/datetime.formats.php
     const KEY_GET_PARAM = 'key'; // GET  parameter with Skro landing key.
     $key = isset($_GET[KEY_GET_PARAM]) ?  rawurldecode($_GET[KEY_GET_PARAM]) : exit('Access denied');
     if (!$key = base64_decode($key)) {
          exit('Access denied');
     }
    if (!$key  = json_decode($key, true)) {
         exit('Access  denied');
    }
     if (!isset($key['timestamp']) || !isset($key['hash']))  {
         exit('Access denied');
     }
    $signedHash  = hash_hmac('sha1', $key['timestamp'], PROTECTION_TOKEN);
     if ($signedHash !== $key['hash'] ||  strtotime(KEY_TTL, $key['timestamp']) < time()) {
          exit('Access denied');
    }

You’ll need to create a Protection Token on this page.

Click on the Generate token button and save that token somewhere for later use.

UE7VMbHrmCzIEjnourCMKYLRZMexqbsd0fda-dgOrFd7i4KwdyF41_ChLMeSpkUjLvHpUTBk52Hgcg91HXmKreGfXjbFJ5IqnoE4UDGLpIQApACkoGdyeWbsMjL5ITi7UWFa9JVTnu2UX-WjJk-NqFo


When
 

Attachments

  • index.zip
    69 KB · Views: 18
To view the premium content in our affiliate marketing forum (including this awesome thread), you must first register and upgrade your account. Register today and become a part of our amazing community!
Top