LegitScript Seal JavaScript

By January 2, 2019 Web Design

The Problem:

Google has started requiring that certain types of rehab and medical facilities have LegitScript approval. Without this they can’t advertise with Google Ads and Facebook. We’ve helped some of our clients get this certification so they can continue with their marketing efforts online. We’ve recently finished the process and they emailed the code for the seal to us!

LegitScript Seal

<script src=”https://static.legitscript.com/seals/xxxxxxx.js”></script>

The problem is that they sent us some JavaScript that loaded in the image and link after the initial page loaded. This can be slower to load than if the image and link were hard-coded. They did assure us that, “Both the JavaScript snippet and the seal image are served from our fast and reliable content delivery network to ensure that your page rendering performance is not affected”. Beyond that, we had issues because we use WordPress for many of our client’s websites and to help them load faster, we use JavaScript caching and lazy loading.

Because of the delayed start for the JavaScript code, the LegitScript seal wouldn’t load on the pages that had caching and lazy loading turned on. The error we got from the JavaScript console is:

Failed to execute ‘write’ on ‘Document’: It isn’t possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

The Fix:

We reached out to them and they said that we can substitute the static code generated by the JavaScript without any issue. If the JavaScript that you’ve been provided is only loading on some pages or if it’s only loading while logged in (caching and lazy loading is turned off for logged in users), try viewing the source of the content generated by the JavaScript and copying and pasting it in place of the JavaScript code. In our situation that looks like this:

<a href=”http://legitscript.com/pharmacy/yourdomain.com” target=”_blank” title=”Verify LegitScript Approval”><img src=”https://static.legitscript.com/seals/xxxxxxx.png” alt=”LegitScript approved” width=”140″ height=”100″ border=”0″></a>

If you need help moving forward with your LegitScript approval or if you need help with a comprehensive marketing strategy including a company website and search ads and social media content, get in touch with us! We have a lot of experience helping medical companies improve their bottom lines by improving customer visibility.

Leave a Reply