> ## 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

You can send Rockerbox your customers’ survey response data via an onsite pixel and batch file.

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

This setup is similar to setting up a [Conversion Pixel](https://data-foundation.rockerbox.com/data-sources/first-party-integrations/online-conversion-events/conversion-tracking-methods/google-tag-manager/gtm-manual-tag-setup-not-preferred/gtm-conversion.md), with some minor differences.

### Post Purchase Survey Partners

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

* [ Fairing](https://help.rockerbox.com/article/g0lgxav24m)

### Requirements

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

* **Survey Question**
* **Survey Response**

And *at least* one of the following:

* **external\_id**
* **email**
* **order\_Id**

If you’re 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, then 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, then 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:

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

```text 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>
```

Edit the pixel action:

```text theme={null}
RB.track("view");
```

```text 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’re passing the event to Rockerbox via Webhooks, pass the event as JSON like below:

```json theme={null}
{
  "email": "doMoreWithLess@rockerbox.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, then send those responses to Rockerbox as a separate batch file. See [Sending Files to Rockerbox](https://data-foundation.rockerbox.com/rockerbox-for-partners/integration-documentation-for-marketing-partners/report-delivery-requirements.md) for more details on setting up the file transfer.

The report needs to contain the following:

<table><tbody><tr><td>Field Name</td><td>Description</td></tr><tr><td>email</td><td>one of `email`, `external_id`, or `order_id` need to be included</td></tr><tr><td>external\_id</td><td>one of `email`, `external_id`, or `order_id` need to be included</td></tr><tr><td>order\_id</td><td>one of `email`, `external_id`, or `order_id` need to be included</td></tr><tr><td>timestamp</td><td>UTC 8601 standard</td></tr><tr><td>post\_purchase\_question</td><td>Needed to help differentiate different questions</td></tr><tr><td>post\_purchase\_response</td><td>The survey response the user entered.</td></tr></tbody></table>

### 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, then include additional survey columns to the batch file to send the survey response to Rockerbox.

<table><tbody><tr><td>Field Name</td><td>Description</td></tr><tr><td>email</td><td>one of `email`, `external_id`, or `order_id` need to be included. This should already be included in the batch file.</td></tr><tr><td>external\_id</td><td>one of `email`, `external_id`, or `order_id` need to be included. This should already be included in the batch file.</td></tr><tr><td>order\_id</td><td>one of `email`, `external_id`, or `order_id` need to be included. This should already be included in the batch file.</td></tr><tr><td>timestamp</td><td>UTC 8601. This should already be included in the batch file.</td></tr><tr><td>post\_purchase\_question</td><td>Needed to help differentiate different questions</td></tr><tr><td>post\_purchase\_response</td><td>The survey response the user entered.</td></tr></tbody></table>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.