Skip to content

Commit 88b49b7

Browse files
authored
fix(ga): adding support of revenue along with total. (#690)
1 parent 1ebd1a8 commit 88b49b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

integrations/GA/browser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default class GA {
172172
const { event, properties, name } = rudderElement.message;
173173
const options = this.extractCheckoutOptions(rudderElement);
174174
const props = rudderElement.message.properties;
175-
const { products } = properties;
175+
const { products, revenue } = properties;
176176
let { total } = properties;
177177
const data = {};
178178
const eventCategory = rudderElement.message.properties.category;
@@ -196,7 +196,7 @@ export default class GA {
196196
window.ga(`${this.trackerName}ecommerce:addTransaction`, {
197197
affiliation: properties.affiliation,
198198
shipping: properties.shipping,
199-
revenue: total,
199+
revenue: total || revenue,
200200
tax: properties.tax,
201201
id: orderId,
202202
currency: properties.currency,
@@ -280,7 +280,7 @@ export default class GA {
280280
window.ga(`${this.trackerName}ec:setAction`, "purchase", {
281281
id: orderId,
282282
affiliation: props.affiliation,
283-
revenue: total,
283+
revenue: total || revenue,
284284
tax: props.tax,
285285
shipping: props.shipping,
286286
coupon: props.coupon,

0 commit comments

Comments
 (0)