Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
CDPCloud Portal
Sitecore CDP Developer Documentation
  • Developing with Sitecore CDP
            • Boxever.eventCreate(event, callback, format)
            • Boxever.callFlows(flow, callback)
            • Boxever.addUTMParams(event)
            • Boxever.browserCreate(object, callback, format)
            • Boxever.browserShow(browserId, clientKey, callback, format)
            • Boxever.getBucketNumber([callback])
            • Boxever.getClientKey()
            • Boxever.getCookie(cookieName)
            • Boxever.getID()
            • Boxever.reset()
            • Boxever.setCookie(cookieName, cookieValue[, expiresIn])
            • Boxever.templating()
            • Boxever.triggerExperiences()
        • Troubleshooting
        • Release notes
  1. Functions
  1. Stream API
  2. Functions
  3. Boxever.addUTMParams(event)

Boxever.addUTMParams(event)

The addUTMParams() function adds every UTM parameter from the URL of the current webpage to the event object.

Parameters

Parameter

Type

Description

Note

event

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:

_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:

{ 
    ...,
    "utm_source":"newsletter",
    "utm_medium":"email",
    "utm_campaign":"summer_sale",
    "utm_term":"running shoes"
}
If you have suggestions for improving this article, let us know!

Documentation Assistant

This assistant uses AI to generate responses based on Sitecore documentation. While it has access to official sources, answers may be incomplete or inaccurate and should not be considered official advice or support.
Powered by
k
kapa.ai
Protected by reCAPTCHA

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use