admin管理员组

文章数量:1297075

I've been searching for a week now and didn't find any solution for this warning, the warning is:

WARNINGS

" We detected event code but the pixel has not activated for this event, so no information was sent to Facebook. This could be due to an error in the code, but could also occur if the pixel fires on a dynamic event such as a button click.Learn more "

And pixel code is: fbq('track', 'PageView');

My code:

 !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','.js');    
  fbq('consent', 'revoke');   
  fbq('init', /* PIXEL_ID */);
  fbq('track', 'PageView');   
  fbq('consent', 'grant');  

Please help me to understand what exactly the problem could be and possible solution for it.

I've been searching for a week now and didn't find any solution for this warning, the warning is:

WARNINGS

" We detected event code but the pixel has not activated for this event, so no information was sent to Facebook. This could be due to an error in the code, but could also occur if the pixel fires on a dynamic event such as a button click.Learn more "

And pixel code is: fbq('track', 'PageView');

My code:

 !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/en_US/fbevents.js');    
  fbq('consent', 'revoke');   
  fbq('init', /* PIXEL_ID */);
  fbq('track', 'PageView');   
  fbq('consent', 'grant');  

Please help me to understand what exactly the problem could be and possible solution for it.

Share edited Mar 6, 2019 at 9:21 user3307073 asked Mar 6, 2019 at 3:33 Prasad SuparePrasad Supare 481 silver badge8 bronze badges 6
  • how do you implement your Facebook Pixel in your HTML? – yqlim Commented Mar 6, 2019 at 3:37
  • i've placed the code in the head tag – Prasad Supare Commented Mar 6, 2019 at 3:41
  • Show your code snippet. We can understand the context better if we can see something concrete. Based on the error message it is very likely that something in your code did not run, or you've placed fbq('track', 'PageView') incorrectly. – yqlim Commented Mar 6, 2019 at 3:44
  • Sorry for that.. i've edited the question with the code now – Prasad Supare Commented Mar 6, 2019 at 3:49
  • 1 You can try Pixel Helper to debug. – yqlim Commented Mar 6, 2019 at 3:53
 |  Show 1 more ment

1 Answer 1

Reset to default 11

Try to disable AdBlock (this is what works for me)

With active AdBlock:

With deactivated AdBlock:

本文标签: javascriptHow to get rid of this Facebook Pixel WarningStack Overflow