• Skip to main content
  • Skip to primary sidebar

WordPress, Genesis Framework and Storefront customization tutorials

  • Archive
    • Free
    • Premium
  • Blog
  • About
  • Contact
  • Newsletter
  • Membership
  • Login
Home » Analytics

Analytics

Conversion Tracking for WooCommerce

Google Ads Global tag

Event snippet for conversion page

Filed Under: Free Tagged With: Analytics

Phone snippet – Analytics

The phone snippet should be added to the pages on your website where the phone number you’d like to track appears. The phone snippet should be placed right after the global site tag.

<script>
  gtag('config', 'AW-CONVERSION_ID/CONVERSION_LABEL', {
    'phone_conversion_number': '1-650-555-5555'
  });
</script>

Filed Under: Free Tagged With: Analytics

Event snippet – Google Analytics

The event snippet should be installed on the conversion page itself. Google recommends placing it within the

<head>[/php ] section for the best tracking accuracy.


  <!-- Event snippet for Example conversion page -->
    <script>
      gtag('event', 'conversion', {'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL',
        'value': 1.0,
        'currency': 'USD'
      });
    </script>

Filed Under: Free Tagged With: Analytics

Add Conversion Tracking Code to Thank You Page


/**
* @snippet Add Conversion Tracking Code to Thank You Page
*/

add_action( 'woocommerce_thankyou', 'bbloomer_conversion_tracking_thank_you_page' );

function bbloomer_conversion_tracking_thank_you_page() {
?>
<!-- Google Code for Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 000000000000;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "kjsdhfkjhkfsdfsdf";
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/000000000000/?label=kjdhfsdjfkjkjshdkkkjsdkk&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<?php
}

Filed Under: Free Tagged With: Analytics

Primary Sidebar

Gabor Flamich

Hi! I'm Gabor.
I write tutorials on WordPress and WooCommerce.

MacBook

12 Essential Snippets for Genesis Developers

Subscribe to my Newsletter to view my basic collection of Genesis snippets that I use for my projects!

Sign Up for Free
  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
UpdraftPlus Premium

Tags

ACF Ajax Analytics API Bootstrap Breadcrumb category CPT CSS fetch Genesis Google Maps Gutenberg HTML Isotope JavaScript jQuery loop Map Menu Parallax PHP SASS SEO SQL Storefront SVG tab tag manager tags Taxonomy Tool upsell Webpack Wholesale WooCommerce WordPress WPML

Disclosure: Some of the links in this site are affiliate links. I will be paid a commission if you use this link to make a purchase.

  • Privacy Policy / Terms of Service
© 2023 WP Flames - All Right Reserved