Topic-icon Errors when using Pixel ID

Active Subscriptions:

None
4 years 2 months ago #66063 by picht
Hi

When i enter a pixel ID in the Facebook Pixel Id field, then on the frontend a lot of errors are shown.
See image.

regards
Jacob
File Attachment:
The topic has been locked.
Support Specialist
4 years 2 months ago #66066 by mel
Replied by mel on topic Errors when using Pixel ID
I'm having a really hard time reading the text in that screenshot. Can you copy the text to this thread?

Also, have you created your Pixel Code in Facebook's Event Manager ? What are the settings that you used when creating it?

-Melissa
The topic has been locked.
Active Subscriptions:

None
4 years 2 months ago #66067 by picht
Replied by picht on topic Errors when using Pixel ID
This is the error message:
jQuery(window).load(function() { var slideout = new Slideout({ 'panel': document.getElementById('body_panel'), 'menu': document.getElementById('slideout'), 'padding': -256, 'tolerance': 70 }); document.querySelector('.slideout-toggle').addEventListener('click', function() { slideout.toggle(); }); // jQuery jQuery('.menu li:not(.parent) a').on('click', function() { slideout.close(); }); jQuery('.slideout-menu li.parent > a').on('click', function(){ jQuery(this).removeAttr('href'); var element = jQuery(this).parent('li'); if (element.hasClass('open')) { element.removeClass('open'); element.find('li').removeClass('open'); element.find('ul').slideUp(); } else { element.addClass('open'); element.children('ul').slideDown(); element.siblings('li').children('ul').slideUp(); element.siblings('li').removeClass('open'); element.siblings('li').find('li').removeClass('open'); element.siblings('li').find('ul').slideUp(); } }); }); Modernizr.load({ test: Modernizr.touch, yep : "", nope: "/templates/j51_kaylee/js/jquery.visible.js" }); jQuery(window).load(function(){ jQuery(".header_row").sticky({ topSpacing: 0 }); });

I have recieved the Pixel code from the customer and have to insert it.
The error appears also if i just type in "123" in the Pixel ID field

/Picht
The topic has been locked.
Support Specialist
4 years 2 months ago #66069 by mel
Replied by mel on topic Errors when using Pixel ID
Can you provide a URL where I can see this in action? I'd like to look at the source on the page to see how the code's inserted.
The topic has been locked.
Active Subscriptions:

None
4 years 2 months ago #66070 by picht
Replied by picht on topic Errors when using Pixel ID
You can see it on this URL: www.letridning.dk
The Pixel ID has been set to 123456789

/Picht
The topic has been locked.
Active Subscriptions:

None
4 years 2 months ago - 4 years 2 months ago #66071 by picht
Replied by picht on topic Errors when using Pixel ID
The source code for the page around the Facebook pixel looks like this:
<script src="/templates/j51_kaylee/js/jquery.sticky.js"></script>
	<script src="/templates/j51_kaylee/js/scripts.js"></script>
	<script src="/media/system/js/core.js?716666a25ccee088c55b0e6ca4d2ccec"></script>
	<script>
jQuery(window).on('load',  function() {
				new JCaption('img.caption');
			});
            <!-- 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', '123456789');
              fbq('track', 'PageView');
            </script>
            <noscript><img height="1" width="1" style="display:none"
              src="https://www.facebook.com/tr?id=123456789&ev=PageView&noscript=1"
                  /></noscript>
            <!-- End Facebook Pixel Code -->

        jQuery(window).load(function() {

            var slideout = new Slideout({
                'panel': document.getElementById('body_panel'),
                'menu': document.getElementById('slideout'),
                'padding': -256,
                'tolerance': 70
            });

            document.querySelector('.slideout-toggle').addEventListener('click', function() {
                slideout.toggle();
            });

            // jQuery
            jQuery('.menu li:not(.parent) a').on('click', function() {
                slideout.close();
            });

            jQuery('.slideout-menu li.parent > a').on('click', function(){
                jQuery(this).removeAttr('href');
                var element = jQuery(this).parent('li');
                if (element.hasClass('open')) {
                    element.removeClass('open');
                    element.find('li').removeClass('open');
                    element.find('ul').slideUp();
                }
                else {
                    element.addClass('open');
                    element.children('ul').slideDown();
                    element.siblings('li').children('ul').slideUp();
                    element.siblings('li').removeClass('open');
                    element.siblings('li').find('li').removeClass('open');
                    element.siblings('li').find('ul').slideUp();
                }
            });
        });
    

    Modernizr.load({  
      test: Modernizr.touch,  
      yep : "", 
      nope: "/templates/j51_kaylee/js/jquery.visible.js"  
    });


        jQuery(window).load(function(){
            jQuery(".header_row").sticky({ 
                topSpacing: 0
            });
        });
    
	</script>
	<script type="text/javascript">jfbc.login.logout_facebook = false;
jfbc.base = 'https://www.letridning.dk/';
jfbc.return_url = 'Lw==';
jfbc.login.scope = 'email';
jfbc.login.show_modal = '1';
jfbc.login.use_popup = true;
jfbc.login.auto = '0';
jfbc.login.logged_in = false;
jfbc.token = '_removed_';
jfbc.init();
</script>

I have removed the Pixel again to remove the error on the live page

/Picht
Last edit: 4 years 2 months ago by picht.
The topic has been locked.
Support Specialist
4 years 2 months ago #66074 by mel
Replied by mel on topic Errors when using Pixel ID
Thanks for including the code from the page. It's a bug on our part.

In /components/com_jfbconnect/libraries/provider/facebook.php at line 309, replace
$doc->addScriptDeclaration($pixelCode);
with
$doc->addCustomTag($pixelCode);

-Melissa
The topic has been locked.
Active Subscriptions:

None
4 years 2 months ago #66090 by picht
Replied by picht on topic Errors when using Pixel ID
Thanks. It works :cool:
The topic has been locked.
Support Specialist
4 years 2 months ago #66094 by alzander
Replied by alzander on topic Errors when using Pixel ID
Thanks for confirming. We'll be releasing an updated version of JFBConnect with this fix shortly as well so you shouldn't encounter it again.

Alex
The topic has been locked.