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.
Thanks

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:

<script>
  !function(f,b,e,v,n,t,s)
  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
  n.callMethod.apply(n,arguments):n.queue.push(arguments)};
  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
  n.queue=[];t=b.createElement(e);t.async=!0;
  t.src=v;s=b.getElementsByTagName(e)[0];
  s.parentNode.insertBefore(t,s)}(window, document,'script',
  'https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', '736485559881254');
  fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=736485559881254&ev=PageView&noscript=1"/></noscript>
<!-- End Facebook Pixel Code -->

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-115780029-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-115780029-1');
</script>

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-TTDGRHK');</script>
<!-- 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=\"https://www.facebook.com/tr?id=736485559881254&ev=PageView&noscript=1\"/></noscript>\n<!-- End Facebook Pixel Code -->\n\n<!-- Global site tag (gtag.js) - Google Analytics -->\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-115780029-1\"></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