Home > Other Systems (CPVLab, iMobiTrax, P202, Track Revenue, Click, Google Analytics, etc.) > Normal Prosper202

P202 - Problems with LP: Outbound Javascript Redirect Code (27)


08-28-2013 12:56 PM #1 cyberdelicstudio (Member)
P202 - Problems with LP: Outbound Javascript Redirect Code

Hey STMers,

I'm running all my LPs on Unbounce.com (easy to create/drag & drop). I've added the redirect code using a Javascript container onto my LPs and it does work/track.

The problem is that when I test the LP URL - this code is automatically redirecting onto the offer without any human intervention! How do I stop this?

I can't use PHP because the LPs are hosted on Unbounce.

Thanks,

Jay.


08-28-2013 01:18 PM #2 hd2010 (Member)

Just host your LP on your on hosting preferably vps or dedicated


08-28-2013 02:10 PM #3 cyberdelicstudio (Member)

Quote Originally Posted by hd2010 View Post
Just host your LP on your on hosting preferably vps or dedicated
At the moment I can't because I'm using Unbounce


08-28-2013 02:13 PM #4 hd2010 (Member)

why you use ubounce rather than your own hosting ? i believe if you track using cpvlab or p202 on your own hosting, this will adding more latency in between your host and ubounce, which is not recommended, latency is not your friend in affiliate marketing.


08-28-2013 02:29 PM #5 cyberdelicstudio (Member)

Yeah I agree but I don't have a clue how to build LPs so Unbounce is making it easier for me. The latency isn't bad at all. I'm in the UK and Unbounce servers are in Canada.


08-28-2013 06:31 PM #6 JasperP (Member)

are you using the "Landing Page: Outbound PHP Redirect Code"?

What redirect code did you put in the Javascript container?

It would help if you can paste an example of what you did.


08-28-2013 06:52 PM #7 cyberdelicstudio (Member)

Quote Originally Posted by JasperP View Post
are you using the "Landing Page: Outbound PHP Redirect Code"?

What redirect code did you put in the Javascript container?

It would help if you can paste an example of what you did.
Hey Jasper. Here's the code:

http://i.imgur.com/HGyRNUU.jpg

Thanks.

Jay.


08-28-2013 07:18 PM #8 JasperP (Member)

Oh I see. are you using the older version of Tracking202?

I'm not familiar with the unbounce interface, but what does your file structure look like? If you put the redirect code in the LP, it seems like it's going to redirect without seeing the LP.

This is what how I imagine you should be setting it up:

Landing Page: landing_page.html
Redirect Page: redirect_offer1.html

landing_page.html contains a link to redirect_offer1.html

the JS redirect should go in redirect_offer1.html


08-28-2013 07:23 PM #9 JasperP (Member)

Example:

landing_page.html

Code:
<html>
   <head></head>   
   <body>
      <h1>
         <a href="redirect_offer1.html">Click me to go to the offer</a>
      </h1>
      <script language="JavaScript" type="text/javascript">
          cbr202=Math.random()*10000000000000000;document.wr ite('<scr'+'ipt language="JavaScript" src="http://xxxx.com/tracking202/static/landing.php?lpip=1&202cb='+cbr202+'" type="text/javascript"></scr' + 'ipt>'); 
      </script>
   </body>
</html>
redirect_offer1.html
Code:
<html>   
   <head></head>   
   <body>
      <script type="text/javascript">
         if (readCookie('tracking202outbound') != '') {
            window.location = readCookie('tracking202outbound');
         } else {
            window.location = 'http://xxxx.com/tracking202/redirect/lp.php?lpip=123';
         }

         function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
               var c = ca[i];
               while (c.charAt(0) == ' ') c = c.substring(1, c.length);
               if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
            }
            return null;
         }
      </script>
   </body>
</html>


08-28-2013 09:49 PM #10 bbrock32 (Administrator)

Exactly , looks like you are using the wrong JS on the lander. That one should go on the redirect file ( go.php or whatever ).

The code you need to put on the lander should look like this :

Code:
      <script language="JavaScript" type="text/javascript">
          cbr202=Math.random()*10000000000000000;document.wr ite('<scr'+'ipt language="JavaScript" src="http://xxxx.com/tracking202/static/landing.php?lpip=1&202cb='+cbr202+'" type="text/javascript"></scr' + 'ipt>'); 
      </script>


08-29-2013 09:46 PM #11 cyberdelicstudio (Member)

Quote Originally Posted by bbrock32 View Post
Exactly , looks like you are using the wrong JS on the lander. That one should go on the redirect file ( go.php or whatever ).

The code you need to put on the lander should look like this :

Code:
      <script language="JavaScript" type="text/javascript">
          cbr202=Math.random()*10000000000000000;document.wr ite('<scr'+'ipt language="JavaScript" src="http://xxxx.com/tracking202/static/landing.php?lpip=1&202cb='+cbr202+'" type="text/javascript"></scr' + 'ipt>'); 
      </script>
Thanks man. I'll try this out tomorrow.

Jay.


08-30-2013 08:02 AM #12 cyberdelicstudio (Member)

Quote Originally Posted by bbrock32 View Post
Exactly , looks like you are using the wrong JS on the lander. That one should go on the redirect file ( go.php or whatever ).

The code you need to put on the lander should look like this :

Code:
      <script language="JavaScript" type="text/javascript">
          cbr202=Math.random()*10000000000000000;document.wr ite('<scr'+'ipt language="JavaScript" src="http://xxxx.com/tracking202/static/landing.php?lpip=1&202cb='+cbr202+'" type="text/javascript"></scr' + 'ipt>'); 
      </script>
I have added this code onto my lander (<head>) but P202 isn't detecting the LP CTR. Luckily, Unbounce has it's own tracking so I know that LP CTR is currently 35%.


08-30-2013 08:31 AM #13 zeno (Administrator)

Put it at the end of the file just before the closing </body> tag. In general you don't want javascript in the head tags if you can avoid it as it has to be processed before the page (body) will load. Put javascript in the head tags when your page javascript/content NEEDS the other javascript to function properly. For example if you have page content that requires jquery - you would put jquery in the head tags to guarantee it has loaded and is available before the page content attempts to use it.

Also, depending on the Javascript, it may need the page to be loaded to even work (i.e. if it say manipulates page elements). The p202 code (in landing.php) does a few things, not sure if it needs the body loaded, but it should be able to be processed at any time therefore is best done without impacting page load time that is critical in AM!


08-30-2013 12:46 PM #14 cyberdelicstudio (Member)

Quote Originally Posted by zeno View Post
Put it at the end of the file just before the closing </body> tag. In general you don't want javascript in the head tags if you can avoid it as it has to be processed before the page (body) will load. Put javascript in the head tags when your page javascript/content NEEDS the other javascript to function properly. For example if you have page content that requires jquery - you would put jquery in the head tags to guarantee it has loaded and is available before the page content attempts to use it.

Also, depending on the Javascript, it may need the page to be loaded to even work (i.e. if it say manipulates page elements). The p202 code (in landing.php) does a few things, not sure if it needs the body loaded, but it should be able to be processed at any time therefore is best done without impacting page load time that is critical in AM!
Thanks Zeno!

I've updated the JS on my lander. I'm not sure it's working as P202 isn't populating the LP CTR column but it's cool because Unbounce tracks everything anyway (bonus).


08-30-2013 06:06 PM #15 JasperP (Member)

Did you put this code anywhere?

Code:
      <script type="text/javascript">
         if (readCookie('tracking202outbound') != '') {
            window.location = readCookie('tracking202outbound');
         } else {
            window.location = 'http://xxxx.com/tracking202/redirect/lp.php?lpip=123';
         }

         function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
               var c = ca[i];
               while (c.charAt(0) == ' ') c = c.substring(1, c.length);
               if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
            }
            return null;
         }
      </script>


09-02-2013 09:05 AM #16 cyberdelicstudio (Member)

Quote Originally Posted by JasperP View Post
Did you put this code anywhere?

Code:
      <script type="text/javascript">
         if (readCookie('tracking202outbound') != '') {
            window.location = readCookie('tracking202outbound');
         } else {
            window.location = 'http://xxxx.com/tracking202/redirect/lp.php?lpip=123';
         }

         function readCookie(name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
               var c = ca[i];
               while (c.charAt(0) == ' ') c = c.substring(1, c.length);
               if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
            }
            return null;
         }
      </script>
The only code I have added is:


09-02-2013 09:09 AM #17 JasperP (Member)

That's the reason why LP CTR reports no stats. You need to use both codes but they must not be on the same page.

One goes on the landing page and the other goes in your offer redirect page. These are 2 separate pages


09-02-2013 09:34 AM #18 cyberdelicstudio (Member)

I don't understand "offer redirect page"? I only use one LP which redirects to offer. How do I integrate a JS into this flow?

Thanks,

Jay,


09-02-2013 11:59 AM #19 caurmen (Administrator)

What you need to do is create a separate page from your main Unbounce landing page, which JUST contains the code Jasper posted. Then, you link from your Unbounce page to that separate page, which then redirects visitors to your offer.

You have to do this, because otherwise there's no practical way of tracking which visitors click out of your lander to your offer.

When people refer to a "redirect" here, they're not referring to a page which links to another page - they're referring to code which will automatically send a visitor to another page, after doing something - like, in this case, recording their visit.


09-02-2013 12:23 PM #20 redhill (Member)

Ad -> LP -> Redirect page -> Offer


09-02-2013 05:11 PM #21 JasperP (Member)

Adding to what caurmen said, you need this code because tracking202 appends the subid to your affiliate links using the javascript code.


09-03-2013 08:24 AM #22 cyberdelicstudio (Member)

Thanks guys. I will test this today and get back to you.


09-06-2013 12:00 PM #23 cyberdelicstudio (Member)

Guys, so I see that P202 generates the following JS redirect code. I understand that I need to add this to a separate page. My question is what code do I add in the yellow highlighted sections (see screenshot)?



Thanks,

Jay.


09-06-2013 12:21 PM #24 zeno (Administrator)

Just any tracking codes used by other tracking systems you are using. In your case, Unbounce. Unbounce might detect clickthroughs in a number of ways - a javascript even attached to your call-to-action via an "onclick" parameter, or perhaps some javascript code that you drop on the page that the CTA links to. In the latter case, you would put that code here above the yellow lines. If you don't have any code like this that you need to place then the PHP outgoing redirect will be faster and should therefore be used instead.


09-06-2013 02:33 PM #25 cyberdelicstudio (Member)

Quote Originally Posted by zeno View Post
Just any tracking codes used by other tracking systems you are using. In your case, Unbounce. Unbounce might detect clickthroughs in a number of ways - a javascript even attached to your call-to-action via an "onclick" parameter, or perhaps some javascript code that you drop on the page that the CTA links to. In the latter case, you would put that code here above the yellow lines. If you don't have any code like this that you need to place then the PHP outgoing redirect will be faster and should therefore be used instead.
Thanks Zeno. Here's the tracking JS script that Unbounce creates:



Do I add this code onto the same re-direct page?


09-06-2013 05:18 PM #26 JasperP (Member)

Quote Originally Posted by cyberdelicstudio View Post
Thanks Zeno. Here's the tracking JS script that Unbounce creates:



Do I add this code onto the same re-direct page?
I would not put that code on your redirect page. It looks like a pixel to track OFFER CONVERSIONS.

Make sure you test your links before you go live. You should be able to see the landing page clicks in prosper202


09-10-2013 03:23 PM #27 cyberdelicstudio (Member)

Thanks to everyone for chipping in. It was a great help.

This is how I implemented Unbounce in the end:

Ad -> LP CTA button -> Redirect page -> Offer


Home > Other Systems (CPVLab, iMobiTrax, P202, Track Revenue, Click, Google Analytics, etc.) > Normal Prosper202