How to add google analytic code in wordpress?

Woocoders
Woocoders
2nd September 2020
<?php
add_action('wp_footer', 'add_googleanalytics');
function add_googleanalytics() { ?>
// Paste your Google Analytics code here
<?php } ?>

//paste this code in your theme function file  (default: function.php)

Share this post: