Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuanbbhero/cc4d186aef28e3b77fd2cf8b8f32348b to your computer and use it in GitHub Desktop.
Save tuanbbhero/cc4d186aef28e3b77fd2cf8b8f32348b to your computer and use it in GitHub Desktop.
add_action( 'woocommerce_thankyou', 'kl_gg_analytics_thank_you_page' );
function kl_gg_analytics_thank_you_page() {
?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-107909516-7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-107909516-7');
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment