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('sc ript');
fbds.async = true;
fbds.src = '//connect.facebook.net/en _US/fbds.j s';
var s = document.getElementsByTagN ame('scrip t')[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&cd[c urrency]=I NR&nos cript=1" /></noscript>
<script>
window.location = "http://kahunanow.com/cpv/base3.php?adsub=1";
</script>
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('sc
fbds.async = true;
fbds.src = '//connect.facebook.net/en
var s = document.getElementsByTagN
s.parentNode.insertBefore(
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track',
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6015483610963&cd[value]=0.01&cd[c
<script>
window.location = "http://kahunanow.com/cpv/base3.php?adsub=1";
</script>
Do you mean the image? It won't when you have js enabled - not sure what you mean.
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('sc ript');
fbds.async = true;
fbds.src = '//connect.facebook.net/en _US/fbds.j s';
var s = document.getElementsByTagN ame('scrip t')[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&cd[c urrency]=I NR&nos cript=1" /></noscript>
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('sc
fbds.async = true;
fbds.src = '//connect.facebook.net/en
var s = document.getElementsByTagN
s.parentNode.insertBefore(
_fbq.loaded = true;
}
})();
window._fbq = window._fbq || [];
window._fbq.push(['track',
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6015483610963&cd[value]=0.01&cd[c
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.
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.
ASKER
ok how can i get a redirect script that loads for a few seconds so it lets the code run?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.