Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #251380

    Hi there,

    How do I add code to a specific page on my website? I’ve tried adding a text box and going to the “text” tab and inserting the code there, but when I open the page source, it inserts <br> and </p> into the code which is causing it not to work? Is there a way to insert the code to a page directly on the source and not using the default editor or avia layout builder?

    Basically, I’d like to add the Google Adwords Conversion Tracking code. But when I go to the source it adds bits of code to it. Also the form is a Woofoo Form.

    How do I fix this?

    Mark

    #251668

    Hey Mark!

    You can add following code to Functions.php file in Appearance > Editor

    if ( is_page( 1122 )) {
    	echo 'your code goes here';
    }

    1122 is a page id, you can change it to match your pages id. You can right click on Chrome or Firefox to inspect elements to find page ID’s http://i.imgur.com/HyPTCRg.jpg

    Best regards,
    Yigit

    #267027

    I have the same request. Followed your instructions and my analytics still cant detect the conversion pixel. Is there a specific place in functions.php to add this tracking code?

    Mike
    FWLA

    #267039

    Hey!

    At the very end, something like this will do it:

    function custom_code(){
            if ( is_page( 1122 )) {
    	?>
    	CODE HERE
    	<?php
            }
    }
    add_action('wp_footer', 'custom_code');

    Regards,
    Josue

    #267044

    Josue,

    Below is what I added. Please tell me if that’s correct.

    Thanks

    Mike

    ————————————————————
    Added below the very last line of code in functions.php
    ———————————————————————–
    function custom_code(){
    if ( is_page( 24 )) {
    ?>
    <!– secure image tag –>
    <img src=”https://admanager.namidirect.com/conversion/qQSDZhZyj7XRchfchRa?image=true&#8221;
    height=”1″ width=”1″ style=”visibility:hidden;” />
    <?php
    }
    }
    add_action(‘wp_footer’, ‘custom_code’);

    #267048

    Yes, that should work, if it doesn’t post a link to page 24.

    Cheers!
    Josue

    • This reply was modified 10 years, 6 months ago by Josue.
    #267051

    Its the last step in a 4 step form via contact form 7.

    http://relief.vantageacceptance.com/step-four/

    Mike

    #267054

    Hi Mike,

    It’s working:

    Regards,
    Josue

    #343020

    Please help.

    I followed these instructions and put in my pixel code for my Facebook ad campaign. Now my site is completly blank. I cannot log in on the admin side, nor can I navigate to any part of the page.
    PLEASE HELP!!!! Thank you,

    Elizabeth

    if ( is_page( 3556 )) {
    echo ‘<!– Facebook Conversion Code forhttp://captix.com/3556-2/ –>
    <script>(function() {
    var _fbq = window._fbq || (window._fbq = []);
    if (!_fbq.loaded) {
    var fbds = document.createElement(‘script’);
    fbds.async = true;
    fbds.src = ‘//connect.facebook.net/en_US/fbds.js’;
    var s = document.getElementsByTagName(‘script’)[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
    }
    })();
    window._fbq = window._fbq || [];
    window._fbq.push([‘track’, ‘6018719701150’, {‘value’:’0.01′,’currency’:’USD’}]);
    </script>
    <noscript></noscript>
    ‘;
    }

    #343056

    Hi Elizabeth,

    Can you please create me an temporary FTP account? post it here as a private reply.

    Regards,
    Josue

    #343423
    This reply has been marked as private.
    #343520

    Hi!

    This normally happens because of a typo or an error in the code, can you share us the full code of your theme / child theme functions.php in a Gist or Pastebin?

    Regards,
    Josue

    #346187
    This reply has been marked as private.
    #346262

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #346777
    This reply has been marked as private.
    #346974

    Hey Elizabeth!

    It’s done, check the 3556 (id) Page source.

    Best regards,
    Josue

    #347442
    This reply has been marked as private.
Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘Add code to a specific page (Google Adwords Conversion Tracking)’ is closed to new replies.