# Event payload shape

When sending [analytics events](https://docs.formsort.com/integrations/getting-data-out/analytics), you have control over the shape of the payload received by the destination.

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FxZyX1M0J8JdCokJwqn0t%2Fimage.png?alt=media&#x26;token=c4320881-cc4b-4081-9672-6a08fea4485c" alt=""><figcaption><p>Payload shape configurations for the Google Tag Manager analytics integration.</p></figcaption></figure>

## Allowing answer sending

### Send answers

By default, answers are not included in analytics event payloads. This way, analytics providers can be used for tracking conversion and performance, without sending user data to third parties.

If **send answers** is checked, answer values will be nested in an "answers" object of the event payload.

### Send PII

If **send answers** is enabled, **send PII** will also send Personally Identifying Information along to the analytics provider. Answers are marked as PII using the [data classification](https://docs.formsort.com/response-data-collection-and-management/variable-schema#semantic-meaning) in the schema editor.

### Only send answers from current step

If **only send answers from current step** is enabled, the payload will only contain answers to questions that appear on the current step.

{% hint style="info" %}
When sending answers from the current step, by default you will not receive any answers that are present at the beginning of the flow, such as [external answers](https://docs.formsort.com/response-data-collection-and-management/variable-schema/external-answers).

To instead send the current, full state of the flow on load, enable **Send all answers on FlowLoaded**, which will include the entire answer state in the FlowLoaded event's answer payload.
{% endhint %}

## Payload shape

All analytics events will contain the flow label, variant label, variant revision UUID, and responder UUID.

```javascript
{
  "first_name": "John Doe",
  "flowLabel": "<FLOW_LABEL>",
  "variantLabel": "<VARIANT_LABEL>",
  "variantUuid": "<VARIANT_UUID>",
  "responderUuid": "<RESPONDER_UUID>"
}
```

### Answers at root

With **answers at root** checked, all the answer keys will be at the same level of nesting within the payload object.

```javascript
{
  "address.raw": "123 Test St, Beverly Hills, CA 90210",
  "address.address_1": "123 Test St",
  "address.city": "Beverly Hills",
  "address.state": "CA",
  "address.postal_code": "90210",
  "utm_source": "facebook_ad",
  "first_name": "John Doe",
  "flowLabel": "<FLOW_LABEL>",
  "variantLabel": "<VARIANT_LABEL>",
  "variantUuid": "<VARIANT_UUID>",
  "responderUuid": "<RESPONDER_UUID>"
}
```

If unchecked, the answers will be nested within an `answers` object.

```javascript
{
  "answers": {
    "address.raw": "123 Test St, Beverly Hills, CA 90210",
    "address.address_1": "123 Test St",
    "address.city": "Beverly Hills",
    "address.state": "CA",
    "address.postal_code": "90210",
    "utm_source": "facebook_ad",
    "first_name": "John Doe"
  },
  "flowLabel": "<FLOW_LABEL>",
  "variantLabel": "<VARIANT_LABEL>",
  "variantUuid": "<VARIANT_UUID>",
  "responderUuid": "<RESPONDER_UUID>"
}
```

### Flatten answer keys

With **flatten answer keys** checked, nested answers, like arrays and objects, will be at the same level of nesting as all other answers:

```javascript
{
  "answers": {
    "address.city": "Beverly Hills"
  }
}
```

With **flatten answer keys** unchecked, nested answers will remain in their original, nested shape.

```javascript
{
  "answers": {
    "address": {
      "city": "Beverly Hills"
    }
  }
}
```

### Stringify answers

When **stringify answers** is checked, the `answers` key itself will be a JSON string of the answers, rather than the nested object.

```javascript
{
  "flowLabel": "<FLOW_LABEL>",
  "variantLabel": "<VARIANT_LABEL>",
  "variantUuid": "<VARIANT_UUID>",
  "responderUuid": "<RESPONDER_UUID>",
  "answers": "{\"address.raw\":\"123 Test St, Beverly Hills, CA 90210\",\"address.address_1\":\"123 Test St\",\"address.city\":\"Beverly Hills\",\"address.state\":\"CA\",\"address.postal_code\":\"90210\",\"utm_source\":\"facebook_ad\",\"first_name\":\"John Doe\"}"
}
```
