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

How to execute multiple javascripts before Prosper202 redirect? (11)


02-17-2012 02:07 PM #1 vw202 (Member)
How to execute multiple javascripts before Prosper202 redirect?

Hi,

I have setup a simple landing page using prosper202 to whom I send PPC traffic.

------------------------------------

The Inbound Javascript Landing Page Code that I have installed looks like:

<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=461&202cb='+cbr202+'" type="text/javascript"></scr' + 'ipt>'); </script>

Now, the banner on this page leads to the page containing the Outbound Javascript Redirect Code:

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

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>

--------------------------------------------

Now, if a visitor clicks on the landing page banner, it goes to the page containing outbound javascript code , i.e., temp-goto page and then finally is redirected to the vendor site via the affiliate link.

Both of the above codes have been placed just before the closing of the </body> on respective pages. It works perfectly!

However,, I have inserted a Google conversion code on my temp-goto page before the outbound javascript code , to log conversion, but it does not log a conversion. However the redirect is still happening.

How do I solve this?

Thanks,
Vik


02-17-2012 08:16 PM #2 Mr Baffoe (Veteran Member)

You can trigger a google event/conversion on click

http://code.google.com/apis/analytic...ckerGuide.html


02-18-2012 06:29 PM #3 vw202 (Member)

Thanks for the reply Mr. Baffoe.

I'm already tracking click events and goals through analytics. However, I want to execute conversion codes & remarketing tags before the redirect happens.

In the P202 setup -> Step#6 (Get LP Code), I guess the reason that you guys have given outbound javascript redirect code - (Option 2) in addition to the outbound php redirect code - (Option 1) is for it to be able to execute multiple javascripts before the redirect which is not possible with a simple php redirect.

Please help me out! As you know, there is nothing worse than losing visitors, whether they convert or not!

Thanks,
Vik


02-18-2012 07:38 PM #4 syfy (Member)

what are you trying to track? the only conversion tracking that can be done in GA is: Goals and ecommerce conversions.

Sounds like you already got goals being tracked(you can define and track your funnel already). Are you getting a goal conversion rate now?


02-18-2012 07:54 PM #5 vw202 (Member)

Hi Syfy,

I have already setup click events and goals using google analytics to track outgoing visitors to vendor site and that is working perfectly fine. I have all the LP CTR's and converted goal stats.

What I want now is to execute the javascript - (conversion and remarketing codes) when visitors click on my outbound links which are handled by P202 outbound redirects.

Basically I have added these conversion codes to the (goto) page just before the outbound P202 code which is placed before the closing of </body> tag. The P202 redirects are working perfectly fine, but the conversion codes are NOT recording any visitors or conversions


03-03-2012 02:32 PM #6 vw202 (Member)

Anybody want to help!!!

plzzzzz.....


03-03-2012 05:48 PM #7 Mr Baffoe (Veteran Member)

What does your page look like at the moment?


03-03-2012 07:06 PM #8 vw202 (Member)

Mr. Baffoe,

Below is the code of my outgoing goto page. All codes except the Google Conversion Code work fine!

-------------------------


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!-- Start of Google Analytics Code -->

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2xxxx7-3']);
_gaq.push(['_setDomainName', '.xxxx.com']);
_gaq.push(['_setCampNameKey', 'c1']);
_gaq.push(['_setCampSourceKey', 'c2']);
_gaq.push(['_setCampMediumKey', 'c3']);
_gaq.push(['_setCampTermKey', 't202kw']);
_gaq.push(['_setCampContentKey', 'c4']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

<!-- End of Google Analytics Code -->

</head>

<body>

<!-- Google Conversion Code -->

<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 95086XXXX;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "GwMqCIOLuQMQ1fOzxQM";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/950860245/?label=GwMqCIOLuQMQ1fOzxQM&amp;guid=ON&amp;script= 0"/>
</div>
</noscript>

<!-- End of Google Conversion Code -->

<!-- NOW THE TRACKING202 REDIRECTS OUT -->

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

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>

<!-- END OF TRACKING202 REDIRECTS OUT -->

</body>

</html>

-----------------------------------------------------------------

What I'm I doing wrong?


03-06-2012 07:44 PM #9 vw202 (Member)

Mr. Baffoe...plz help!


03-06-2012 08:52 PM #10 zeno (Administrator)

I thought all the google analytics code is now asynchronous, i.e. the browser doesn't wait for the javascript to parse before loading what follows it in the html code. So wouldn't having it on a redirect page be a waste of time, since the redirect is going to be trying to redirect the visitor at the same time as the analytics code is trying to track them...

It would be better to put an onclick event on your banner so that google analytics tracks the fact that someone clicked on the banner before they get sent anywhere. e.g.

HTML Code:
<a href="http://whateverurl.com/redirect.php" target="_blank" onClick="_gaq.push(['_trackEvent', 'CTA', 'Something', 'Somethingelse']);"><img src="http://bannerurllocation.com/banner.gif" alt="Click me" width="XXX" height="YYY" longdesc="Click me" /></a>


03-07-2012 05:23 AM #11 vw202 (Member)

Hi Zeno,

My Google analytics code on the redirect page is working perfectly fine and yes I'm already doing event tracking on the predecessing page. My problem is that in this outbound redirect page (the code i have given above), the google conversion and remarketing tags does not seem to fire.

Do you have an idea on how to set it right?

Thanks,
Vik


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