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:
Create and setup a page inside WebManager admin as usual.
Add this page inside the embed host (
embed.xyz.com
) inside site settings.Add appropriate friendly url:
Turn on
Enable embedding
inside site settings: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 isapp
.Whitelist the client sites where the embed needs to be implemented inside Embed Settings. Example: clientsite1.com, clientsite2.com
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:
The div id (line: 1) needs to match the element id (line:4) → (“maxxton” in the above example)
The
data-url
(line: 1) needs to match the friendly url that has been configured inside WebManager admin.You can also add query parameters (for eg:
/embeddable-rating?resourceId=2367
) to the data-url (line: 1) as per requirement.embed.xyz.nl
needs to be replaced by the url of the embed site of WebManager.