> ## Documentation Index
> Fetch the complete documentation index at: https://data-foundation.rockerbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending Rockerbox Survey Data

> Learn how to send post-purchase survey response data to Rockerbox

You can send Rockerbox your customers' survey response data via an onsite pixel, server-side event, or batch file.

If you collect this information prior to or during the purchase, you will add information to the purchase conversion. If you are collecting this as a post-purchase survey, you will set this up to fire after the survey response.

This setup is similar to setting up a conversion pixel, with some minor differences.

## Post-Purchase Survey Partners

Rockerbox has pre-built integrations with common post-purchase survey providers, automating the flow of survey data to Rockerbox. See more info on setup per platform below:

* [Fairing](/supported-integrations/marketing/post-purchase-survey/fairing)

## Requirements

You need to be able to add or modify an onsite pixel, server-side event, or batch file that contains survey response information, including:

* Survey Question
* Survey Response
* At least one of the following: `external_id`, `email`, `order_id`

If you are passing the event via onsite pixel, you will also need to pass the survey response information in the data layer at the time the pixel fires.

## Modify an Existing Event

In cases where you have the survey response prior to or during the purchase, you will need to modify your existing purchase event to include these additional parameters:

* `post_purchase_question`
* `post_purchase_response`

## Create a Post-Purchase Survey via Pixel

If you conduct your survey after purchase, you will need to fire a new onsite pixel. Your Rockerbox survey pixel can be created using your All Pages pixel. The All Pages pixel is available in the Rockerbox Attribution platform:

1. Click **Settings** in the top navigation bar
2. Click **Pixels**
3. Copy your **All Pages** pixel text. It will look like the example below:

```html theme={null}
<script type="text/javascript">
(function(d,RB) {if (!window.RB) { window.RB=RB;RB.queue=RB.queue||[];RB.track=RB.track||function(){RB.queue.push(Array.prototype.slice.call(arguments))};RB.initialize=function(s){RB.source=s};var a = d.createElement("script"); a.type="text/javascript"; a.async=!0; a.src="https://getrockerbox.com/assets/wxyz.v2.js"; f=d.getElementsByTagName("script")[0]; f.parentNode.insertBefore(a,f);} } )(document,window.RB || {});
RB.disablePushState=true;
RB.initialize(CLIENT_AUTH_ID);
RB.track("view");
</script>
```

4. Edit the pixel action from `RB.track("view")` to the following:

```javascript theme={null}
RB.track("conv.post_purchase_survey",{
  "post_purchase_question": {{Rockerbox -- Survey Question}},
  "post_purchase_response": {{Rockerbox -- Survey Response}},
  "external_id": {{Rockerbox -- User_Id}},
  "email": {{Rockerbox -- email address}},
  "order_id": {{Rockerbox -- Order Id}}
});
```

## Create a Post-Purchase Survey via Server-Side Event

If you are passing the event to Rockerbox via webhooks, pass the event as JSON:

```json theme={null}
{
  "email": "example@yourdomain.com",
  "post_purchase_question": "How did you hear about us?",
  "post_purchase_response": "google",
  "timestamp": "2021-07-09T22:16:54.060Z"
}
```

## Create a Post-Purchase Survey via Separate Batch File

If users complete the survey as a separate step from the conversion event, send those responses to Rockerbox as a separate batch file. Contact [support@rockerbox.com](mailto:support@rockerbox.com) for details on setting up the file transfer.

The report needs to contain the following:

| Field Name               | Description                                                   |
| ------------------------ | ------------------------------------------------------------- |
| `email`                  | One of `email`, `external_id`, or `order_id` must be included |
| `external_id`            | One of `email`, `external_id`, or `order_id` must be included |
| `order_id`               | One of `email`, `external_id`, or `order_id` must be included |
| `timestamp`              | UTC ISO 8601 format                                           |
| `post_purchase_question` | Needed to help differentiate different questions              |
| `post_purchase_response` | The survey response the user entered                          |

## Create a Post-Purchase Survey via Same Batch File

If users complete the survey as part of the conversion flow and you are already sending a batch file for that conversion, include additional survey columns to the batch file to send the survey response to Rockerbox.

| Field Name               | Description                                                                                                      |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------- |
| `email`                  | One of `email`, `external_id`, or `order_id` must be included. This should already be included in the batch file |
| `external_id`            | One of `email`, `external_id`, or `order_id` must be included. This should already be included in the batch file |
| `order_id`               | One of `email`, `external_id`, or `order_id` must be included. This should already be included in the batch file |
| `timestamp`              | UTC ISO 8601 format. This should already be included in the batch file                                           |
| `post_purchase_question` | Needed to help differentiate different questions                                                                 |
| `post_purchase_response` | The survey response the user entered                                                                             |
