• 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.

<!-- Google Tag Manager  head code-->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- 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) -->
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.
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?
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.
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