Site logo

Archived topic

Google Analytics, Geniuslinks and Third Party Scripts are not working.

4 replies · Started by igeeksblog on September 10, 2020

Viewing posts 1–5 of 5

Hello Team,

No Scrtips are acting or tracking data with GeneratePress Theme.

My domain is http://www.igeeksblog.com and using GeneratePress Theme 2.4.2 with GP Premium 1.11.3

I am using Google Analytics to track visitors. I have added this script via hooks in WP_Head with 1 priority on the entire site.

Using geniuslink to convert link on the fly. I have added this script via hooks in WP_Footer with 1 priority on the entire site.

However, Google Analytics won't track the data and other scripts do not work in the way they have too.

More about Plugin, I am using Yoast SEO, Askimet, Autoptimise, and WP Super Cache.

Let me know how I can fix this.

~ Nikhil Makwana

Hi there,

try disabling your cache that is combining your javascripts as it is creating an error in the console ( right click > inspect ).

Hello David,

I have disabled all the plugins except Yoast SEO and tried if any JS works or not.

Unfortunately no luck, I tried it for almost 2 hours and it's the same.

Let me know when you test it so that time I will again disable all the plugins. Or let me know if you need backend details to check more.

Actual Google Analytics Code

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=“https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-1”></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘UA-XXXXXXX-1’);
</script>

But If I add it in a hook it looks like

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=“https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-1”></script>
<script defer src="data:text/javascript;base64,DQogIHdpbmRvdy5kYXRhTGF5ZXIgPSB3aW5kb3cuZGF0YUxheWVyIHx8IFtdOw0KICBmdW5jdGlvbiBndGFnKCl7ZGF0YUxheWVyLnB1c2goYXJndW1lbnRzKTt9DQogIGd0YWco4oCYanPigJksIG5ldyBEYXRlKCkpOw0KICBndGFnKOKAmGNvbmZpZ+KAmSwg4oCYVUEtMzU0Nzg3ODctMeKAmSk7DQo="></script>

And At the end, one line is commented out.

<script defer type='text/javascript' src='https://www.igeeksblog.com/wp-content/themes/generatepress/js/classList.min.js' id='generate-classlist-js'></script>
<![endif]-->

This highlights GeneratePress compress the JS.

I just checked you site and both the script is being requested, and the tag is firing ( checked in Tag Assistance browser extension ).

NOTE: GP doesn't compress any scripts.

This archived topic is closed to new replies.