Skip Navigation

[Resolved] Install FB script to site

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to add a script to their site.
Solution:

JS scripts can be added to our Layouts JS editor and they will be loaded globally.

The editor can be found in Toolset -> Layouts CSS and JS editor

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 12 replies, has 2 voices.

Last updated by Shane 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#924158
Screen Shot 2018-07-12 at 10.21.59 PM.png

Dear Sir/Madam,

I need to install a FB script to my site, I add script to Layouts CSS and JS Editor >> JavaScript Editor but doesn't work. I cannot find the script content via inspector.

Please advise whether I need to include the <script>...</script> and <noscript>...</noscript> tag in box.

#924170

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

Thank you for contacting our support forum.

Since this is a script editor then the <script> tags are not needed.

Thanks,
Shane

#924190

Dear Shane,

Thanks for your reply, how can I handle the <noscript>...</noscript>?

Best regards

Kelvin.

#924211

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

Since this is a JS editor then you will need to add the noscript directly to your theme file.

Thanks,
Shane

#924230

Dear Shane,

I removed the <script>...</script> tag, only put below code in the box but cannot find it from web inspector

!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',
'<em><u>hidden link</u></em>');
 fbq('init', '227517591179707'); 
fbq('track', 'PageView');
#924291

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

Does the page that you are looking on load a layout ?

As far as I know this only works on pages that load layouts.

Please let me know

Thanks,
Shane

#924926
Screen Shot 2018-07-14 at 7.55.50 AM.png

Dear Shane,

Yes, the page is loaded with Layout. You can visit the homepage from hidden link and search the keywords from the inspector, nothing we can find. I attached the screenshot for your reference.

Best regards,

Kelvin.

#948390

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

Would you mind providing me with access so that I can take a look at this for you because it should get loaded onto the page.

Thanks,
Shane

#951427

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

Not sure why your script is not working but when I added a console.log('test') to the layouts js file it works fine.

What you can do is to add the script directly to your footer.php file wrapping it in the script tags.

Thanks,
Shane

#951430

Dear Shane,

Will you escalate this issue to 2nd tier support as I think it is common to add the 3rd party script to a site for further monitoring?

Best regards,

Kelvin.

#952363

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kelvin,

For this one I can't particularly identify an issue because I believe the issue is with this script. I believe its just an issue with this particular code.

Would you mind letting me know where this code came from ?

Thanks,
Shane

#952896

Dear Shane

This is the code I got from Facebook for Setting up Facebook Pixel. If there is the issue from code, it should get an error from the console but won't be loaded.

Best regards,

Kelvin.

#953865

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-07-23 at 3.07.29 PM.png

Hi Kelvin,

The code actually works.

It adds this to your site . See Screenshot

Thanks,
Shane