> For the complete documentation index, see [llms.txt](https://docs.msquared.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.msquared.io/integrations/analytics/send-events-from-unreal.md).

# Send Events from Unreal

## Overview

<figure><img src="/files/6UPsZFbvmbSmmeIFXozY" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Before following this guide, we recommend downloading [this folder](https://github.com/msquared-io/msquared-mixpanel/tree/main/Mixpanel) from our Mixpanel repository, which contains pre-made assets that you can drop into your map to immediately start sending different test events.
{% endhint %}

In order to send events from your packaged editor, you should use the`/import` mixpanel ingestion api ([documentation found here](https://developer.mixpanel.com/reference/import-events)). The url is either:

* `https://api.mixpanel.com/import` , or:
  * `https://api-eu.mixpanel.com/import`

depending on the location you selected for your data storage.

## Blueprint Implementation for Sending Mixpanel Events

A mixpanel event must contain 2 specific values: an **event name**, and a set of **properties:**

```
{
  "event": "Signed up",
  "properties": {
    "time": 1618716477000,
    "distinct_id": "91304156-cafc-4673-a237-623d1129c801",
    "$insert_id": "29fc2962-6d9c-455d-95ad-95b84f09b9e4",
  }
}
```

In properties, you must include:

* `time` (of when the event was sent)
* `distinct_id` (to identify unique users)
* `$insert_id`(a unique id for the event)

We have a number of helpful json nodes to help you construct this in blueprints. To get started:

1. Construct a Json object, and set the above values:

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/92fa7408-70a7-4d05-b5ba-22876d582557>" %}

2. You can add additional properties alongside the required fields, which can contain important metadata that you might want to retrieve from a particular event:

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/84407793-da96-4f15-8972-b2125cb2af1f>" %}

3. To complete setting up the request body, create a new Json Object from a custom Mixpanel event struct (this will only contain a string member named event).
4. You can then set the properties field on this new json object, as shown below (note: the api body must be in the form of a json array as each request can accept up to 2000 different events):

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/29db5680-3bd9-4e91-a3b8-ccad633ff3cd>" %}

5. Finally, set up the required authorization header. You should copy the previously stored basic auth value generated from your project token and use this in this step. Use the `Send Http Request` node to POST your request to the import api:

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/838f461e-00c7-4874-8ae3-491d6f0dfe63>" %}

### Full Blueprint Example

{% @blueprintue-embed/embed url="<https://nextjs-boilerplate-jl63.vercel.app/dc1cedf9-4b8a-43b6-a5aa-6be2b14e6ee2>" %}
