ERPNext showing JSON on Desk. Help Needed

I was working on the website module. I setup google analytics and some other settings. Finally as I was adjusting the size of an image on a web page, this came up:

Clicking on the first console error seems to point me to an issue which seems like the problem. The google analytics came with its own double quotes:

I’d like to remove this line from Website Settings > Header but I cannot find the table its stored in. I’ve looked around the sites database and I just can find where it is stored. Any information towards resolving this will be appreciated.

At this point I can access everything around the site, the portal but nothing behind desk.

Hi try,

select * from tabSingles where doctype=“Website Settings”;

find your field and update.

1 Like

Thank you @Ranjith

This helped me get into desk. I was able to clear the field using SQL:

 UPDATE tabSingles SET value = '' WHERE doctype='Website Settings' and field='head_html';

But I’ve noticed that ERPNext is escaping my html tags, thats why this issue is coming up.

This input:

  s.parentNode.insertBefore(t,s)}(window, document,'script',
  fbq('init', '736485559881254');
  fbq('track', 'PageView');
<noscript><img height="1" width="1" style="display:none" src=""/></noscript>
<!-- End Facebook Pixel Code -->

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=""></script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-115780029-1');

<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->

Creates this result during execution (notice the newly introduced backslashes \'s and \n’s):

"head_html": "<!-- Facebook Pixel Code -->\n\n<noscript><img height=\"1\" width=\"1\" style=\"display:none\" src=\"\"/></noscript>\n<!-- End Facebook Pixel Code -->\n\n<!-- Global site tag (gtag.js) - Google Analytics -->\n<script async src=\"\"></script>\n\n\n<!-- Google Tag Manager -->\n\n<!-- End Google Tag Manager -->",

I don’t understand why or how to resolve this.

I think you added some script in website header section.
Don’t put any script or adword in header section.

Yes and it is being encoded. So where should the google analytics script go?

Add Google Analytics ID to integration section of website settings.

1 Like

It’s funny I had the facebook pixel embedded for months with no issue. Til yesterday when I did some updates to some pages and the the Site Header.

1 Like