We now have updated and simplified code you can use to implement your Medicom Health Risk Assessments on your organization’s website. This code includes several enhancements for your web team’s reference, which are listed below.
To update your HRA implementation, follow these directions:
3) Select the preferred display mode for your HRA under the “Select Profiler Display” section. You will be able to choose between Lightbox implementation (best practice), or a link that will open your HRA in a new window.
5) When you’ve updated everything to match your preferred customization, you can copy and paste the automatically generated code from the Embed Code section and place it wherever you want the HRA launch link to appear on your website.
Main Overview of Enhancements in this New Code:
- When the link is clicked, this code checks the client’s page for the following Google Analytics parameters and copies them over to the profiler URL: utm_source, utm_medium, utm_campaign, utm_term, utm_content. If the parameters already exist on the profiler URL (i.e. a client manually added them), they will be left as is.
- This script watches the page for link clicks, so it will catch links that are added dynamically or via AJAX on the client’s site after the page loads. It also means the script can be included anywhere on the page (HEAD or BODY), before or after the link is included.
- The script includes its own version of jQuery and fancybox, so there shouldn’t be any problem with it conflicting with other versions of jQuery or fancybox (or any other JS) included on the client’s page.
- The script is loaded with the async attribute, so it won’t block rendering or any other external downloading (so again, it can be added anywhere on the page without affecting page load performance).
- The script protects itself from being included more than once. If you add it to the page more than once, it will still work as expected.
- The script is hosted on a Content Delivery Network (CDN) and is only 40KB minified/zipped, so it should load quickly on clients’ sites.