• Resolved cyaniccypher

    (@cyaniccypher)


    Hello,

    I am trying to add google ads tracking code to my website thank you page to be able to put out the total order amount. I have tried the two codes below and neither one is working what do I need to fix?

    <?php
       $order_id = $_GET['order'];
       $order = new WC_Order( $order_id );
       $total = $order->get_total();
    ?>
    
    script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 10809469596;
    var google_conversion_label = "K1IUCPP4mIQDEJzVraIo";
    var google_conversion_value = <?php echo $total; ?>;
    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/10809469596/?value=<?php echo $total; ?>&currency_code=USD&label=K1IUCPP4mIQDEJzVraIo&guid=ON&script=0″>
    </div>
    </noscript>
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 10809469596;
    var google_conversion_label = "K1IUCPP4mIQDEJzVraIo";
    var google_conversion_value = <?php echo $order->get_total(); ?>;
    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/10809469596/?value=<?php echo $order->get_total(); ?>&currency_code=USD&label=K1IUCPP4mIQDEJzVraIo&guid=ON&script=0">
    </div>
    </noscript>

    Sample thank you page here:
    https://orchardaudio.com/thank_you/?order=1726

    Thanks;
    Leo

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter cyaniccypher

    (@cyaniccypher)

    Here is the site info as requested for all troubleshooting:

    
    ### wp-core ###
    
    version: 5.9.3
    site_language: en_US
    user_language: en_US
    timezone: America/New_York
    permalink: /%year%/%monthnum%/%day%/%postname%/
    https_status: true
    multisite: false
    user_registration: 0
    blog_public: 1
    default_comment_status: open
    environment_type: production
    user_count: 1
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /var/www
    wordpress_size: 343.83 MB (360529722 bytes)
    uploads_path: /var/www/wp-content/uploads
    uploads_size: 161.44 MB (169283037 bytes)
    themes_path: /var/www/wp-content/themes
    themes_size: 22.75 MB (23858898 bytes)
    plugins_path: /var/www/wp-content/plugins
    plugins_size: 171.74 MB (180087253 bytes)
    database_size: 35.28 MB (36995072 bytes)
    total_size: 735.05 MB (770753982 bytes)
    
    ### wp-dropins (2) ###
    
    advanced-cache.php: true
    db-error.php: true
    
    ### wp-active-theme ###
    
    name: Astra (astra)
    version: 3.8.2
    author: Brainstorm Force
    author_website: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
    parent_theme: none
    theme_features: core-block-patterns, astra_hooks, widgets-block-editor, align-wide, automatic-feed-links, title-tag, post-thumbnails, html5, post-formats, custom-logo, customize-selective-refresh-widgets, editor-style, woocommerce, rank-math-breadcrumbs, amp, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, widgets, menus
    theme_path: /var/www/wp-content/themes/astra
    auto_update: Enabled
    
    ### wp-mu-plugins (1) ###
    
    System Plugin: author: (undefined), version: 4.25.1
    
    ### wp-plugins-active (34) ###
    
    All 404 Redirect to Homepage: version: 3.6, author: wp-buy, Auto-updates enabled
    Astra Bulk Edit: version: 1.2.6, author: Brainstorm Force, Auto-updates enabled
    Astra Widgets: version: 1.2.11, author: Brainstorm Force, Auto-updates enabled
    Chaty: version: 2.9.2, author: Premio, Auto-updates enabled
    CoBlocks: version: 2.24.0, author: GoDaddy, Auto-updates enabled
    EWWW Image Optimizer: version: 6.5.2, author: Exactly WWW, Auto-updates enabled
    Facebook for WooCommerce: version: 2.6.15, author: Facebook, Auto-updates enabled
    GoDaddy Email Marketing: version: 1.4.3, author: GoDaddy, Auto-updates enabled
    Google Ads & Google Shopping for WooCommerce by StoreYa: version: 2.2, author: StoreYa, Auto-updates disabled
    Pinterest for WooCommerce: version: 1.0.13, author: WooCommerce, Auto-updates enabled
    PW WooCommerce Gift Cards: version: 1.208, author: Pimwick, LLC, Auto-updates enabled
    Rearrange Woocommerce Products: version: 4.0.9, author: Aslam Doctor, Auto-updates enabled
    Site Kit by Google: version: 1.75.0, author: Google, Auto-updates enabled
    Sucuri Security - Auditing, Malware Scanner and Hardening: version: 1.8.30, author: Sucuri Inc., Auto-updates enabled
    Thanks Redirect for WooCommerce: version: 3.1, author: Nitin Prakash, Auto-updates enabled
    Ultimate Addons for Gutenberg: version: 1.25.6, author: Brainstorm Force, Auto-updates enabled
    UpdraftPlus - Backup/Restore: version: 1.22.12, author: UpdraftPlus.Com, DavidAnderson, Auto-updates enabled
    Widgets for Google Reviews: version: 8.4, author: Trustindex.io <[email protected]>, Auto-updates enabled
    WooCommerce: version: 6.5.1, author: Automattic, Auto-updates enabled
    WooCommerce Additional Variation Images: version: 2.0.0, author: WooCommerce, Auto-updates disabled
    WooCommerce Address Validation: version: 2.8.1, author: SkyVerge, Auto-updates disabled
    WooCommerce Checkout Field Editor: version: 1.7.3, author: WooCommerce, Auto-updates disabled
    WooCommerce Customer/Order/Coupon Export: version: 5.3.3, author: SkyVerge, Auto-updates disabled
    WooCommerce PayPal Payments: version: 1.8.1, author: WooCommerce, Auto-updates enabled
    WooCommerce Print Invoices/Packing Lists: version: 3.11.4, author: SkyVerge, Auto-updates disabled
    WooCommerce Product Add-ons: version: 5.0.0, author: WooCommerce, Auto-updates disabled
    WooCommerce Product Documents: version: 1.13.0, author: SkyVerge, Auto-updates disabled
    WooCommerce Product Enquiry Form: version: 1.2.23, author: WooCommerce, Auto-updates disabled
    WooCommerce Square: version: 3.0.3, author: WooCommerce, Auto-updates enabled
    WooCommerce Table Rate Shipping: version: 3.0.38, author: WooCommerce, Auto-updates disabled
    WooCommerce USPS Shipping: version: 4.4.74, author: WooCommerce, Auto-updates disabled
    WP-Optimize - Clean, Compress, Cache: version: 3.2.5, author: David Anderson, Ruhani Rabin, Team Updraft, Auto-updates enabled
    Yoast SEO: version: 19.0, author: Team Yoast, Auto-updates enabled
    Yotpo Social Reviews for Woocommerce: version: 1.1.8, author: Yotpo, Auto-updates enabled
    
    ### wp-media ###
    
    image_editor: EWWWIO_Imagick_Editor
    imagick_module_version: 1808
    imagemagick_version: ImageMagick 7.1.0-16 Q16-HDRI x86_64 2021-11-21 https://imagemagick.org
    imagick_version: 3.7.0
    file_uploads: File uploads is turned off
    post_max_size: 512M
    upload_max_filesize: 512M
    max_effective_size: 512 MB
    max_file_uploads: 20
    gd_version: bundled (2.1.0 compatible)
    gd_formats: GIF, JPEG, PNG, BMP
    ghostscript_version: 9.55.0
    
    ### wp-server ###
    
    server_architecture: Linux 5.4.155-200.el7.x86_64 x86_64
    httpd_software: Apache
    php_version: 8.0.19 64bit
    php_sapi: cgi-fcgi
    max_input_variables: 8000
    time_limit: 600
    memory_limit: 1024M
    max_input_time: 60
    upload_max_filesize: 512M
    php_post_max_size: 512M
    curl_version: 7.80.0 OpenSSL/1.1.1o
    suhosin: false
    imagick_availability: true
    pretty_permalinks: true
    htaccess_extra_rules: true
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 5.7.26-29-log
    client_version: mysqlnd 8.0.19
    max_allowed_packet: 16777216
    max_connections: 1000
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /var/www/wp-content
    WP_PLUGIN_DIR: /var/www/wp-content/plugins
    WP_MEMORY_LIMIT: 40M
    WP_MAX_MEMORY_LIMIT: 1024M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    SCRIPT_DEBUG: false
    WP_CACHE: true
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_ENVIRONMENT_TYPE: Undefined
    DB_CHARSET: utf8
    DB_COLLATE: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    mu-plugins: writable
    
    ### google-site-kit ###
    
    version: 1.75.0
    php_version: 8.0.19
    wp_version: 5.9.3
    reference_url: https://orchardaudio.com
    amp_mode: no
    site_status: connected-site
    user_status: authenticated
    verification_status: verified-non-site-kit
    connected_user_count: 1
    active_modules: site-verification, search-console, analytics, analytics-4, pagespeed-insights, tagmanager
    required_scopes: 
    	openid: ?
    	https://www.googleapis.com/auth/userinfo.profile: ?
    	https://www.googleapis.com/auth/userinfo.email: ?
    	https://www.googleapis.com/auth/siteverification: ?
    	https://www.googleapis.com/auth/webmasters: ?
    	https://www.googleapis.com/auth/analytics.readonly: ?
    	https://www.googleapis.com/auth/tagmanager.readonly: ?
    capabilities: 
    	googlesitekit_authenticate: ?
    	googlesitekit_setup: ?
    	googlesitekit_view_posts_insights: ?
    	googlesitekit_view_dashboard: ?
    	googlesitekit_view_module_details: ?
    	googlesitekit_manage_options: ?
    	googlesitekit_view_splash: ?
    	googlesitekit_view_authenticated_dashboard: ?
    enabled_features: 
    	adsenseSetupV2: ?
    	dashboardSharing: ?
    	ideaHubModule: ?
    	swgModule: ?
    	userInput: ?
    	unifiedDashboard: ?
    	zeroDataStates: ?
    search_console_property: https://orchardaudio.com/
    analytics_account_id: 1293?????
    analytics_property_id: UA-1293???????
    analytics_profile_id: 1919?????
    analytics_use_snippet: no
    analytics_4_property_id: 3103844??
    analytics_4_web_data_stream_id: 3439??????
    analytics_4_measurement_id: G-MD????????
    analytics_4_use_snippet: yes
    tagmanager_account_id: 6002??????
    tagmanager_container_id: GTM-NLN????
    tagmanager_amp_container_id: none
    tagmanager_use_snippet: yes
    
    • This reply was modified 2 years, 5 months ago by cyaniccypher.

    Hi @cyaniccypher

    Thanks for sharing the System Status Report and the code.

    I understand that you want to add Google Ads tracking code to your WooCommerce site.

    The specific workflow you described is not directly a feature of WooCommerce core (which this specific forum covers), but you can hopefully get great help from these articles:

    https://www.cloudways.com/blog/woocommerce-google-ads-conversion-tracking/
    https://hevodata.com/learn/woocommerce-google-ads-conversion-tracking/

    For assistance beyond this it would be best for you to check Google’s support documents at https://support.google.com/google-ads/answer/6095821?hl=en or reach out to their helpdesk if need be.

    * This particular forum is for questions that are directly related to the features and functionality of the free WooCommerce core plugin.

    This thread has been inactive for a bit, so I’m going to mark it closed. Hopefully, the above information was useful.

    Please feel free to open a new thread if you have any other questions related to core WooCommerce.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dymanic Sale information’ is closed to new replies.