Installing the embed snippet

This snippet must appear at the top of every page on your site where you need to interact with the PrivacyID JavaScript API.

Place the snippet code so that it appears immediately after the <head> tag on each page of your site.

Be sure to replace the following placeholders in the snippet:

  • PROXY_DOMAIN - This is the subdomain you configured using DNS records to point to the PrivacyID servers. For example, if your website is at https://your-website.com and you created the subdomain pid.your-website.com, then use pid.your-website.com for this value.

  • PATH_TO_API_ENDPOINT - This is the path to the API endpoint you implemented on your web server. For example, this may be "/api/privacyId".

<!-- PrivacyID start -->
<script type="text/javascript">
(function(){function fn(){fn._i.push(arguments);}fn._i=[];window.PrivacyID=window.PrivacyID||fn;}());

PrivacyID('endpoint', 'PATH_TO_API_ENDPOINT');
</script>
<script async src="https://PROXY_DOMAIN/library.js"></script>
<!-- PrivacyID end -->

Last updated