Mandatory consent

In some cases, you'll want to make the acceptance of the checkbox mandatory to continue the process. Here is how

1. Présentation vidéo

2. Concrete example

In the case of Axeptio we can see that it is necessary to agree with the CGU to access services proposed by Axeptio, and on our side we have to be able to prove that you agreed with our CGU if you use Axeptio. We then conditioned the button "Create an account" to the consent to CGU. The button is greyed until you accepted the CGU and unlocks once you clicked on "I agree"

II. Technical integration

To realise this part, it is necessary to have configured a marketing checkbox and filled a register as described before.

In your site footer at the same place as the sdk, you will add the following functions :

<script type="text/javascript">
//Here is the Axeptio sdk that you integrate in the footer
var el = document.createElement("script");
el.setAttribute("src", "https://static.axept.io/sdk.js");
el.setAttribute("type", "text/javascript");
el.setAttribute("async", true);
el.setAttribute("data-id", "Data-id_de_votre_projet");
if (document.body !== null) {
document.body.appendChild(el);
}
//Here is the function to make the consent of your checkbox mandatory
window._axcb = [
axeptio => {
const config = axeptio.getWidgetConfig({
//Name of service "processings" for marketings consents or "contracts" for contracts consents
service: "processings",
//identifier is the identifier of the checkbox you want to target: marketing consents or contracts consents
//We'll see later where to find it
identifier: "Token_de_votre_identifier"
});
axeptio.renderWidget({
config: Object.assign({}, config, {isRequired: true}),
//Name of service "processings" for marketings consents or "contracts" for contracts consents
service: 'processings',
//Name here the button ID that you want to target
//The one that will be greyed until the consent of the user
node: document.getElementById("ID_of_your_button")
});
}
];
// We'll now create a "Send" button with an ID corresponding to the ID that we targetted before
</script>
<form>
<input type="text" name="text" />
//Make sure to have the same two IDs
<div id="ID_of_your_button"></div>
<button>Envoyer</button>
</form>

III. Find the service identifier

To find your identifer, go to the wanted service Example : for a marketing checkbox : 1 - Go to Marketing consents module 2 - Choose the checkbox you want to configure 3 - You'll see the screen below

In your project URL you'll find in blue the data-id of your project and in red the token of your identifier. Now just replace the identifier in your Javascript integration.

Congratulations ! Your checkbox acceptance is now required in your form