Embed pages

Intended to be used to integrate DevHub pages or location finder into an existing website experience.

With this approach, you can setup a page within your existing Site and CMS and then use the embed code to display your DevHub landing page or microsite.

Installation steps

  1. Generate your embed javascript code - See notes below

  2. Create a page on your existing site

  3. Add the embed javascript code to the content area of your blank page

Example embedded javascript code

<div data-url="DEVHUB_PAGE_URL" data-title="DEVHUB_PAGE_TITLE" id="sb-site-embed"></div>
<script type="text/javascript">
(function() {
  var _cachebuster = Math.round(new Date().getTime() /2000);
  var _sb = document.createElement('script'); _sb.type = 'text/javascript';
  _sb.src = 'DEVHUB_PAGE_HOSTNAME/stat/js/site-embed.js?' + _cachebuster;
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(_sb, s);
})();
</script>

Required configuration of the above code

  • DEVHUB_PAGE_URL - this is the full published URL of your landing page or microsite

    • Example: https://yourcampaign.yourdomain.com/landing-page/

  • DEVHUB_PAGE_TITLE - this is the title of your landing page or microsite

    • Example: Landing Page

    • This is especially important for ADA accessibility

  • DEVHUB_PAGE_HOSTNAME - this is just the hosted domain part of your landing page URL (if different)

    • Example: https://yourcampaign.yourdomain.com

Last updated