Skip to content

Commit 1fb42f7

Browse files
author
Robert-Jan Huijsman
authored
Analytics: remove ltvInfo and trafficSource fields from the public interface (#132)
The ltvInUSD and trafficSource fields aren't carried in the payload even though the proto permits them to be there.
1 parent 5a82e48 commit 1fb42f7

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

spec/providers/analytics.spec.input.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,6 @@ export const fullEvent: Event<AnalyticsEvent> = {
152152
appStore: 'iTunes',
153153
appVersion: '5.2.0',
154154
},
155-
trafficSource: {
156-
userAcquiredSource: 'Pizza Everywhere',
157-
userAcquiredCampaign: 'Functions launch party',
158-
userAcquiredMedium: 'Free food',
159-
},
160155
bundleInfo: {
161156
bundleSequenceId: 6034,
162157
serverTimestampOffset: 371,
@@ -195,7 +190,6 @@ export const fullEvent: Event<AnalyticsEvent> = {
195190
value: '5.2.0',
196191
},
197192
},
198-
ltvInUSD: 133.7,
199193
},
200194
},
201195
};

spec/providers/analytics.spec.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,6 @@ describe('AnalyticsEventBuilder', () => {
204204
valueInUsd: 123.4,
205205
},
206206
],
207-
userDim: {
208-
ltvInfo: {
209-
revenue: 987.6,
210-
currency: 'USD',
211-
},
212-
},
213207
},
214208
};
215209

@@ -218,10 +212,6 @@ describe('AnalyticsEventBuilder', () => {
218212
name: 'Loaded_In_Background',
219213
params: {},
220214
valueInUSD: 123.4, // Field renamed Usd -> USD.
221-
user: {
222-
ltvInUSD: 987.6, // USD value extracted.
223-
userProperties: {},
224-
},
225215
});
226216
});
227217

src/providers/analytics.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,28 +140,19 @@ export class UserDimensions {
140140
/** App information. */
141141
appInfo?: AppInfo;
142142

143-
/** Information about the marketing campaign which acquired the user. */
144-
trafficSource?: TrafficSource;
145-
146143
/** Information regarding the bundle in which these events were uploaded. */
147144
bundleInfo: ExportBundleInfo;
148145

149-
/** Lifetime Value revenue of this user, in USD. */
150-
ltvInUSD?: number;
151-
152146
/** @internal */
153147
constructor(wireFormat: any) {
154148
// These are interfaces or primitives, no transformation needed.
155-
copyFields(wireFormat, this, ['userId', 'deviceInfo', 'geoInfo', 'appInfo', 'trafficSource']);
149+
copyFields(wireFormat, this, ['userId', 'deviceInfo', 'geoInfo', 'appInfo']);
156150

157151
// The following fields do need transformations of some sort.
158152
copyTimestampToString(wireFormat, this, 'firstOpenTimestampMicros', 'firstOpenTime');
159153
this.userProperties = {}; // With no entries in the wire format, present an empty (as opposed to absent) map.
160154
copyField(wireFormat, this, 'userProperties', r => _.mapValues(r, p => new UserPropertyValue(p)));
161155
copyField(wireFormat, this, 'bundleInfo', r => new ExportBundleInfo(r));
162-
if (wireFormat.ltvInfo && wireFormat.ltvInfo.currency === 'USD') {
163-
this.ltvInUSD = wireFormat.ltvInfo.revenue;
164-
}
165156

166157
// BUG(36000368) Remove when no longer necessary
167158
/* tslint:disable:no-string-literal */

0 commit comments

Comments
 (0)