Home > Technical & Creative Skills > Programming, Servers & Scripts

How to setup Caurmen’s “Parses Javascript” Bot Detection using Binom (9)


03-19-2018 12:44 PM #1 luke_clickwalker (Member)
How to setup Caurmen’s “Parses Javascript” Bot Detection using Binom

UPDATE: Using a new method on post #3. Unfortunately, I could not get this method to work, surely I did something wrong. Leaving the post up though, maybe it can be of help or maybe someone else can find the flaw or improve upon it?

Hey all,

100% adapted from the original.

NEW: Zero (!) Load Time Bot Tester For Your Live Campaigns

Preamble:

Even though I am relatively new to AM (1 year since kindergarten), I quickly recognized the tremendous human being caurmen was. You could really see it in his eyes and through the tone of his voice, how rewarding and fulfilling it was for him to share his knowledge as altruistically as possible.

I very much resonate with that, and this is just my lame attempt to honor his memory and endless contributions.
Farewell Hugh, hope to see you in the stars someday!

---

First step, a quick overview of what we are trying to achieve - A shoutout (and thanks!) to @platinum for the following diagram!



The overal mission:

- Create a script to add to our landers and a specific campaign offer, that detects most bots and sends them away, as we gather stats to better optimize our campaigns.

Quote Originally Posted by caurmen View Post

Features Of This Script


  • Gives you an accurate read on the percentage of common bot traffic clicking your ad links.
  • Effectively zero impact on page load time, meaning you can use it on all campaigns.
  • High accuracy at detecting CURL-based or non-Javascript bots.
  • Won't trigger false negatives from bots which look for URLs in the page.

Step 1) – Create a Bot Detection Offer – nothing much to it, really.




Step 2) – Creating Landers


For this system to work, you need to create landers that have 2 offers. In this case I did the opposite of @platinum's diagram, I am using (offer 1 = real) vs (offer 2 = bot detection)



Now, it is very important to understand that the CTA link on your landers is always going to be

http://yourtracker.com/click.php?lp=1

Even if you have 50 different offers in the same landing page, this tracker link never changes. What you want to do is append a query to specify to which offer you wish to send to, and this is the string

&to_offer=1

So in our case, we want to send to 2 distinct offers. The real offer, and the Bot Detection. So the links on your landers should look like this

Real Offer -> http://yourtracker.com/click.php?lp=1&to_offer=1
Bot Offer-> http://yourtracker.com/click.php?lp=1&to_offer=2

Next, we need to add a script to our landers to fish out the bots and determine how infested our traffic is.

STEP 3) Coding the Landers

Add the following bot detection Javascript to your landing page, just above the closing BODY tag.


Code:
 
<script>
 
    u1 = "http://yourtracker.com/click.php";
 
    u2 = "lp=1&to_offer=2";
 
    document.write('<iframe src="' + u1 + "/" + u2 + '"></iframe>');
   
    </script>

Now, add the following Style tag to the HEAD tag of your lander

Code:
 
<style>iframe {
    visibility: hidden;
    position: absolute;
    left: 0; top: 0;
    height:0; width:0;
    border: none;
            }</style>

Finally, don’t forget to edit your CTA button to include

http://yourtracker.com/click.php?lp=1&to_offer=1

Step 4) Creating a campaign

In this scenario, I will be just testing with 1 LP for simplicity. When I am confident I have everything up and running fine, I’ll deploy the other landers.

The only caveat of this method is that if you do want to rotate offers, you need to duplicate entire Paths, as each Path can only contain 2 offers




Note: I am not 100% sure, but I think you need to select to NOT rotate the offers. I am not sure if the &to_offer=N will override the rotation or not. Their Smart Rotation is actually pretty smart indeed.



Step 5) Launch the Campaign and Analyzing Stats

Lets have a look and analyze the results so far with around 5000 visits and about $7 spend

Traffic is mobile carrier + wifi




Now we have a look at stats by offer ... Almost a 50% split, which seems odd...



Drilling down further into Sources -> Offers



Step 6): How to analyze the stats...

This is very very early on. Only $7 spent and not a fair assessment. In the next posts I will be more detailed, but for the sake of explaining, here goes.

The image above only shows Sources... ideally you will want to drill down into the actual targets for more accuracy.

zinnober-dog:
- Bot Detection: 100% - 1.59% = 98,41% confirmed bots (high potential to cut Source)

leucochroic-beetle:
- Bot Detection: 100 - 26.67% = 73,33% (medium potential to cut source)

So logic would dictate to just cut out zinnober-dog all together right?
Well, if you drill down into placements, what do we see?



Seems some good Targets/Placements can be great within a bot infested source... that foxtrot-ump "only" has around 84% bots, and the LP CTR is increasing all over, and lots more Targets are getting better stats. So instead of cutting the source altogether, drill down as much as possible.

Also, secondary bot detection methods can be employed to better optimize promising Placements. (ip-ranges, user-agents, etc?) - gotta get some intel on this.

Again, this was ONLY with about 7-10 bucks spent. I assume bot traffic is the first to flow in and real human traffic to follow,

Edit: - After some spend, this particular GEO in Zeropark is hugely bot infested. Will have to compare to another source of course. - UPDATE: I stand corrected, as I did something wrong, as the new method below shows


03-19-2018 03:08 PM #2 luke_clickwalker (Member)

Reserved for stats analysis.

EDIT: Something is not working as expected. Instead of sending to www.bing.com as shown above, I sent the Bot Offer to Afflow for quality control ... and I got a CR



Investigating the issue:

UPDATE: ... the proof is in the pudding I did something wrong, unless there are really intelligent bots out there that manage to convert on Afflow.

After speaking with Binom support, I was amazed to find out they have their own solution in the documentation. Will do a write up soon.


03-20-2018 10:09 AM #3 luke_clickwalker (Member)

Ok, so I implemented the inbuilt Binom solution, and now my stats seem to make much more sense.

Apparently only works for mobile though...



All you need to do is follow their guide here

Essentially it is a 2 step process, code a lander and activate a new column in the reporting view.

Step 1) Adding code to landers

Simply add this to the <body> of your pages. I have no idea how it works, but it uses custom Events within the tracker.

Code:
<script>
if (typeof(window.orientation)=="undefined")
{
var o = document.createElement("img");
o.src='http://tracker.net/click.php?event9=0';
}
else
{
var o = document.createElement("img");
o.src='http://tracker.net/click.php?event9=1';
}
</script>
Step 2) Adding a Bot % Column

Head over to Settings -> Stats Settings, and scroll down



Click on Add Custom Column



You will need to enter the following formula, take care to input correctly or you'll get a red box like in the screenshot below ... I was scratching my head for a while. Using the mouse to input the values works great.

Code:
100-event_9/clicks*100


Now you can drag this column view up to wherever you wish, and you're basically done. Just launch traffic and wait for stats



That's it, now you should something like this



--- I have no clue which solution works best, I am doing this more as an exercise to further my knowledge and skillset.
Anyway, hope it helps fellow Binom users out there.


03-26-2018 09:48 AM #4 luke_clickwalker (Member)

Something is still not working as expected. Maybe someone can explain these results?

I uploaded few landers to test a new campaign, this is all me on browser and mobile. Says 83,3% bots.

This is my current LP cleanup-sequence.

For backfix, after </head> and before <body>

Code:
<script type="text/javascript">
       ! function() {
            var t;
            try {
                for (t = 0; 10 > t; ++t) history.pushState({}, "", "#");
                onpopstate = function(t) {
                    t.state && location.replace("http://my.tracker/click.php?lp=1&place=backfix")
                }
            } catch (o) {}
        }();
    </script>

For the actual bot detection, inside the <body>

Code:
<script>
if (typeof(window.orientation)=="undefined")
{
var o = document.createElement("img");
o.src='http://superpop.xyz/click.php?event9=0';
}
else
{
var o = document.createElement("img");
o.src='http://my.tracker.xyz/click.php?event9=1';
}
</script>
And finally, a JS CTA to confuse dumb bots

Code:
<div>
<a href="javascript:void(0)" rel="noreferrer" onclick="exit_offer();PreventExitPop = false" class="cta_class";>CTA Text</a>
</div>






<script type="text/javascript">
     function exit_offer() {
            window.onbeforeunload=null;
            window.location = "http://my.tracker/click.php?lp=1";
        }
  </script>
And I've been using my laptop and phone to check on the lander while tweaking, and I'm getting this




What might be happening? Shouldn't Bot % be zero ?


03-26-2018 11:25 AM #5 roman binom (Member)

Pay attention that in your second script you have window.orientation parameter, which is applicable for mobile phones, but not for laptops. Laptop will be considered as bot. And since I don't know how many of those 6 clicks were from laptop - I can't tell you if this is correct numbers


03-26-2018 11:30 AM #6 luke_clickwalker (Member)

Quote Originally Posted by roman Binom View Post
Pay attention that in your second script you have window.orientation parameter, which is applicable for mobile phones, but not for laptops. Laptop will be considered asbot. And since I don't know how many of those 6 clicks were from laptop - I can't tell you if this is correct numbers

Ah yes, of course! I forgot about that detail. I will re-test

Thany you @roman Binom!


03-26-2018 01:23 PM #7 luke_clickwalker (Member)

.... puuuuurfect !!

Thanks again!


12-27-2018 06:27 AM #8 lawmence (Member)

hi @luke_clickwalker for sharing this thread, it really help me a lot! But how you solve the problem for the last thread? Since the the code from Binom is only applicable for Mobile traffic what about laptop?


12-27-2018 04:59 PM #9 euforio (Member)

Awesome tutorial , that work really well . Do you think push traffic is also infected by bots and it's worth to add this thing on my push LP?

Thank


Home > Technical & Creative Skills > Programming, Servers & Scripts