Link to home
Start Free TrialLog in
Avatar of giancarlo barraza
giancarlo barraza

asked on

conversion pixel not firing

My php code is shown below........    but the facebook conversion pixel is not firing.....  the page is redirecting...

do you have a better way to redirect this so the first part of code fires?  


<!-- Facebook Conversion Code for Survival Lead Machine -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6015483610963', {'value':'0.01','currency':'INR'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6015483610963&cd[value]=0.01&amp;cd[currency]=INR&amp;noscript=1" /></noscript>



<script>


window.location = "http://kahunanow.com/cpv/base3.php?adsub=1";
</script>
Avatar of Gary
Gary
Flag of Ireland image

Do you mean the image? It won't when you have js enabled - not sure what you mean.
Avatar of giancarlo barraza
giancarlo barraza

ASKER

this whole page is in page.php   so when something gives me their email  i redirect them to this page so i can track certain things   then redirect to the offer......

somehow the first code is not firing before it redirects to http://kahunanow.com/cpv/base3.php?adsub=1  (see code below)        do you see any problem with the structure ?

<!-- Facebook Conversion Code for Survival Lead Machine -->
<script>(function() {
var _fbq = window._fbq || (window._fbq = []);
if (!_fbq.loaded) {
var fbds = document.createElement('script');
fbds.async = true;
fbds.src = '//connect.facebook.net/en_US/fbds.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(fbds, s);
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6015483610963', {'value':'0.01','currency':'INR'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6015483610963&cd[value]=0.01&amp;cd[currency]=INR&amp;noscript=1" /></noscript>
Are you talking about the Facebook code not firing?
That code will take time to load by which time (about a nano second later) you are redirecting the page.

Try changing
fbds.async = true;

to
fbds.async = false;

That should halt the page until it is finished, though I am not familiar with the code.
ok how can i get a redirect script that loads for a few seconds so it lets the code run?
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial