2
    <script>
(function(){
var data = {
  "@context": "http://schema.org",
  "@type": "BlogPosting",
  "mainEntityOfPage": {
    "@type": "WebPage",
    "@id": {{Page URL}}
  },
  "headline": {{SCHEMA - Article Headline}},
  "image": {
    "@type": "ImageObject",
    "url": {{SCHEMA - Article Image}},
    "height": 870,
    "width": 430
  },
  "datePublished": {{SCHEMA - Article datePublished}},
  "author": {
    "@type": "Person",
    "name": {{SCHEMA - Author Name}}
  },
   "publisher": {
    "@type": "Organization",
    "name": "example.com",
    "logo": {
      "@type": "ImageObject",
      "url": "http://www.example.com/ad/de.png",
      "width": 166,
      "height": 25
    }
  },
  "description": {{SCHEMA - Article Description}}
}

var dateModified = {{SCHEMA - Article dateModified}};

    if(dateModified){
      data.dateModified = dateModified;
    } else {
      data.dateModified = {{SCHEMA - Article datePublished}};
    }

var script = document.createElement(script);
script.type = "application/ld+json";
script.innerHTML = JSON.stringify(data);
document.getElementsByTagName('head')[0].appendChild(script);
})(document);
</script>

Here is the code that i am using as custom HTML tag that i create for my Blogpost. But while debugging the page this Custom HTML Tag is not firing. And some DOM element variable showing 'null' value. Here is the screenshot of my problems....enter image description here

enter image description here

enter image description here

enter image description here

  • The last screenshot shows that your tag should be fired on specific pages. Did you try to run debug mode on that pages? – mrbubu Jun 17 '17 at 5:22
  • Yes I already Try...but in every section (window loaded, DOM ready, Page View) Custom HTML tag not firing and in window loaded and DOM Ready section( _event) filters also not working also Page URL....showing red cross. Should i delete this existing tag and triggers and create a new one...will it be a smart work...or it may occur any error in pages? – Mourin Jun 17 '17 at 7:58
  • If the page URL doesn't contain the srting you specified the tag would not fire. Check the string. Is it correct? – mrbubu Jun 17 '17 at 10:34
  • now the page url showing green signal. But the _event(equals gtm.js) filter showing red cross. May be For this Window loaded and DOM ready section showing tag not fired..is this a problem? – Mourin Jun 19 '17 at 7:24
  • If the trigger is Page View then yes – mrbubu Jun 19 '17 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.