conversion: make event ID optional

This commit is contained in:
Elijah Duffy
2025-12-18 22:04:10 -08:00
parent 6692338b83
commit 764da5db2e
2 changed files with 3 additions and 3 deletions

View File

@@ -113,11 +113,11 @@ export class ConversionControl {
const event = new ServerEvent()
.setEventName(eventName)
.setEventTime(Math.floor(Date.now() / 1000))
.setEventId(details.eventID)
.setUserData(buildUserData(details.userData))
.setActionSource(details.actionSource);
if (details?.eventSourceURL) event.setEventSourceUrl(details.eventSourceURL);
if (details.eventID) event.setEventId(details.eventID);
if (details.eventSourceURL) event.setEventSourceUrl(details.eventSourceURL);
if (params) {
const customData = buildCustomData(params);
event.setCustomData(customData);

View File

@@ -51,7 +51,7 @@ export type ConversionEventParams = {
* Parameters for sending a conversion event to Meta Pixel.
*/
export type ConversionEventDetails = {
eventID: string;
eventID?: string;
actionSource: 'website' | 'app' | 'offline' | 'other';
userData: ConversionUserData;
eventSourceURL?: string;