• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 65
  • Last Modified:

WordPress website not working after adding Google Tracking Code?

WordPress website not working after adding Google Tracking Code?
I have tried adding code via a plugin and also by manually editing header.php file, but still same issue.

This page isn’t working
www.mywebsite.com.au redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS


<!-- Google Tag Manager  head code-->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-DGSRS556');</script>
<!-- End Google Tag Manager -->


<!-- Google Tag Manager body code (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-DGSRS556"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
0
sabecs
Asked:
sabecs
2 Solutions
 
Britt ThompsonSr. Systems EngineerCommented:
Sounds like you may have something in your .htaccess file causing the invalid redirect loop. Or, another plugin is causing the loop.

If not .htaccess,  you can add the script to the header and disable plugins one by one to see if that's the cause.
0
 
Andrei FilonovWeb Developer / OwnerCommented:
Your site seems to be redirecting to https:// version of the domain, and then error is shown about invalid certificate...
Adding google code should not really do anything like that...
Have you turned ON some sort of SSL setting? Changed URL perhaps?
0
 
Scarlett WhitehouseTechnical WriterCommented:
This problem is not occurring by adding Google Tracking Code. It is your website redirection problem, which can occur due to some modification has been done to your .htaccess file. Changes in .htaccess file can happen due to some redirection plugins which you have installed. So I would suggest you the same as Britt Thompson said disable plugins one by one then add Google Tracking Code to check the issue is resolve or not.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now