Title: Help with js implementation
Last modified: July 31, 2022

---

# Help with js implementation

 *  Resolved [Tony Franco](https://wordpress.org/support/users/tony-franco/)
 * (@tony-franco)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-js-implementation-2/)
 * Dear Sirs,
 * Thank you by this plugin!
 * Please, is it possible to insert a tag at HTML? I want to insert my facebook 
   pixel just at posts of a specific category. I have created an if condition at
   js, but didn´t have sucess… could you take a look?
 * <script>
 * if(document.querySelector(‘.post-cats’).innerHTML.includes(‘[Xxxxxxx](https://www.website.com/category/xxxx/)‘)){
 *  var pixelDec = document.createElement(‘div’);
    pixelDec.innerHTML = [‘<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&#8217](https://connect.facebook.net/en_US/fbevents.js&#8217););
   fbq(‘init’, ‘00000000000000000’); fbq(‘track’, ‘PageView’); </script> <noscript
   > <img height=‘1’ width=‘1’ style=‘display:none’ src=‘https://www.facebook.com/
   tr?id=00000000000000000&ev=PageView&noscript=1’/> </noscript> ‘]; document.body.
   appendChild(pixelDec);
 * }
 * </script>
 * Could have a solution here at this plugin?
 * Thanks and Regards,
    Tony

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-js-implementation-2/#post-15878174)
 * Hello,
 * you can insert code at HTML elements:
    [https://adinserter.pro/documentation/insertion-before-inside-after-html-element](https://adinserter.pro/documentation/insertion-before-inside-after-html-element)
 * You can also define conditions regarding categories:
    [https://adinserter.pro/documentation/black-and-white-lists](https://adinserter.pro/documentation/black-and-white-lists)
 *  Thread Starter [Tony Franco](https://wordpress.org/support/users/tony-franco/)
 * (@tony-franco)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-js-implementation-2/#post-15878281)
 * Hi [@spacetime](https://wordpress.org/support/users/spacetime/)
 * Thank you very much by return and solution!
 * It´s working fine!
 * Regards,
    Tony
 *  Plugin Author [Spacetime](https://wordpress.org/support/users/spacetime/)
 * (@spacetime)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-js-implementation-2/#post-15878286)
 * 🙂
 * > It´s working fine!
 * Please say it here:
    [https://wordpress.org/support/plugin/ad-inserter/reviews/#new-post](https://wordpress.org/support/plugin/ad-inserter/reviews/#new-post)
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Help with js implementation’ is closed to new replies.

 * ![](https://ps.w.org/ad-inserter/assets/icon-256x256.jpg?rev=1502039)
 * [Ad Inserter - Ad Manager & AdSense Ads](https://wordpress.org/plugins/ad-inserter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-inserter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-inserter/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-inserter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-inserter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-inserter/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Spacetime](https://wordpress.org/support/users/spacetime/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/help-with-js-implementation-2/#post-15878286)
 * Status: resolved