MonsterInsights comment removal broken
-
First of all, great plugin.
I’ve encountered a strange error on my page when I activated the plugin and chose to remove the MonsterInsights comment. Before the styles were loaded, I saw a brief flashing of
/* */
on my site. While this was negligible, the text pushed the content around and thus slight, but noticeable, layout shifts were the result.When MonsterInsights comment removal was active, the following HTML was generated:
<link rel="stylesheet" href="https://example.com/wp-content/cache/minify/8d1dc.css" media="all" /> /* <![CDATA[ */ var monsterinsights_frontend = {"js_events_tracking":"true","download_extensions":"doc,pdf,ppt,zip,xls,docx,pptx,xlsx","inbound_paths":"[{\"path\":\"\\\/go\\\/\",\"label\":\"affiliate\"},{\"path\":\"\\\/recommend\\\/\",\"label\":\"affiliate\"}]","home_url":"https:\/\/example.com","hash_tracking":"false","ua":"","v4_id":"G-0000000000"}; /* ]]> */ </script></script> <script src="https://example.com/wp-content/cache/minify/818c0.js"></script>
instead of
<link rel="stylesheet" href="https://example.com/wp-content/cache/minify/8d1dc.css" media="all" /> <script type='text/javascript' id='monsterinsights-frontend-script-js-extra'> /* <![CDATA[ */ var monsterinsights_frontend = {"js_events_tracking":"true","download_extensions":"doc,pdf,ppt,zip,xls,docx,pptx,xlsx","inbound_paths":"[{\"path\":\"\\\/go\\\/\",\"label\":\"affiliate\"},{\"path\":\"\\\/recommend\\\/\",\"label\":\"affiliate\"}]","home_url":"https:\/\/example.com","hash_tracking":"false","ua":"","v4_id":"G-0000000000"}; /* ]]> */ </script> <script src="https://example.com/wp-content/cache/minify/11394.js"></script>
Apparently, because the id of the script tag contains “monsterinsights”, the tag/line is removed from the output, resulting in the aformentioned error.
Installed plugins:
– Google Analytics for WordPress by MonsterInsights (free): 8.2.0
– Meta Generator and Version Info Remover: 12.2
- The topic ‘MonsterInsights comment removal broken’ is closed to new replies.