Facebook Pixel Code - expected an assignment or function call and instead saw an expression | Community
Skip to main content
New Participant
January 11, 2024
Solved

Facebook Pixel Code - expected an assignment or function call and instead saw an expression

  • January 11, 2024
  • 1 reply
  • 2128 views

Hi, I'm using Launch, and I keep seeing the error message 'expected an assignment or function call and instead saw an expression' for my Facebook Pixel Code.

 

Keeps showing the error below in red:

ts):n.queue.push(arguments)_};

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

OK, custom code is easier for us to help with... but we will actually have to see the code... 

 

 

Now, that underscore looks odd, it might be a typo... there is no such character in the sample pixel code:

https://developers.facebook.com/docs/meta-pixel/get-started/

<!-- 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', '{your-pixel-id-goes-here}'); fbq('track', 'PageView'); </script>

 

Could it just be you accidentally typed in a random character into the FB code?

1 reply

Jennifer_Dungan
New Participant
January 11, 2024

Can you provide more details?

 

Are you using the FB Pixel extension? Or coding the pixel yourself via custom code?

 

I use custom code myself.. we may not have a lot of control with the extension but I will do my best to help you.

New Participant
January 11, 2024

Using Custom Code.

Pablo_Childe
New Participant
January 11, 2024

As Jen alluded to will need more of pixel code to help troubleshoot can you publish entire pixel code (then obfuscate and private elements).