• Hi There,

    A customer is running a landing page campaign therefore wants to use Google Adwords to record conversions. I need to install it in one page only though. All I can find are tutorials on how to install a universal code which goes on all the pages. Anyone know how to do it in just one?

    Theme: Divi
    Plugin Found and attempted but failed (or I misused): Javascript Per Page by Josh Kohlbach

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php
    function your_function() {
    echo ‘<p>This is inserted at the bottom of all pages</p>’;
    if ($target_page_id == get_queried_object_id())
    echo ‘<p>This is printed on only the target page</p>’;
    }
    add_action( ‘wp_footer’, ‘your_function’ );
    ?>

    Add this to your functions.php after replacing my code with your google embed code.

    it in one page only

    if you are inserting the code directly into one of the template files, like header.php or footer.php, try wrapping it into a conditional statement based on is_page() assuming you are targeting a static page…

    Thread Starter sandygraph

    (@sandygraph)

    Hi Michael,

    I’m a bit new to this and I checked out this: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page so now can you please tell me if the below is the correct format and is good to go to insert in header.php? I’m not sure I understand the concept of wrapping:

    <b:if cond=’data:blog.canonicalUrl == “https://houstonpropertymanagement.com/request-property-management-services-houston-packet/”‘/&gt;
    <!– Google Code for Request More Information Signing Conversion Page –> <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 1068725606;
    var google_conversion_language = "en";
    var google_conversion_format = "3";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "v9T0CLru-mUQ5urN_QM"; var google_conversion_value = 100.00; var google_conversion_currency = "USD"; var google_remarketing_only = false;
    /* ]]> */
    </script>
    <script type="text/javascript"
    src="//www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <div style="display:inline;">
    <img height="1" width="1" style="border-style:none;" alt=""
    src="//www.googleadservices.com/pagead/conversion/1068725606/?value=100.00&currency_code=USD&label=v9T0CLru-mUQ5urN_QM&guid=ON&script=0"/>
    </div>
    </noscript>
    </b:if>

    Thread Starter sandygraph

    (@sandygraph)

    Or would it be this:

    <?php

    if ( is_page(591) ) {

    <!– Google Code for Request More Information Signing Conversion Page –> <script type=”text/javascript”>
    /* <![CDATA[ */
    var google_conversion_id = 1068725606;
    var google_conversion_language = “en”;
    var google_conversion_format = “3”;
    var google_conversion_color = “ffffff”;
    var google_conversion_label = “v9T0CLru-mUQ5urN_QM”; var google_conversion_value = 100.00; var google_conversion_currency = “USD”; var google_remarketing_only = false;
    /* ]]> */
    </script>
    <script type=”text/javascript”
    src=”//www.googleadservices.com/pagead/conversion.js”>
    </script>
    <noscript>
    <div style=”display:inline;”>
    <img height=”1″ width=”1″ style=”border-style:none;” alt=””
    src=”//www.googleadservices.com/pagead/conversion/1068725606/?value=100.00&currency_code=USD&label=v9T0CLru-mUQ5urN_QM&guid=ON&script=0″/>
    </div>
    </noscript>

    }

    ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Google Adwords in One Page’ is closed to new replies.