How to embed Webmanager into your site

Prerequisites:

  • To use custom domain: If you want to use custom domain (example: embed.xyz.nl) make sure domain DNS is pointing towards the webmanager domain and proper CNAME has been added.

Configuration:

  1. Create and setup a page inside WebManager admin as usual.

  2. Add this page inside the embed host (embed.xyz.com) inside site settings.

  3. Add appropriate friendly url:

    image-20240403-012959.png
  4. Turn on Enable embedding inside site settings:

    image-20240403-013150.png
  5. Go to Embed Settings, override App ID if required. Note: This should only be done in case there is similar id being used for some div already by client site where the embed needs to be implemented. In such case you can override it with a custom id. Default id is app.

  6. Whitelist the client sites where the embed needs to be implemented inside Embed Settings. Example: clientsite1.com, clientsite2.com

     

  7. Save the settings.

 

Usage of embed script:
Use the following script on client site along with necessary changes so that the page that is configured on WebManager can be embedded on client site.


<div id="maxxton" data-url="/embeddable-rating"></div> <script> window.maxxtonAsyncInit = function(MaxxtonEmbed) { MaxxtonEmbed.init({ elementId: "maxxton", url: "https://embed.xyz.nl" }); }; (function (d, s, id) { var js, tjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.async = true; js.defer = true; js.src = "https://embed.xyz.nl/webmanager/js/embed.js"; tjs.parentNode.insertBefore(js, tjs); })(document, "script", "maxxton-embed"); </script>


Things to take care while using the above embed script:

  1. The div id (line: 1) needs to match the element id (line:4) → (“maxxton” in the above example)

  2. The data-url (line: 1) needs to match the friendly url that has been configured inside WebManager admin.

  3. You can also add query parameters (for eg: /embeddable-rating?resourceId=2367) to the data-url (line: 1) as per requirement.

  4. embed.xyz.nl needs to be replaced by the url of the embed site of WebManager.