# Dynamic Yield

[Dynamic Yield](https://www.dynamicyield.com) helps businesses deliver digital customer experiences that are personalized, optimized, and synchronized. This destination leverages the [Experience API](https://support.dynamicyield.com/hc/en-us/articles/360010686157-Experience-APIs-Overview) to track [meaningful events](https://dy.dev/reference/track-events), so you can use the information for behavioral targeting, reporting, setting optimization goals, recommendations, and audience building.

## Key features

The Dynamic Yield destination provides the following key features:

* **Events structure**: our [Events reference](https://community.commandersact.com/platform-x/developers/tracking/events-reference) covers [Dynamic Yield events](https://dy.dev/reference/track-events), meaning that your data is properly bridged to the expected fields in an optimized way.
* **Prebuilt mappings**: data mapping for event-based destinations happens automatically, which simplifies user inputs.
* **Refined data**: you can freely push additional information based on your specific needs (E.g. adding custom events and custom event properties).
* **Automatic hashing**: information is automatically hashed matching partner specifications.
* **Smart mapping**: data mapping can be readjusted using your datalayer defined fields.
* **Send all properties**: send all your event properties to Dynamic Yield with a single click.

## Destination setup

{% hint style="info" %}
Use [**Destination filters**](https://doc.commandersact.com/features/destinations/destination-filters) to refine events and/or other properties matching your specific needs.
{% endhint %}

### Configuration

<table><thead><tr><th width="300">Settings</th><th>Description</th></tr></thead><tbody><tr><td><code>Endpoint</code></td><td><em><strong><code>Required</code></strong></em><br>Select your endpoint data center: EU or US.</td></tr><tr><td><code>API Key</code></td><td><em><strong><code>Required</code></strong></em><br>Your API key as generated in Dynamic Yield interface. More details are available by following this <a href="https://support.dynamicyield.com/hc/en-us/articles/360022734893#create-an-api-key-0-1">LINK</a>.</td></tr><tr><td><code>User Identifier</code></td><td>User identifier generated by Dynamic Yield and managed, with their client-side tags, via cookies. More details are available by following this <a href="https://support.dynamicyield.com/hc/en-us/articles/4415087403281#making-api-requests-0-1">LINK</a> (See cookies <code>_dyid</code> and <code>_dyid_server</code>). When keeping "Default", the above two cookies are used to retrieve a value. Selecting "[Custom Property]", you can specify a property holding the related value. Regardless of the chosen option, If no value is available our standard property <code>user.consistent_anonymous_id</code> is used.</td></tr><tr><td><code>Custom Property</code></td><td>When selecting "[Custom Property]" with the above <code>User Identifier</code>, you can Input your custom property name holding the user identifier (E.g. <code>user.mycustomid</code>).</td></tr><tr><td><code>Send All Properties</code></td><td>When activating this option all properties included in the root of your Commanders Act events are also sent to Dynamic Yield in the <code>properties</code> object. Properties with child/sub properties are converted into a single one using the underscore character "_" as separator (E.g. device_lifecycle_last_session_start).</td></tr><tr><td><code>Custom Event Properties</code></td><td>Map your custom event properties by setting their field names in <code>Dynamic Yield property name</code> and adding its value in <code>Your value</code>.</td></tr><tr><td><code>Event Mapping</code></td><td>Change the standard mapping (See <a href="#quick-reference">Quick reference</a>) between Dynamic Yield's events and yours or add new mappings.</td></tr></tbody></table>

## Quick reference

| Commanders Act Events                                                                                      | Dynamic Yield Types (dyType) |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------- |
| `add_to_cart`                                                                                              | `add-to-cart-v1`             |
| `add_to_wishlist`                                                                                          | `add-to-wishlist-v1`         |
| `generate_lead`                                                                                            | `newsletter-subscription-v1` |
| `login`                                                                                                    | `login-v1`                   |
| `purchase`                                                                                                 | `purchase-v1`                |
| `remove_from_cart`                                                                                         | `remove-from-cart-v1`        |
| `search`                                                                                                   | `keyword-search-v1`          |
| `sign_up`                                                                                                  | `signup-v1`                  |
| <p><code>video\_start</code></p><p><code>video\_complete</code></p><p><code>video\_ad\_complete</code></p> | `video-watch-v1`             |
| `[Any Other Event]` **\[1]**                                                                               | `[Not Set]` **\[2]**         |

{% hint style="info" %}

> **1.** Custom events are also supported.\
> **2.** Dynamic Yield custom events don't have a type. More details are available following this [LINK](https://support.dynamicyield.com/hc/en-us/articles/4414379007633-Reporting-Events#custom-events-0-3). See <mark style="color:blue;">`Event Mapping`</mark> in [Configuration](#configuration) for more details.
> {% endhint %}

## Field mappings

{% hint style="info" %}
Most properties can be remapped using our "Smart Mapping" feature.
{% endhint %}

<table><thead><tr><th width="404.6685580062746">Commanders Act Properties</th><th>Dynamic Yield Properties</th></tr></thead><tbody><tr><td><code>User Identifier</code></td><td><p><code>user.dyid</code></p><p><code>user.dyid_server</code></p></td></tr><tr><td><code>partners.dy.session_id</code></td><td><code>session.dy</code> <strong>[1]</strong></td></tr><tr><td><code>context.device.ip</code></td><td><code>context.device.ip</code></td></tr><tr><td><code>event_name</code></td><td><code>events[0].name</code></td></tr><tr><td><code>(event_name)</code></td><td><code>dyType</code> <strong>[2][3]</strong></td></tr><tr><td><code>value</code></td><td><code>value</code> <strong>[2]</strong></td></tr><tr><td><code>currency</code></td><td><code>currency</code> <strong>[2]</strong></td></tr><tr><td><code>items.0.id</code></td><td><code>productId</code> <strong>[2][4]</strong></td></tr><tr><td><code>items.0.quantity</code></td><td><code>quantity</code> <strong>[2][4]</strong></td></tr><tr><td><code>items.X.id</code></td><td><code>cart.X.productId</code> <strong>[2]</strong></td></tr><tr><td><code>items.X.quantity</code></td><td><code>cart.X.quantity</code> <strong>[2]</strong></td></tr><tr><td><code>items.X.product.price</code></td><td><code>cart.X.itemPrice</code> <strong>[2]</strong></td></tr><tr><td><code>id</code></td><td><code>uniqueTransactionId</code> <strong>[2]</strong></td></tr><tr><td><code>user.email</code></td><td><code>hashedEmail</code> <strong>[2]</strong></td></tr><tr><td><code>(event_name)</code></td><td><code>progress</code> <strong>[2][5]</strong></td></tr><tr><td><code>search_term</code></td><td><code>keywords</code> <strong>[2]</strong></td></tr><tr><td><code>Your event property</code></td><td><code>Dynamic Yield property name</code> <strong>[6]</strong></td></tr></tbody></table>

{% hint style="info" %}

> **1.** if no property is provided, the cookie <mark style="color:blue;">`_dyjsession`</mark> is used.\
> **2.** This property is set in <mark style="color:blue;">`events[0].properties`</mark>.\
> **3.** See [Quick reference](#quick-reference) for more details.\
> **4.** Included for [add\_to\_cart](https://doc.commandersact.com/developers/tracking/events-reference#add_to_cart), [remove\_from\_cart](https://doc.commandersact.com/developers/tracking/events-reference#remove_from_cart) and [add\_to\_wishlist](https://doc.commandersact.com/developers/tracking/events-reference#add_to_wishlist) events.\
> **5.** Set with <mark style="color:blue;">`VIDEO_STARTED`</mark> , <mark style="color:blue;">`VIDEO_FINISHED`</mark> or <mark style="color:blue;">`PREROLL_FINISHED`</mark> depending if the event name is [video\_start](https://doc.commandersact.com/developers/tracking/events-reference/video-event-reference#video-playback-started), [video\_complete](https://doc.commandersact.com/developers/tracking/events-reference/video-event-reference#video-playback-completed) or [video\_ad\_complete](https://doc.commandersact.com/developers/tracking/events-reference/video-event-reference#video-a-d-completed) respectively.\
> **6.** See <mark style="color:blue;">`Custom Event Properties`</mark> in [Configuration ](#configuration)for more details on how you can send custom properties to Dynamic Yield.
> {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.commandersact.com/features/destinations/destinations-catalog/dynamic-yield.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
