Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #813833

    Hi,

    Please help me. How do I insert Facebook pixel tracking code on my simple enfold buttons at sales page?

    Facebook support: https://developers.facebook.com/docs/marketing-api/audiences-api/pixel#inpageevents

    Thank you for your support!

    Best regards,
    Daniella

    #813854

    Hey Daniella,

    Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and then edit your button element and give it a custom CSS class (“my-custom-button” in example below) and then add following code to Functions.php file in Appearance > Editor

    function av_custom_fb_pixel(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery(".my-custom-button a").removeAttr("href");
    jQuery(".my-custom-button a").attr("onClick","fbq('track', 'Purchase');");
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'av_custom_fb_pixel');

    Best regards,
    Yigit

    #814330

    Hi Yigit,

    Thank you for your reply. I did everything.
    One problem is now: not working the link on the button.

    What did I do wrong?
    Do I have to enter the link in the code (.removeAttr(“href”)??

    Big Thanks,
    Daniella

    #814491

    Hi Daniella,

    In example code there was no Href attribute, therefore i removed it. If you will need to use href attribute, please change the code to following one

    function av_custom_fb_pixel(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery(".my-custom-button a").attr("onClick","fbq('track', 'Purchase');");
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'av_custom_fb_pixel');

    Best regards,
    Yigit

    #814879

    Thank you Yigit, it’s working. :))

    Have a nice day!
    Daniella

    #814901

    Hi Daniella,

    Glad that Yigit helped you. Thanks for using Enfold :)

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Insert Facebook tracking on any button’ is closed to new replies.