Home > Programming, Servers & Scripts >

Landers hosted on CDNs - How to pass querystrings! (15)


02-24-2014 09:45 AM #1 zeno (Administrator)
Landers hosted on CDNs - How to pass querystrings!

Hosting a HTML lander on a CDN and want to pass querystrings to an outgoing link? PHP is no go so Javascript is the way. The coding is simple but if you're anything like me then Javascript makes you uncomfortable. Here is a simple setup that will get the job done!

Code:
<!DOCTYPE html>
<html>
<head></head>
<body>
 <script language="javascript">
//function to get parameters passed in the URL
function getURLParam( name ) {
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null )
      return "";
    else
      return results[1];
}
//now associate each parameter with a variable
var subid1_val = getURLParam('subid1') 
var subid2_val = getURLParam('subid2') 
var subid3_val = getURLParam('subid3') 
function cta(){
window.location ='http://myafflink.com/'+'?s1='+subid1_val+'&s2='+subid2_val+'&s3='+subid3_val;
}
</script>
<a onclick="cta();">This is my link!</a>
</body>
</html>


02-24-2014 11:31 AM #2 caurmen (Administrator)

Nice! HTML-only landers are fast and very lightweight to serve, so this is definitely worth considering.


05-29-2014 11:05 AM #3 karim0028 (Member)

what is the difference in performance of an HTML lander purely on CDN w/ js vs a regular lander on server with PHP? Anyone care to share their results?


05-29-2014 11:55 AM #4 caurmen (Administrator)

@karim0028 - do you mean in terms of loading speed or overall campaign performance / revenue / etc?

I did a CDN vs regular server test here - http://stmforum.com/forum/showthread...-Will-Make-You - in terms of speed rather than revenue.


05-29-2014 12:11 PM #5 karim0028 (Member)

i guess in terms of clickloss... Would testing the lander on a CDN help if im seeing diff conversion rates between 2 networks for the same offer?


05-29-2014 12:40 PM #6 atom64 ()

i would say this only make a difference on mobile landers as every ms count on mobile devices
for desktop traffic i wouldnt care much about that


05-29-2014 12:49 PM #7 zeno (Administrator)

Speed always counts but is more crucial in mobile due to the lengthier general page load times.

Click loss generally has little to do with page load speed... it is a phenomenon usually related to tracking stats (slow page = person doesn't click through, but their click is not 'lost').

All else being equal, two HTML only pages on your server vs a CDN will load at a similar speed. However as the user moves further from your physical server, you will benefit from the CDN as the server that serves the user changes and is usually quite close to the user. If you add SSL, the closer server will win hands down. By closer I also imply that the latency to the server is lower.

Also, you should consider how your tracking works. If you load a tracking link via your server, which then redirects to a landing page, it can be faster to have the landing page served from that server due to the fact the user has already established a connection to it, resolved its domain name to an IP, etc. This is why you should monitor real user page load speed and split test - don't just take one option as gospel.


05-29-2014 12:54 PM #8 karim0028 (Member)

tracking through Voluum so not using a server for tracking... server is basically just for LP's... its on mobile campaigns that im talking about...


05-29-2014 03:19 PM #9 shakedown (Member)

Quote Originally Posted by zeno View Post
This is why you should monitor real user page load speed and split test - don't just take one option as gospel.
How can we run a test like this?


05-30-2014 12:42 AM #10 zeno (Administrator)

There are a lot of services that provide real user monitoring (RUM).

New Relic is ideal for testing pages on your own server (automatically does so for every page). Pingdom has a RUM option. Cedexis also offers this and there are many others.

http://stmforum.com/forum/showthread...ty-data-Part-2


05-30-2014 04:29 PM #11 caurmen (Administrator)

If there's interest in it, Zeno or I can put together a tutorial on implementing Real User Monitoring on your LPs. Let me know!


05-30-2014 11:35 PM #12 superboi (Member)

What would be the URL look like on this one?

for example:

www.mydomain.com/index.html


so + the string would be?

www.mydomain.com/index.html?subid1=camp2KZ&subid2={{{bidhash}}}


05-31-2014 05:58 AM #13 zeno (Administrator)

Quote Originally Posted by superboi View Post
What would be the URL look like on this one?

for example:

www.mydomain.com/index.html


so + the string would be?

www.mydomain.com/index.html?subid1=camp2KZ&subid2={{{bidhash}}}
Yes, it just has to be as any querystring would normally be.


05-31-2014 03:12 PM #14 superboi (Member)

Hi Zeno,

Thanks for the help...

but could you help me a little bit more?

I am unsure if this question was covered in caurmens appetizer... but I got stuck in creating/having my camp approved... so I cannot continue...

but anyway... I am trying to create a funnel like this: banner -> lander -> offer

and it seems like a static cdn lander is a better choice for NON-US geo...

I already have my default lander and a couple of banners... but I do not know how to connect all the dots...

Can you give me an example URL... that needs to be put into decisive (banner click)?
here is what I got from my network... and needs to be put into decisive...

http://sampleaffiliatenetwork.com/54c4u233s254x2u224/&subid1=camp2KZ&subid2={{{bidhash}}}
with my lander... would it be..

http://mylanderdomain.com/index.html?subid1=camp2KZ&subid2={{{bidhash}}}
correct?

and in my index.html

I will add your little script:
<script language="javascript">
//function to get parameters passed in the URL
function getURLParam( name ) {
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
return "";
else
return results[1];
}
//now associate each parameter with a variable
var subid1_val = getURLParam('subid1')
var subid2_val = getURLParam('subid2')
var subid3_val = getURLParam('subid3')
function cta(){
window.location ='http://myafflink.com/'+'?s1='+subid1_val+'&s2='+subid2_val+'&s3='+subid 3_val;
}
</script>
Do I need to edit anything on this script except the afflink url?

in the red text in javascript... is this correct?

window.location ='http://sampleaffiliatenetwork.com/54c4u233s254x2u224/'+'?s1='+subid1_val+'&s2='+subid2_val+'&s3='+subid 3_val;

or should it be:

window.location ='http://sampleaffiliatenetwork.com/54c4u233s254x2u224/'+'&s1='+subid1_val+'&s2='+subid2_val+'&s3='+subid 3_val;

the difference between the two is (? and &)


05-31-2014 03:22 PM #15 superboi (Member)

Quote Originally Posted by caurmen View Post
If there's interest in it, Zeno or I can put together a tutorial on implementing Real User Monitoring on your LPs. Let me know!
It would be very awesome... if it is also very light... and loads fast


Home > Programming, Servers & Scripts >