Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1372685
    stirlingaustin
    Participant

    Hello

    How can I insert the google conversion code into a page without losing the cornerstone format?

    After visitor has filled out contact form

    1, https://www.stirlingaustin.com/contact/

    it redirects to a thank you page

    2, https://www.stirlingaustin.com/thank-you-for-your-enquiry/

    this thanks you page is where the code needs to be to register the conversion

    thanks

    Stirling

    #1373137
    Lely
    Moderator

    Hi Stirling,

    I can see that you have a child theme, please add the following code in your child theme’s functions.php file

    function_adwords_conversion(){
       if ( is_page('thank-you-for-your-enquiry') ) : ?>
    	<!– Add Google Conversion Code here –>
    <?php endif;
    }
    add_action('x_before_site_begin', 'function_adwords_conversion');

    Hope this helps.

    #1373493
    stirlingaustin
    Participant

    Hi there

    thanks, I get this error

    Parse error: syntax error, unexpected ‘{‘ in /var/sites/s/stirlingaustin.com/public_html/wp-content/themes/x-child/functions.php on line 26

    #1373509
    stirlingaustin
    Participant

    this has actually brought my site down..I cant get in

    #1373532
    stirlingaustin
    Participant

    URGENT PLEASE THEME NOT FUNCTIONING CORRECTLY NOW

    okay my ISP has retored a back up from yesterday, however the sirte is now showing this error: it looks like the code you gave me broke the theme

    this is across the header.

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘function_adwords_conversion’ not found or invalid function name in /var/sites/s/stirlingaustin.com/public_html/wp-includes/class-wp-hook.php on line 298

    I will give logins in next message privately

    #1373533
    stirlingaustin
    Participant
    This reply has been marked as private.
    #1373773
    stirlingaustin
    Participant

    OK I have managed to fix this, the error message no monger appears.

    Please could you let me know if there is another way to insert the code onto the thank you page without this issue.

    #1374178
    Rad
    Moderator

    Hi there,

    Please change it to this

    function adwords_conversion(){
       if ( is_page('thank-you-for-your-enquiry') ) : ?>
    	<!– Add Google Conversion Code here –>
    <?php endif;
    }
    add_action('x_before_site_begin', 'adwords_conversion');

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1372685 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>