Put the javascript into the footer. I am using a Hybrid Theme (Spine2) with my own customized child-theme, so I just used Appearance > Theme Editor to edit my child-theme footer.php to insert the javascript, just before the closing footer tag. I enclosed the script with code tags and added a comment.
I left the data-pin-do anchor code in a page and now it displays correctly. Hope this helps.