Skip to content

Commit

Permalink
feat: add value property to conversion events (#526)
Browse files Browse the repository at this point in the history
Add ecommerce `value` property to conversion events as specified in the
[Insights Update
spec](https://algolia.atlassian.net/wiki/spaces/EX/pages/4652531940/Insights+update#Purchase)

[EEX-886](https://algolia.atlassian.net/browse/EEX-886)
  • Loading branch information
jkaho authored Dec 11, 2023
1 parent f6b6288 commit ab761ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/__tests__/conversion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ describe("purchasedObjectIDsAfterSearch", () => {
quantity: 2
}
],
currency: "USD"
currency: "USD",
value: 25.98
};

it("should call sendEvents with proper params", () => {
Expand Down Expand Up @@ -181,7 +182,8 @@ describe("addedToCartObjectIDs", () => {
quantity: 17
}
],
currency: "GBP"
currency: "GBP",
value: 21.08
};

it("should call sendEvents with proper params", () => {
Expand Down
1 change: 1 addition & 0 deletions lib/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface InsightsSearchConversionEvent {
queryID: string;
objectIDs: string[];
objectData?: InsightsEvent["objectData"];
value?: InsightsEvent["value"];
currency?: InsightsEvent["currency"];
}

Expand Down

0 comments on commit ab761ae

Please sign in to comment.