Embedding CPM JavaScript in a Customer Website

๐Ÿ“‹ Note: The JavaScript must come from a consent form that is in Published state.
Embedding CPM JavaScript
1
From the left side of the page, hover the mouse over the Consent & Preferences icon, and then navigate to Setup (1) > Consent Forms (2).
Setup Consent Forms menu
2
From the Consent Forms page, open the published consent form, and then go to the form's Publish page (3).
Consent Form Publish page
3
Below the box (4) that contains the JavaScript, click Copy Code (5) to copy the script that you will use to embed on the customer's website.
Copy Code button for JavaScript
4
Go to the customer website and embed the copied code. You can add different parameters to this code if need be. These parameters can add default value to fields and make fields read-only, editable, hidden, etc., as described in the following sections.

You can also do the following configurations to your form:

โ€ขSet up Global Privacy Control (GPC). For more information, see Recognizing GPC in CPM.
โ€ขSecure your form using JWT (JSON Web Token). This can also be used to create magic links while sending customized unsubscribe links in outgoing emails to consumers. Click the Secure Form button for more details.
โ€ขAdd other parameters to the script. For more information, see Adding Parameters to the Consent Form URL.
Secure Form JWT button
Embedded Forms with Google reCAPTCHA

Google reCAPTCHA does not function on embedded forms by default. Without proper configuration, the form returns an error on every submission attempt.

To enable reCAPTCHA on your embedded form, register your domain through TrustArc Support or DevOps. Contact your support team before deploying any embedded form that uses reCAPTCHA validation. If you are using TrustArc CAPTCHA, no additional configuration is needed as it works out of the box for embedded forms.

TrustArc ย ยทย  Embedding CPM JavaScript ย ยทย  trustarc.com