Announcement

Collapse
No announcement yet.

Embedded tracking Javascript displays errors on debug console.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Embedded tracking Javascript displays errors on debug console.

    Hi - I am trying to embed the following tracking script into my website (where xxxxx is a unique code)

    Code:
    <script id="mcjs">!function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/xxxx.js");</script>
    This is not working and the debug console displays the following:

    Code:
    Uncaught TypeError: can't access property "appendChild", document.body is null
    <anonymous> https://chimpstatic.com/mcjs-connected/js/users/xxxxx.js:116
    <anonymous> https://chimpstatic.com/mcjs-connected/js/users/xxxxx.js:119
    I know that Sellerdeck has problems with these type of scripts. Any ideas?
    Regards
    David

    #2
    The error is coming from when the external JavaScript runs. It's not finding a document.body to manipulate.

    Could it be caused by where you've placed the line?

    If you've put it in the HEAD area of your page, it would run before the BODY tag was encountered and lead to the error you see.


    Try putting that line at the end of the page, just before the </body> tag..
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      That worked fine Norman - thanks.
      Regards
      David

      Comment

      Working...
      X