# AppLovin Event API Reference

{% hint style="warning" %}
The AppLovin Event API destination is currently in Early Access. Please contact <support@freshpaint.io> for more information about this integration.
{% endhint %}

## Destination Info

* Supports [Track](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#track) calls
* Supports [HIPAA mode](https://documentation.freshpaint.io/hipaa-mode)
* Refer to this destination as **AppLovin** in the [Integrations object](https://documentation.freshpaint.io/reference/developer/freshpaint-sdk-reference#using-the-integrations-object)
* Connection Modes:

<table><thead><tr><th width="200.33333333333331" align="right"> </th><th data-type="checkbox">Client-side</th><th data-type="checkbox">Server-side</th></tr></thead><tbody><tr><td align="right">Web</td><td>false</td><td>true</td></tr><tr><td align="right">Mobile</td><td>false</td><td>true</td></tr><tr><td align="right">Server</td><td>false</td><td>true</td></tr></tbody></table>

This is a reference document for the AppLovin destination. For information on how to set up this integration, see the [applovin-event-api-quick-start-guide](https://documentation.freshpaint.io/integrations/destinations/direct-response-ads/applovin-event-api-early-access/applovin-event-api-quick-start-guide "mention").

## Events

When you send an event to the AppLovin Event API destination from Freshpaint, Freshpaint will create an event in the AppLovin event manager by hitting AppLovin's API.

### Event Properties

<table data-full-width="true"><thead><tr><th width="179.2666015625">Freshpaint property</th><th width="191.19317626953125">AppLovin parameter</th><th width="255.7099609375">Type</th><th width="130.4307861328125">Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>$aleid</code></td><td><code>aleid</code></td><td>string</td><td><mark style="color:$danger;"><strong>Required</strong></mark></td><td>The clickID of the event, from the <code>?aleid</code> query parameter.</td></tr><tr><td><code>applovin_event_name</code></td><td><code>name</code></td><td>string</td><td><mark style="color:$danger;"><strong>Required</strong></mark></td><td><p>The AppLovin event name to track. *See below Events Reference for all values.</p><p></p><p>Note: If this property is absent, Freshpaint will attempt to use the name of the Freshpaint event. This will only work if the Freshpaint event name is one of the specific supported AppLovin names, so we recommend sending event name separately.</p></td></tr><tr><td><code>$time</code></td><td><code>event_time</code></td><td>number</td><td><mark style="color:$danger;"><strong>Required</strong></mark></td><td>The current Unix epoch time in milliseconds.<br><br>Freshpaint will autofill this value if missing.</td></tr><tr><td><code>dedupe_id</code></td><td><code>dedupe_id</code></td><td>string</td><td><mark style="color:$danger;"><strong>Required</strong></mark></td><td>Unique identifier for the event, used for deduplication.<br><br>Freshpaint will autofill this value if <code>dedupe_id</code> is not explicitly provided.</td></tr><tr><td><code>event_source_url</code></td><td><code>event_source_url</code></td><td>string</td><td><mark style="color:$danger;"><strong>Required</strong></mark></td><td>The URL where the event occurred, must start with "http://" or "https://".<br><br>Freshpaint will use the Freshpaint SDK's built in <code>$current_url</code> with the full URL redacted if <code>event_source_url</code> is not provided.</td></tr><tr><td><code>$ip</code></td><td><code>client_ip_address</code></td><td>string</td><td><mark style="color:$danger;"><strong>Required</strong></mark></td><td>The IP address of the user from the browser where the event was performed.<br><br>Freshpaint will use the Freshpaint SDK's built in <code>$ip</code> value from the browser event.</td></tr></tbody></table>

### Events Reference

The AppLovin / Axon Event API has a number of specific event types and corresponding values required for each of those event types.  You can view the [full list of details in their documentation](https://support.axon.ai/en/growth/promoting-your-websites/axon-pixel-integration/events-and-objects).

**Valid Event Names:**

* add\_to\_cart
* add\_payment\_info
* begin\_checkout
* generate\_lead
* login
* purchase
* page\_view
* remove\_from\_cart
* search
* sign\_up
* subscribe
* view\_cart
* view\_item

**Required event fields**

Many of the events have required fields if that type of event is sent. For example:

1. `items` must be provided for `view_item`, `add_to_cart`, `begin_checkout`, and `remove_from_cart`.
2. `value` must be provided for `begin_checkout` and `purchase`
3. `currency`, `shipping` , `tax` , and `transaction_id`  are also required for `purchase` events.
4. `searchTerm` must be provided for `search`&#x20;

**Example**

An example set of these properties might look like:

```json
{
    "currency": "USD",
    "items": [
        {"item_id": "abc-123", "item_category_id": 111}
    ],
    "value": 1200
}
```

### User Data Properties

When you send events to AppLovin they will attempt to match those actions to a particular user in AppLovin.

{% hint style="warning" %}
Note: although listed as Recommended, **at least one of the following user properties is required by AppLovin:** `client_id`, `axwrt`, and `alart`.
{% endhint %}

<table data-full-width="true"><thead><tr><th width="160.6484375">Freshpaint property</th><th>AppLovin parameter</th><th>Type</th><th>Requirement</th><th>Description</th></tr></thead><tbody><tr><td><code>$device_id</code></td><td><code>client_id</code></td><td>string</td><td><mark style="color:$success;">Recommended*</mark></td><td><p>A stable first-party identifier that should be unique to the user.</p><p></p><p>Freshpaint provides this value with from a cookie set by the Freshpaint SDK.</p></td></tr><tr><td><code>axwrt</code></td><td><code>axwrt</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>A custom value typically set by the Axon native Pixel.<br><br>This is not needed with Freshpaint as long as the $device_id is used, which is provided by default with the Freshpaint SDK.</td></tr><tr><td><code>alart</code></td><td><code>alart</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>A custom value typically set by the Axon native Pixel.<br><br>This is not needed with Freshpaint as long as the $device_id is used, which is provided by default with the Freshpaint SDK.</td></tr><tr><td><code>$user_agent</code></td><td><code>client_user_agent</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>The user agent of the browser.</td></tr><tr><td><code>$session_id</code></td><td><code>session_id</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>The ID of the user session.</td></tr><tr><td><code>esi</code></td><td><code>esi</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>Source of event. <code>app</code> or <code>web</code>.<br><br>Freshpaint will default this to <code>web</code>.</td></tr><tr><td><code>ifa</code></td><td><code>ifa</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>The user’s identifier for advertisers. <code>idfa</code> or <code>gaid</code></td></tr><tr><td><code>idfv</code></td><td><code>idfv</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>The user’s identifier for vendors</td></tr><tr><td><code>os</code></td><td><code>os</code></td><td>string</td><td><mark style="color:$info;">Optional</mark></td><td>The user’s operating system: <code>ios</code>, <code>android</code>, or <code>desktop_os</code>.</td></tr></tbody></table>
