Provenance, values and consent

Where the visitor came from, prefilled and hidden values, and how consent answers are asked for and recorded.

Where the visitor came from#

Also called "provenance". The script collects this for every lead:

  • the page address (without the # part at the end);
  • the referring page (where they were before);
  • the page title;
  • the browser's language and time zone;
  • whether the page is inside a frame, and if so the website of the outer page.

Subcontext also reads campaign tags (utm_source and the others below) and ad click ids (gclid and the others below) from the page address. The script also sends a click id remembered from an earlier page on your website, or found in your Meta pixel's or Google tag's cookies, with the time it was first seen, when the page address has none. Remembering needs the visitor's consent: see Ad clicks across pages and the rememberClickIds setting.

Set it yourself#

Do this when the tag was on an earlier page (you kept it in a cookie), or when the visitor came from somewhere with no web address, like a flyer or a QR code. Values you set win over the ones in the page address, and over click ids remembered from an earlier page or read from your ad tags' cookies.

You can set it in three places. Later ones win:

  1. the page itself (collected automatically);
  2. init({ provenance }), or the data-utm-* and click id settings on a drawn form's <div>;
  3. the provenance in one submit() or createLead() call.

Use flat keys, or group them:

Flat keys Grouped
utm_source, utm_medium, utm_campaign, utm_term, utm_content, utm_id utm: { source, medium, campaign, term, content, id }
gclid, gbraid, wbraid, fbclid, msclkid, ttclid, li_fat_id click_ids: { gclid, ... }
page_url, referrer, page_title, locale, timezone
js
Subcontext.createLead({
  email: 'ann@example.com',
  provenance: { utm: { source: 'members-area', medium: 'web' }, click_ids: { gclid: savedGclid } }
})

Prefilled and hidden values#

Give a form values up front, from JavaScript:

js
Subcontext.leadform.init({
  mode: 'head',
  target: '#enquiry',
  values: { first_name: 'Ann', product_page: 'van' }
})

or on a drawn form's <div>:

html
<div data-subcontext-leadform data-value-product-page="van"></div>
  • Every lead from that form carries these values, drawn or headless.
  • On a drawn form, a value whose key is a field on the form fills that field in. What the visitor types wins.
  • A value whose key isn't on the form is sent hidden.
  • On a headless form, the values you pass to submit() win.
  • Subcontext.createLead has no settings of its own. Put the values in each call, or use a form from init().

The consent wording is the firm's own, set under Consent in the dashboard (the "website lead form" rules). Which boxes a form shows is chosen on its Design tab. There are three parts:

  • The notice: what giving their details means. Always shown.
  • Opt-out boxes: "tick if you'd rather not". A ticked opt-out box is sent as false.
  • Marketing boxes: one per channel (email, phone and so on), never ticked in advance. A ticked box is sent as true.

A box nobody touched is never sent, so it is never recorded as a no.

On a drawn form#

The consent block is drawn on the last page.

On your own form#

Either:

  • call mountConsent('#somewhere-in-your-form') and the script draws the same block and sends its answers; or
  • read the wording with consent(), draw your own boxes, and send what was ticked: consent: { box_key: true or false }.

Rules for your own boxes:

  • Use the box keys from consent(). Keys that aren't among the boxes the form shows are ignored.
  • Send only boxes that were ticked. A ticked opt-out is false, and a ticked marketing box is true.
  • An answer can be true or false, or a word. Yes words: "true", "yes", "y", "1", "on", "granted", "consented", "opted_in". No words: "false", "no", "n", "0", "off", "denied", "refused", "declined". Upper or lower case both work. Anything else is dropped.
  • Show the notice (and the marketing text) near your boxes, so people see the wording that is recorded.

For each lead, Subcontext keeps, with every consent decision:

  • the exact version of the wording the person saw. If you change your wording before the lead is processed, their answers are still recorded against what they saw;
  • when they pressed send;
  • the page address, their IP address and their browser.

These show in the person's consent history.

Whose word it is#

Anyone can type someone else's email into a public form, so:

  • If the lead is a new person, their answers are recorded as their own.
  • If the lead matches someone you already have, the answers are recorded as an unverified claim. It can never undo a "no" the person gave before, and a "yes" only counts for the email address or phone number you already hold for that person.

Third-party consent by post#

Some firms want permission to pass details to a partner who will write to the person. To ask for it on a lead form:

  1. Ask Subcontext to switch on third-party marketing for your organisation (hello@subcontext.com).
  2. Under Consent, add a box to the website lead form's marketing wording for third-party marketing by post. Name who will contact them in the wording.
  3. Show that box on the form (Design tab).

Its answer is then sent like any other box, with no code changes.

If you collect this consent somewhere else (a partner's site, a phone call) and send the lead from a server, see Sending leads from a server.

Stuck, or something missing?

Get in touch and a person on the team will help.

Contact us