skip to Main Content

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?

2

Answers


  1. 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");
    
    Login or Signup to reply.
  2. 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>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search