Archived topic
Pixel de facebook
10 replies · Started by jmpefe78gmail-com on May 4, 2020
Hola, cuando añado el script del pixel de Facebook en el hook me generar errores al ver la herramienta de w3 validator.
Concretamente muestra errores relacionados con el logo. Si quito el código y lo añado en Google Tag manager no sucede ese error.
Quiero meterlo el hook pero no quiero tener esos errores y no sé porque el pixel de facebook produce errores en el logo.
Cual es el problema?
Ahora lo tengo metido en en google tag manager (no quiero tener esos errores)
Gracias
Hello, when I add the Facebook pixel script in the hook I get errors when I see the w3 validator tool.
Specifically, it shows errors related to the logo. If I remove the code and add it in Google Tag manager that error does not happen.
I want to hook it but I don't want to have those errors and I don't know why the facebook pixel produces errors in the logo.
What is the problem?
Now I have it in google tag manager (I don't want to have those errors)
Thank you
Hi there,
which Hook are you using to add your Pixel ?
Lo metí en hook dentro de wp_head para todo el sitio
Can you share the code here ?
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1508982275809635');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1508982275809635&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
Can you add the Pixel using the Hook element - so i can take a closer look?
Ya está agregado. Como podrás ver se han generado errores al pasar el validador w3
¿Cómo se puede arreglar? Si pones el pixel se generan muchos errores en el logo y favicon y si quitas el pixel todo ok
Hi there,
It looks like you've added the <noscript><img... /></noscript HTML into wp_head as well. That code should be added in the wp_open_body hook.
Ok perfecto. Ahora ok pero esa parte no tiene que ir en el head como dice Facebook? Gracias
HTML like <img> shouldn't go in the <head> section. If HTML exists in there it won't pass validation.