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

    Hey guys
    This may be elementary, but how do I add code like FaceBook Pixel and Google Remarketing to the header and footer where I am not redoing it every time I update WordPress or the site’s theme? I am trying to minimize use of plugins. But is that is my only option, s be it.

    I am guessing that there’s maybe a way to code it within the theme-functions (function.php) file?

    Thanks!
    Justin

    #655513

    Hey Justin,

    For code that should go in the header you should be able to use the Analytics field in the backend. The code in the footer we will need to add through a function, could you post the code you want to add and where it should go please?

    Best regards,
    Rikard

    #763051

    Hi Rikard,

    I too would really like to minimize my use of plugins. I just updated my Enfold Child Theme and lost the footer changes I’d made to include my Google Remarketing Tag. Can I get some help with this as well?

    After I composed this post yesterday, I tried adding it to the Enfold Child Theme’s Google , pasting it under the Google Analytics Script. According to the Google Tag Assistant it’s working! Hurrah.

    Is this the “correct method” for adding both Google Analytics and Google Remarketing to Enfold?

    Thanks!
    Aaron

    • This reply was modified 7 years, 8 months ago by ConnectedEvent. Reason: I was able to fix the issue I believe. Used Enfold Child Theme and Google Analytics area
    #763474

    Hi,

    Please try the following in your child theme’s functions.php file:

    function add_google_remarketing(){ ?>
    <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = 863976582;
    var google_custom_params = window.google_tag_params;
    var google_remarketing_only = true;
    /* ]]> */
    </script>
    <script type=”text/javascript” src=”//www.googleadservices.com/pagead/conversion.js”>
    </script>
    <noscript>
    <div style=”display:inline;”>
    
    </div>
    </noscript>
    <?php }
    add_action('wp_footer', 'add_google_remarketing');

    Best regards,
    Rikard

    #805732

    and How do I add Facebook remarketing to my child theme?

    #806010

    Hi Dee007,

    What code do you want to use and where is it supposed to go?

    Best regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.