/ /

Embedding TrustHub on Your Website

Updated 4 months ago

Overview

TrustHub provides multiple embedding options to integrate your TrustHub pages into your existing website. You can choose between iframe and JavaScript embedding methods, depending on your technical requirements and preferences.

Getting the Embed Code

Step 1: Access Your TrustHub Page

  1. Log in to your Osano account

  2. Navigate to the TrustHub section

  3. Open the page you want to embed

Step 2: Get the Embed Code

  1. Click the purple "Get Code" button in the top right corner of your TrustHub page

  2. Choose your preferred embedding method:

  • Iframe Embed: Simple HTML iframe code

  • JavaScript Embed: More advanced JavaScript implementation

Step 3: Copy the Code

  • The embed code will be displayed in a popup

  • Copy the code snippet

Embedding Methods

Iframe Embedding

Iframe embedding is the simplest method and works with most websites:

<iframe title="Osano TrustHub Embedded Page" frameborder="0" src="https://example.trusthub.com/page-id/" width="100%"></iframe>

Benefits:

  • Simple implementation

  • Works with most content management systems

  • Minimal technical requirements

  • Easy to customize with CSS

Considerations:

  • Fixed height may not work for all content

  • Limited interaction with parent page

  • May have styling limitations

JavaScript Embedding

JavaScript embedding provides more flexibility and control:

<!-- Osano TrustHub Embedded Page -->
<script type="text/javascript">
(function (w, d) {
  var l = w.addEventListener(
    "message",
    function (e) {
      try {
        var f = d.getElementById("osano-trusthub-page_example");
        if (e.source === f.contentWindow && e.origin === "https://example.trusthub.com") {
          var m = JSON.parse(e.data);
          f.style.cssText = "height:" + m.osanoTrustHub.contentHeight + "px;min-width:100%";
          w.removeEventListener(l);
        }
      } catch {}
    },
    false
  );
  d.write('');
})(window, document);
</script>
<iframe frameborder="0" id="osano-trusthub-page_example" title="Osano TrustHub Embedded Page" src="https://example.trusthub.com/page-id/" width="100%"></iframe>

Benefits:

  • Dynamic height adjustment

  • Better integration with your site

  • More customization options

  • Responsive design support

Considerations:

  • Slightly more complex implementation

  • May need additional configuration

Direct Linking

For simple linking without embedding, you can use the direct URL to your TrustHub page:

  1. From TrustHub Dashboard: Click the "View Site" button in the top right corner

  2. From Individual Pages: Click the "View Page" button on any TrustHub page

  3. Copy the URL from your browser's address bar

Using the Direct Link

Simply add the TrustHub URL as a regular link on your website, for example:

<a href="https://example.trusthub.com/privacy-policy">Privacy Policy</a>

Benefits of Direct Linking:

  • Simple implementation

  • No iframe or JavaScript required

  • Full page experience for users

  • Easy to maintain and update

Was this article helpful?
Subscribe to receive updates on this article