# Amplitude Reference

Amplitude is a leading Product Analytics tool. After sending Freshpaint data to Amplitude, teams can harness the power of product analytics to drive better, data-driven business outcomes.

## Destination Info

* Accepts [Page](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#page), [Track](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#track), and [Identify](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#identify) calls
* Supports [HIPAA mode](https://documentation.freshpaint.io/hipaa-mode)
* Connection Modes:

<table><thead><tr><th width="158.33333333333331" align="right"> </th><th width="215" data-type="checkbox">Client-side</th><th data-type="checkbox">Server-side</th></tr></thead><tbody><tr><td align="right">Web</td><td>true</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>

## Identify

When you call [freshpaint.identify()](https://documentation.freshpaint.io/developer/freshpaint-sdk-reference#identify), Freshpaint will create or update a User profile in Amplitude by hitting [Amplitude's identify API endpoint ](https://www.docs.developers.amplitude.com/analytics/apis/identify-api/)at: [https://api.amplitude.com/identify.](https://api.amplitude.com/identify)

You can find identified Users from the [User Look-Up page](https://help.amplitude.com/hc/en-us/articles/229313067-Look-up-event-data-for-individual-users) in Amplitude.

### Amplitude Identification Parameters

The following Amplitude Identification Parameters are automatically set from Freshpaint Built-in properties:

| Freshpaint Built-in Property | Amplitude Identification Parameter |
| ---------------------------- | ---------------------------------- |
| `$user_id`                   | `user_id`                          |
| `$device_id`                 | `device_id`                        |
| `$os`                        | `os_name`                          |

In addition, the following Amplitude Identification Parameters, as defined at [Amplitude's identify API endpoint](https://www.docs.developers.amplitude.com/analytics/apis/identify-api/), are supported by [Freshpaint Identify User Properties](https://documentation.freshpaint.io/readme/setting-up-identify#attaching-user-properties). Any Freshpaint User Properties not specified in the table below will be included as user properties in Amplitude's `user_properties` object.

| Freshpaint User Property | Amplitude Identification Parameter |
| ------------------------ | ---------------------------------- |
| `app_version`            | `app_version`                      |
| `carrier`                | `carrier`                          |
| `city`                   | `city`                             |
| `country`                | `country`                          |
| `device_brand`           | `device_brand`                     |
| `device_manufacturer`    | `device_manufacturer`              |
| `device_model`           | `device_model`                     |
| `device_type`            | `device_type`                      |
| `dma`                    | `dma`                              |
| `language`               | `language`                         |
| `paying`                 | `paying`                           |
| `os_version`             | `os_version`                       |
| `platform`               | `platform`                         |
| `region`                 | `region`                           |
| `start_version`          | `start_version`                    |
| Any remaining properties | `user_properties`                  |

Note that each of these Freshpaint properties are case-sensitive.

## Events

When you send an event to Amplitude from Freshpaint, Freshpaint will create an event in Amplitude by hitting Amplitude's v1 event endpoint,  `https://api.amplitude.com/httpapi`

Events sent from Freshpaint to Amplitude will show up as standard Amplitude events. From there you can use your events in any of the Amplitude reports. You can find events associated to Users under the Event Stream section of a user profile page.

### Revenue Tracking: Properties

Amplitude allows you to perform Revenue LTV analysis by including revenue parameters on Amplitude events.

Freshpaint sets Amplitude's special revenue parameters, such as `revenue` and `quantity`, using properties included on the Freshpaint event.&#x20;

| Freshpaint Property | Amplitude Event parameter | Description                                       |
| ------------------- | ------------------------- | ------------------------------------------------- |
| `price`             | `price`                   | The price of products purchased (can be negative) |
| `quantity`          | `quantity`                | The quantity of products purchased                |
| `revenue`           | `revenue`                 | The revenue collected                             |
| `revenueType`       | `revenueType`             | The type of revenue (income, refund, etc.)        |
| `productId`         | `productId`               | An identifier for the product                     |

Note that each of these Freshpaint properties are case-sensitive.

### Other Amplitude Event parameters

The following Amplitude Event Parameters are automatically set from Freshpaint Built-in properties:

| Freshpaint Built-in Property | Amplitude Event Parameter |
| ---------------------------- | ------------------------- |
| `$user_id`                   | `user_id`                 |
| `$device_id`                 | `device_id`               |
| `$os`                        | `os_name`                 |
| `time`                       | `time`                    |

In addition, the following Amplitude Event Parameters, as defined at [Amplitude's HTTP API endpoint](https://www.docs.developers.amplitude.com/analytics/apis/http-v2-api/), are supported via Freshpaint Event Properties. Any Freshpaint Event Properties not specified in the table below will be included as event properties in Amplitude's `event_properties` object.

| Freshpaint Event Property | Amplitude Event parameter |
| ------------------------- | ------------------------- |
| `adid`                    | `adid`                    |
| `android_id`              | `android_id`              |
| `app_version`             | `app_version`             |
| `carrier`                 | `carrier`                 |
| `city`                    | `city`                    |
| `country`                 | `country`                 |
| `device_brand`            | `device_brand`            |
| `device_manufacturer`     | `device_manufacturer`     |
| `device_model`            | `device_model`            |
| `device_type`             | `device_type`             |
| `dma`                     | `dma`                     |
| `idfa`                    | `idfa`                    |
| `idfv`                    | `idfv`                    |
| `$ip`                     | `ip`                      |
| `language`                | `language`                |
| `location_lat`            | `location_lat`            |
| `location_lng`            | `location_lng`            |
| `paying`                  | `paying`                  |
| `os_version`              | `os_version`              |
| `platform`                | `platform`                |
| `region`                  | `region`                  |
| `start_version`           | `start_version`           |
| Any remaining properties  | `event_properties`        |

Note that each of these Freshpaint properties are case-sensitive.

### Configuration Options

#### Integration Settings / Options

Freshpaint allows you to configure custom integration settings with Amplitude. To do this, navigate to Destinations > Overview > Amplitude > Details and click "Configure" for Options.

This will open a modal where you can check the options you would like to enable and click "Save". The following options are available:

1. Force HTTPS

   Enabling this will ensure that events will always be uploaded to Amplitude's HTTPS endpoint. Otherwise, the SDK will use the current visitor's protocol.
2. Use Log Revenue API V2

   Enabling this option will track event properties with the revenue event. For example, you would be able to track a certain event and attach `price` and `quantity` properties to it. This feature will then log total revenue `(price*quantity)`
3. Use Freshpaint ID for Device ID

   Enable this setting to make the Amplitude javascript web SDK use the Freshpaint device ID. This improves data consistency - you'll see the same device id for data streamed from your customers' web browsers as for data backfilled from Freshpaint's servers.

{% hint style="warning" %}
Note: Changing "Use Freshpaint ID for Device ID" setting will break historical data, so only enable this if you're setting up a new Amplitude project.
{% endhint %}

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2F7RfIxFgyi26ytXjjD9yT%2FIntegration%20Settings%20Amplitude.png?alt=media&#x26;token=94c5ef3e-7208-4993-9b04-f76a441b0818" alt=""><figcaption></figcaption></figure>

#### Event Tracking Settings

Freshpaint allows you to configure custom event tracking settings with Amplitude. To do this Navigate to Destinations > Overview > Amplitude > Details and click "Configure" for Event Tracking.

This will open a modal where you can check the options you would like to enable and click "Save". The following options are available:

1. Track Referrer

   If enabled, Freshpaint will capture the user’s referrer, initial referrer, and referring domain, and send to Amplitude as user properties.
2. Track UTM Properties

   If enabled, Freshpaint will capture UTM properties from the URL or cookie, and send to Amplitude as user properties.
3. Track Google Click ID

   If enabled, Freshpaint will capture the Google Click ID, and send to Amplitude.
4. Save Referrer, URL Params, GCLID Once Per Session

   If enabled then Google Click ID, Referrer, and UTM params will be tracked only once per session. New values that come in during the middle of the user's session will be ignored. Disable to always capture new values.

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FOb4J6zy4Ip5cBlflrNiD%2Fimage.png?alt=media&#x26;token=ab96c5d8-54cf-4a11-be7f-a244e8dee340" alt=""><figcaption></figcaption></figure>

#### Batch Settings

Freshpaint allows you to configure batch settings with Amplitude. To do this, navigate to Destinations > Apps > Amplitude and click "Configure" for Batching. If enabled, Amplitude will send events in batches of Batch Threshold or every Batch Period milliseconds.

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FA6z6nXtJozSmp9ZVXjFf%2Fimage.png?alt=media&#x26;token=e5a5b201-7785-4d63-8e90-97ac5246f418" alt=""><figcaption></figcaption></figure>

#### Event Transformations

Set up transformations to modify your data before it's sent to your destination. Read more about transformations [here](https://documentation.freshpaint.io/transformations).

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FK6WG04hQZD1IMAfQFSjA%2Fimage.png?alt=media&#x26;token=ca652fec-4467-4521-9c88-cc347cf20479" alt=""><figcaption></figcaption></figure>

### UTM Parameters

UTM parameters are short pieces of code that can be added to links that include information about the link, which allows you to track user interactions with specific marketing campaigns.

In order to send UTM parameters to Amplitude, navigate to Destinations > Apps > Amplitude. Then click "Configure" for the "Event Tracking" setting:

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FEc06S92KKeTqdz5pbTnM%2FCONFIGURE.png?alt=media&#x26;token=ff93c4a2-a06f-486f-961c-45a24af8bc80" alt=""><figcaption></figcaption></figure>

Next, check the "Track UTM properties" box and click "Save".

<figure><img src="https://1666823438-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MA7aDqsXMFbUsWVqonF%2Fuploads%2FdWfPEPY7jA9MFrYl4moH%2FEvent%20Tracking%20Settings%20Amplitude.png?alt=media&#x26;token=7887d25f-8636-4a80-8e12-2032ba4d4a7b" alt=""><figcaption></figcaption></figure>

That's it! Now you'll see UTM parameters in Amplitude as user properties. You can read more about UTM parameters in Amplitude [here](https://www.docs.developers.amplitude.com/data/sdks/javascript/?h=utm#track-utm-parameters).
