Form submission

An event with the type form_submission means that form submission data has been received by the CRM.

General

  • type: Always form_submission for this type of action.

  • uuid: The unique UUID of this submission, other events use this to reference the submission (e.g., form_submission_confirmed events). Note: This is not the UUID of the contact.

  • is_draft (boolean): Whether the submission was saved as a draft (true) or is completed (false).

Submitted data

The submitted data is available in the data property of the event. Each value can be accessed using its form key.

The keys and their types and value ranges depend on your form configuration.

Action data

Data about the action and its configuration can be found in action. This contains:

  • id: A short unique ID for this action, for IST 1.0 this is of the form N123

  • uuid (uuid): A globally unique UUID for this action. Note: This is not the UUID of the contact.

  • title: The title of the action

  • type: The type of action (e.g., petition, email_to_target, …)

  • needs_confirmation (boolean): If present and true the action was configured to require an email confirmation.

  • tags: A list of auto-tagging tags configured for this action at the time of submission.

For 1.x this also provides (deprecated):

  • campaign_tags

  • source_tags

  • type_title

Changed in version 1.3.0: Added the id property.

Tracking data

The tracking data is available in tracking property of the event. It includes:

URLs:

  • form_url: The URL of the page where the form was submitted

  • entry_url: The URL of the entry page on the domain where the form was submitted.

  • external_referer: The referring page, if any, and the browser provided it.

URL parameters:

  • campaign: The value of the utm_campaign parameter (short c, campaign)

  • medium: The value of the utm_medium parameter (short m, medium)

  • source: The value of the utm_source parameter (short s, source)

  • term: The value of the utm_term parameter (short t, term)

  • version: The value of the utm_content parameter (short v, version)

  • other: The value of the other parameter

  • tags: A list of tags seen in a tags parameter

  • refsid (1.x only): The submission ID of a previous form submission used when daisy-chaining forms

Other:

  • userid: A random ID assigned to this user’s session.

  • country: Country of the user detected via Geo-IP

Note

Not all of these properties will be present or have values for every form submission. Please make sure your integration can deal with empty or non-existent values.

Opt-in data

Information about opt-ins is provided on optins. Each of the sub-objects represents the outcome of one opt-in component on the form. The keys of these objects can be ignored. Each object contains the following information:

  • channel: Which communication channel was opted-in to (e.g., email, phone, post, …)

  • operation: The meaning of the user input. One of: opt-in, no-change, opt-out

  • statement: The opt-in statement that was configured for the form component at the time it was submitted. This should represent the legally binding copy that the user accepted.

  • value: Similar to operation this represents the user’s choice, but it also includes the type of input element used (e.g., radios:opt-in). This is the actual value of the opt-in form component that is also visible in data.

  • address (only for email): The email address that was opted-in.

Legacy properties

Earlier 1.x versions of the event used a different format:

  • The submitted data was provided directly at the root of the event (without being nested in data).

  • Some of the properties were prefixed with an underscore (e.g., _optins).

Deprecated since version 1.1.0: These properties will be removed in 2.x.

Example data

# Event metadata this is the same for all event types.
id: 179
type: form_submission
version: 1.1.0
date: '2021-05-14T08:07:37'
# The form submission UUID is used to identify other events that belong to the
# same form submission (eg. form_submission_confirmed, payment_success).
uuid: ae3b0b49-e6db-4dc9-a0f1-d2be7f996ed3
is_draft: false
# Links to the form/action and to the form submission. Will be removed in version 2.x.
links:
  action: 'https://demo1.staging.campaignion.org/node/144'
  submission: 'https://demo1.staging.campaignion.org/node/144/submission/35202'
_links: # Copy of links for backwards compatibility.
# Opt-in data. The keys are for internal use only.
optins:
  '30':
    channel: post,
    operation: no-change,
    statement: ''
    value: 'checkbox:no-change'
  '31':
    channel: phone,
    operation: no-change
    statement: ''
    value: 'checkbox:no-change'
  '6':
    address: supporter@example.com
    channel: email
    ip_address: 1.1.1.1
    lists: ['mailchimp:a702e2babc', 'mailchimp:c9643a0edf']
    operation: opt-in
    statement: >
      This is the statement configured in the form-builder for this opt-in component.
      It should describe the exact language of what the user has opted-in into.
    trigger_opt_in_email: false
    trigger_welcome_email: false
    unsubscribe_all: false
    unsubscribe_unknown: false
    value: radios:opt-in
_optins: # Copy of optins for backwards compatibility. Removed in version 2.x.
# Data about the action
action:
  campaign_tags: []
  needs_confirmation: false
  source_tags: []
  tags: [testtag]
  title: Test petition
  type: petition
  type_title: Petition
  uuid: 5caa752e-723a-452b-8f0a-e014e7ba49f1
# Tracking data.
tracking:
  campaign: ''
  country: AT
  entry_url: https://demo1.staging.campaignion.org/
  external_referer: https://somewhere.example.com
  form_url: https://demo1.staging.campaignion.org/
  medium: ''
  other: ''
  referer: https://demo1.staging.campaignion.org/
  refsid: null
  source: ''
  tags: []
  term: ''
  user_id: 571b05d3
  version: ''
# Data submitted by the user as part of the form submission.
# Each component’s data can be found under the form-key configured in the form-builder.
data:
  city: London
  country: GB
  email: supporter@example.com
  first_name: First
  last_name: Last
  mobile_number: '12345'
  newsletter_subscription: radios:opt-in
  phone_number: '67890'
  phone_opt_in: checkbox:no-change
  post_opt_in: checkbox:no-change
  postcode: SW1A 1AA
  state: London
  street_address: Address 1
  street_address_2: Address 2
  title: Title 1
# Inline form data — deprecated as of version 1.1.0, will be removed in version 2.x
city: London
country: GB
email: supporter@example.com
first_name: First
last_name: Last
mobile_number: '12345'
newsletter_subscription: radios:opt-in
phone_number: '67890'
phone_opt_in: checkbox:no-change
post_opt_in: checkbox:no-change
postcode: SW1A 1AA
state: London
street_address: Address 1
street_address_2: Address 2
title: Title 1