Google analytics is not showing traffic even though all tracking codes are properly installed

Hi there,

I have installed this code within my child theme’s functions.php file:

add_action(‘wp_head’,‘custom_script’);
function custom_script() {
?>
<!-- Global site tag (gtag.js) - Google Analytics

–>

<?php } I have also installed the meta tag and Google analytics ID using the theme's included Google analytics plugin. However, for some reason the Google analytics page is not showing any hits, yet the Google console data is coming through just fine. What am I doing wrong? I need data on hits to each individual webpage on the site and I'm not getting them.

Hello @ziggybri,

After placing the necessary tags and the GA code, please ask Google to crawl your site again.
For more details, please check this out: https://support.google.com/webmasters/answer/6065812?hl=en

Hope this helps.

Is adding the code to the functions.php file necessary? There is no reference to it while installing the plugin is why I am asking.

Hello Houston,

Adding code to function.php is necessary if you are taking the child theme route. However, you can also use Google Analytics plugin. Please make sure to configure the plugin properly to avoid any conflicts. After installing Google Analytics, all you need to do is Add the Google Analytics ID. Please don’t paste entire Google Analytics script.

In case, you are facing any issues please create a new ticket to avoid any confusion and slow response time.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.