---
title: "Boxever.addUTMParams(event)"
slug: "bx-addutmparams"
abstract: "Describes the addUTMParams() function in the Boxever JavaScript Library (Sitecore CDP Stream API)."
---
# Boxever.addUTMParams(event)

The `addUTMParams()` function adds every [UTM parameter](https://en.wikipedia.org/wiki/UTM_parameters) from the URL of the current webpage to the event object.

## Parameters

| Parameter | Type | Description | Note |
| --- | --- | --- | --- |
| [`event`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/bx-js-library-legacy-reference/functions-1166463/event-object.html) | object | All the event data. | N/A |

## Return value

none

## Example

Here's an example of UTM parameters:

`https://myretailsite.com?utm_source=newsletter&utm_medium=email&utm_campaign=summer_sale&utm_term=running+shoes`

By default, the event object does not include UTM parameters. To add the UTM parameters to the event object, pass the event object to the `addUTMParams()` function:

```javascript
_boxeverq.push(() => {
    const viewEvent = {...};
    Boxever.addUTMParams(viewEvent); // pass the event object to addUTMParams()
    Boxever.eventCreate(
        viewEvent,
        () => {},
        "json"
    );
});

```

The event data that is sent to Sitecore CDP now includes all UTM parameters:

```json
{
    ...,
    "utm_source":"newsletter",
    "utm_medium":"email",
    "utm_campaign":"summer_sale",
    "utm_term":"running shoes"
}

```