Home > database >  How to remove magento default schema markup using google tag manager?
How to remove magento default schema markup using google tag manager?

Time:09-18

I am unable to remove default itemtypes and itemtypes from DOM page using google tag manager. enter image description here

How to remove itemtype and itemscope from above body tag using javascript in google tag manager?

CodePudding user response:

You can use Element.removeAttribute() method to remove your desired attributes from an element. In this case you can do something like this:

document.body.removeAttribute("itemtype");
document.body.removeAttribute("itemscope");

CodePudding user response:

This can be done by adding this Custom HTML Tag in google tag manager:

<script>
var body = document.getElementsByTagName('body')[0];

body.removeAttribute("itemtype");
body.removeAttribute("itemscope");
</script>
  • Related