Integrations
Forms and CRM tools
Google Forms, HubSpot, Typeform and other form tools.
Every form integration does two things: show the consent wording and a checkbox inside the form, and record the ticks against the person's email. For forms you do not control the HTML of, the recording is done with the API.
| Form | Use | Evidence |
|---|---|---|
| Your own HTML form, WordPress (Contact Form 7, Elementor, WPForms, Gravity) | The consent block | Best: the visitor's IP, browser and notice version are captured in the browser |
| HubSpot with a raw HTML or developer embed | The consent block above the submit button. HubSpot still gets the lead | Best |
| HubSpot iframe embed, Typeform, Tally, Jotform | The tool's own checkbox, worded from the collection point's purposes. Its webhook goes to n8n, which calls the API | Good: email, ticks and time. Send IP and browser if the tool gives them |
| Google Forms | A checkbox question plus a small Apps Script (below) | Good: email, ticks and time. No visitor IP |
| Mobile app or backend sign-up | The API from your server. See In-app consent | Best, if you send the device's IP and browser |
Keep the checkbox wording the same as the collection point's purposes. If you change the purposes, change the form. The collection point endpoint returns the current text.
Google Forms, step by step
- In Pactbase, create a collection point (for example
google-form-signup) of type API, with its purposes. Note the purpose ids. Under Settings, then API keys, create a key with Read and record consent. - In the Google Form, turn on Collect email addresses. Add a Checkboxes question titled with the purpose text, for example "I agree to receive product updates by email (see our privacy notice: https://example.com/privacy)". Do not make it required unless it is the form's only purpose. Consent must be free.
- In the form, choose the three-dot menu, then Apps Script, and paste:
const PACTBASE_URL = 'https://v1.pactbase.in/api/v1/consent';
const COLLECTION_POINT = 'google-form-signup';
// The checkbox question's text -> the Pactbase purpose id it stands for
const PURPOSES = { 'I agree to receive product updates by email': 'PURPOSE_ID' };
function onSubmit(e) {
const decisions = {};
for (const item of e.response.getItemResponses()) {
const id = PURPOSES[item.getItem().getTitle()];
if (id) decisions[id] = (item.getResponse() || []).length > 0;
}
const key = PropertiesService.getScriptProperties().getProperty('PACTBASE_API_KEY');
UrlFetchApp.fetch(PACTBASE_URL, {
method: 'post',
contentType: 'application/json',
headers: { Authorization: 'Bearer ' + key },
payload: JSON.stringify({ collection_point: COLLECTION_POINT, email: e.response.getRespondentEmail(), decisions }),
muteHttpExceptions: true,
});
}- Under Project settings, then Script properties, add
PACTBASE_API_KEY. Never paste the key into the code. Under Triggers, add a trigger: functiononSubmit, event From form, On form submit. Approve the permissions once. - Submit a test answer, then check Consent Management, then Consent Records.
Apps Script does not retry a failed call. Retrying on Pactbase's side is safe (a duplicate is answered 200), so for important forms log failures to a sheet and resend.
HubSpot, two ways
- Inside your page (best): use HubSpot's raw HTML or developer embed, or build the form in your page and submit it to HubSpot's Forms API. Add
<div data-pactbase-consent-block="hubspot-demo"></div>above the submit button. Pactbase records consent, and HubSpot still gets the lead. - Iframe embed: add HubSpot's own consent checkbox with your purpose text. A HubSpot workflow sends a webhook on submission to n8n, which calls the API. In the other direction, consent changes in Pactbase reach HubSpot through webhooks (
consent.updated,consent.withdrawn) and n8n.