# Sales/Conversion Tracking - Video Tiles

<figure><img src="/files/yXT0UCysxbnZ7ofoRNHN" alt="" width="128"><figcaption><p>Sales Conversion Tracking</p></figcaption></figure>

‘**saleassistVideoTiles.track**’ Function Documentation

**Description**

The **saleassistVideoTiles.track** function is a utility function in JavaScript that allows you to trigger custom events with specific data. It takes an event name as a string and an optional data object as parameters. When called, the **saleassistVideoTiles.track** function dispatches a custom event with the given name and the provided data, making it possible to capture custom events in your JavaScript applications.

**Parameters**

* **eventName** (String): The name of the custom event to be dispatched. It should be a string representing the event's name.
* **data** (Objectl): A data object to be passed along with the custom event. This data can be used by event listeners to access additional information related to the event.<br>

**Usage**

Here's an example of how to use the **saleassistVideoTiles.track** function for **Product Click**:

```javascript
// Example: Triggering an event with data
const eventData = {
        'actionField': {'list': 'Search Results'}, // Optional list property.
        'products': [{
          'name': productObj.name,
          'id': productObj.id,
          'price': productObj.price,
          'brand': productObj.brand,
          'category': productObj.cat,
          'variant': productObj.variant,
          'position': productObj.position
        }]
    };
saleassistVideoTiles.track("productClick", eventData, [playlistID_1 , playlistID_2])
```

Here's an example of how to use the **saleassistVideoTiles.track** function for **Product Detail**:

```javascript
// Example: Triggering an event with data
const eventData = {
      'actionField': {'list': 'Apparel Gallery'},    // 'detail' actions have an optional list property.
      'products': [{
        'name': 'Triblend Android T-Shirt', 
        'id': '12345',
        'price': '15.25',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Gray'
      }]
    };
saleassistVideoTiles.track("productDetail", eventData, [playlistID_1 , playlistID_2])
```

\
Here's an example of how to use the **saleassistVideoTiles.track** function for **Add To Cart**:

```javascript
// Example: Triggering an event with data
const eventData = {
    'currencyCode': 'EUR',
    'add': {                                // 'add' actionFieldObject measures.
      'products': [{                        //  adding a product to a shopping cart.
        'name': 'Triblend Android T-Shirt',
        'id': '12345',
        'price': '15.25',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Gray',
        'quantity': 1
      }]
    },
    'source_referrer': 'domain.com'
  };
saleassistVideoTiles.track("addToCart", eventData, [playlistID_1 , playlistID_2])
```

Here's an example of how to use the **saleassistVideoTiles.track** function for **Promotion Clicks**:

```javascript
// Example: Triggering an event with data
const eventData = {
      'promotions': [                     // Array of promoFieldObjects.
      {
        'id': 'JUNE_PROMO13', 
        'name': 'June Sale',
        'creative': 'banner1',
        'position': 'slot1'
      }]
    };
saleassistVideoTiles.track("promotionClick", eventData, [playlistID_1 , playlistID_2])
```

Here's an example of how to use the **saleassistVideoTiles.track** function for **Checkout**:

```javascript
// Example: Triggering an event with data
const eventData ={
        'actionField': {'step': 1, 'option': 'Visa'},
        'products': [{
          'name': 'Triblend Android T-Shirt',
          'id': '12345',
          'price': '15.25',
          'brand': 'Google',
          'category': 'Apparel',
          'variant': 'Gray',
          'quantity': 1
      }]
    };
saleassistVideoTiles.track("checkout", eventData, [playlistID_1 , playlistID_2])
```

Here's an example of how to use the **saleassistVideoTiles.track** function for **Measuring Purchases**:

```javascript
// Example: Triggering an event with data
const eventData ={
      'actionField': {
        'id': 'T12345', // Transaction ID. Required for purchases and refunds.
        'affiliation': 'Online Store',
        'revenue': '35.43', // Total transaction value (incl. tax and shipping)
        'tax':'4.90',
        'shipping': '5.99',
        'coupon': 'SUMMER_SALE'
      },
      'products': [{       // List of productFieldObjects.
        'name': 'Triblend Android T-Shirt',
        'id': '12345',
        'price': '15.25',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Gray',
        'quantity': 1,
        'coupon': ''  // Optional fields may be omitted or set to empty string.
      },
      {
        'name': 'Donut Friday Scented T-Shirt',
        'id': '67890',
        'price': '33.75',
        'brand': 'Google',
        'category': 'Apparel',
        'variant': 'Black',
        'quantity': 1
      }]
    };
saleassistVideoTiles.track("purchase", eventData, [playlistID_1 , playlistID_2])
```

Here's an example of how to use the **saleassistVideoTiles.track** function for **Measuring Refunds**:

```javascript
// Example: Triggering an event with data
const eventData ={
      'actionField': {'id': 'T12345'}         // Transaction ID. Required for purchases and refunds.
    };
saleassistVideoTiles.track("refund", eventData, [playlistID_1 , playlistID_2])
```

Here's an example of how to use the **saleassistVideoTiles.track** function for **Partial Refunds**:

```javascript
// Example: Triggering an event with data
const eventData ={
      'actionField': {'id': 'T12345'},        // Transaction ID.
      'products': [
            {'id': 'P4567', 'quantity': 1},   // Product ID and quantity. Required for partial refunds.
            {'id': 'P8901','quantity': 2}
      ]
    };
saleassistVideoTiles.track("refund", eventData, [playlistID_1 , playlistID_2])
```

Thank you !!!

\
**Questions?**

Please feel free to reach out via <mark style="color:blue;"><support@saleassist.ai></mark> if you need any help.


---

# 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://docs.saleassist.ai/integration-guide/sales-conversion-tracking-video-tiles.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.
