Traffic Nomads Ad Network
Traffic Nomads Ad Network

Help Needed with Cloudflare Worker for Postback Conversion Tracking

RollerAds

jaswinder

Grand Guru
Joined
Dec 24, 2019
Messages
459
Hello,

I'm running a very low-paying offer that consumes too many events in my tracker, which significantly increases my tracking costs. After a lot of time and optimization, I managed to make the campaign profitable, but the cost of tracker events still takes a huge portion of my profits.

I thought of using Cloudflare Worker to handle the postback conversions from the affiliate network to the traffic source. I can access all other data within the traffic network itself; I only need to pass the conversions. However, I can't use the direct postback URL from the traffic network, as I don't want to disclose my traffic source to the affiliate network.

I tried to create a script with the help of ChatGPT, but it's not working as expected. Below is the code I used.
JavaScript:
addEventListener('fetch', event  => {
  event.respondWith(handleRequest(event.request));
});

async function handleRequest(request)  {
  // Parse the query  parameters from the incoming Zeydoo postback
   let url = new URL(request.url);
   let ymid = url.searchParams.get('ymid');        //  Zeydoo's click ID
  let amount  = url.searchParams.get('amount');   // Payout  amount from Zeydoo
  let varParam  = url.searchParams.get('var');    //  Optional extra variable
 
  if  (!ymid) {
    return  new Response("Missing ymid (click_id)", { status:  400 });
  }

  //  Log the incoming postback data (for
 
Last edited:
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