Skip to content

Commit ce251b4

Browse files
committed
Merge branch 'release/v8.3.0' into develop
2 parents ab2bb7d + 25131b1 commit ce251b4

File tree

14 files changed

+520
-189
lines changed

14 files changed

+520
-189
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.beanconqueror.app"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 80201
11-
versionName "8.2.1"
10+
versionCode 80300
11+
versionName "8.3.0"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

ios/App/App.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.food-and-drink";
357357
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
358358
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
359-
MARKETING_VERSION = 8.2.1;
359+
MARKETING_VERSION = 8.3.0;
360360
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
361361
PRODUCT_BUNDLE_IDENTIFIER = com.beanconqueror.app;
362362
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -380,7 +380,7 @@
380380
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.food-and-drink";
381381
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
382382
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
383-
MARKETING_VERSION = 8.2.1;
383+
MARKETING_VERSION = 8.3.0;
384384
PRODUCT_BUNDLE_IDENTIFIER = com.beanconqueror.app;
385385
PRODUCT_NAME = "$(TARGET_NAME)";
386386
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";

src/app/app.component.ts

Lines changed: 84 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,72 +1140,109 @@ export class AppComponent implements AfterViewInit {
11401140

11411141
public async initialDataTrackings() {
11421142
const settings = this.uiSettingsStorage.getSettings();
1143+
const impressionsToTrack: Array<{
1144+
contentName: string;
1145+
contentPiece: string;
1146+
contentTarget?: string;
1147+
}> = [];
11431148
if (
11441149
settings.matomo_analytics === true &&
11451150
settings.matomo_initial_data_tracked === false
11461151
) {
11471152
try {
11481153
await this.uiAlert.showLoadingSpinner();
1154+
11491155
const beans: Array<Bean> = this.uiBeanStorage.getAllEntries();
1150-
for (let bean of beans) {
1156+
const mills: Array<Mill> = this.uiMillStorage.getAllEntries();
1157+
const preparations: Array<Preparation> =
1158+
this.uiPreparationStorage.getAllEntries();
1159+
const waters: Array<Water> = this.uiWaterStorage.getAllEntries();
1160+
const brewsCount = this.uiBrewStorage.getAllEntries().length;
1161+
const beansCountFromStorage = this.uiBeanStorage.getAllEntries().length;
1162+
1163+
for (const bean of beans) {
11511164
if (bean.roaster) {
1152-
this.uiAnalytics.trackContentImpression(
1153-
TrackContentImpression.STATISTICS_ROASTER_NAME,
1154-
bean.roaster,
1155-
);
1156-
this.uiAnalytics.trackContentImpression(
1157-
TrackContentImpression.STATISTICS_BEAN_ROASTER_NAME,
1158-
bean.roaster + ' | ' + bean.name,
1159-
);
1165+
impressionsToTrack.push({
1166+
contentName: TrackContentImpression.STATISTICS_ROASTER_NAME,
1167+
contentPiece: bean.roaster,
1168+
});
1169+
impressionsToTrack.push({
1170+
contentName: TrackContentImpression.STATISTICS_BEAN_ROASTER_NAME,
1171+
contentPiece: `${bean.roaster} | ${bean.name}`,
1172+
});
11601173
} else {
1161-
this.uiAnalytics.trackContentImpression(
1162-
TrackContentImpression.STATISTICS_BEAN_ROASTER_NAME,
1163-
' | ' + bean.name,
1164-
);
1174+
impressionsToTrack.push({
1175+
contentName: TrackContentImpression.STATISTICS_BEAN_ROASTER_NAME,
1176+
contentPiece: ` - | ${bean.name}`,
1177+
});
11651178
}
11661179
}
1167-
const mills: Array<Mill> = this.uiMillStorage.getAllEntries();
11681180

1169-
for (let mill of mills) {
1170-
this.uiAnalytics.trackContentImpression(
1171-
TrackContentImpression.STATISTICS_GRINDER_NAME,
1172-
mill.name,
1173-
);
1181+
for (const mill of mills) {
1182+
impressionsToTrack.push({
1183+
contentName: TrackContentImpression.STATISTICS_GRINDER_NAME,
1184+
contentPiece: mill.name,
1185+
});
11741186
}
11751187

1176-
const preparations: Array<Preparation> =
1177-
this.uiPreparationStorage.getAllEntries();
1178-
for (let preparation of preparations) {
1179-
this.uiAnalytics.trackContentImpression(
1180-
TrackContentImpression.STATISTICS_PREPARATION_NAME,
1181-
preparation.name,
1182-
);
1188+
for (const preparation of preparations) {
1189+
impressionsToTrack.push({
1190+
contentName: TrackContentImpression.STATISTICS_PREPARATION_NAME,
1191+
contentPiece: preparation.name,
1192+
});
11831193
}
11841194

1185-
const waters: Array<Water> = this.uiWaterStorage.getAllEntries();
1186-
for (let water of waters) {
1187-
this.uiAnalytics.trackContentImpression(
1188-
TrackContentImpression.STATISTICS_WATER_NAME,
1189-
water.name,
1190-
);
1195+
for (const water of waters) {
1196+
impressionsToTrack.push({
1197+
contentName: TrackContentImpression.STATISTICS_WATER_NAME,
1198+
contentPiece: water.name,
1199+
});
11911200
}
11921201

1193-
settings.matomo_initial_data_tracked = true;
1194-
await this.uiSettingsStorage.update(settings);
1195-
} catch (ex) {}
1202+
impressionsToTrack.push({
1203+
contentName: TrackContentImpression.STATISTICS_BREWS_COUNT,
1204+
contentPiece: brewsCount.toString(),
1205+
});
1206+
impressionsToTrack.push({
1207+
contentName: TrackContentImpression.STATISTICS_BEANS_COUNT,
1208+
contentPiece: beansCountFromStorage.toString(),
1209+
});
11961210

1197-
await this.uiAlert.hideLoadingSpinner();
1211+
if (impressionsToTrack.length > 0) {
1212+
const didTrack =
1213+
await this.uiAnalytics.trackBulkContentImpressions(
1214+
impressionsToTrack,
1215+
);
1216+
if (didTrack) {
1217+
const currentSettings = this.uiSettingsStorage.getSettings();
1218+
currentSettings.matomo_initial_data_tracked = true;
1219+
await this.uiSettingsStorage.update(currentSettings);
1220+
}
1221+
} else {
1222+
// If there's nothing to track, still mark as tracked
1223+
const currentSettings = this.uiSettingsStorage.getSettings();
1224+
currentSettings.matomo_initial_data_tracked = true;
1225+
await this.uiSettingsStorage.update(currentSettings);
1226+
}
1227+
} catch (ex) {
1228+
this.uiLog.error('Error during initial bulk data trackings: ', ex);
1229+
} finally {
1230+
await this.uiAlert.hideLoadingSpinner();
1231+
}
1232+
} else if (settings.matomo_analytics === true) {
1233+
setTimeout(() => {
1234+
const brewsCount = this.uiBrewStorage.getAllEntries().length;
1235+
const beansCountFromStorage = this.uiBeanStorage.getAllEntries().length;
1236+
impressionsToTrack.push({
1237+
contentName: TrackContentImpression.STATISTICS_BREWS_COUNT,
1238+
contentPiece: brewsCount.toString(),
1239+
});
1240+
impressionsToTrack.push({
1241+
contentName: TrackContentImpression.STATISTICS_BEANS_COUNT,
1242+
contentPiece: beansCountFromStorage.toString(),
1243+
});
1244+
this.uiAnalytics.trackBulkContentImpressions(impressionsToTrack);
1245+
}, 5000);
11981246
}
1199-
1200-
const brewsCount = this.uiBrewStorage.getAllEntries().length;
1201-
const beansCount = this.uiBeanStorage.getAllEntries().length;
1202-
this.uiAnalytics.trackContentImpression(
1203-
TrackContentImpression.STATISTICS_BREWS_COUNT,
1204-
brewsCount.toString(),
1205-
);
1206-
this.uiAnalytics.trackContentImpression(
1207-
TrackContentImpression.STATISTICS_BEANS_COUNT,
1208-
beansCount.toString(),
1209-
);
12101247
}
12111248
}

src/app/beans/beans-add/beans-add.component.ts

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -212,31 +212,52 @@ export class BeansAddComponent implements OnInit {
212212
}
213213
await this.uiBeanStorage.add(this.data);
214214

215+
const eventsToTrack = [];
216+
const impressionsToTrack = [];
217+
215218
if (this.data.roaster) {
216-
this.uiAnalytics.trackEvent(
217-
BEAN_TRACKING.TITLE,
218-
BEAN_TRACKING.ACTIONS.ADD_FINISH,
219-
this.data.name + '_' + this.data.roaster,
220-
);
219+
eventsToTrack.push({
220+
category: BEAN_TRACKING.TITLE,
221+
action: BEAN_TRACKING.ACTIONS.ADD_FINISH,
222+
name: this.data.name + '_' + this.data.roaster,
223+
});
221224
} else {
222-
this.uiAnalytics.trackEvent(
223-
BEAN_TRACKING.TITLE,
224-
BEAN_TRACKING.ACTIONS.ADD_FINISH,
225-
this.data.name + '_-',
226-
);
225+
eventsToTrack.push({
226+
category: BEAN_TRACKING.TITLE,
227+
action: BEAN_TRACKING.ACTIONS.ADD_FINISH,
228+
name: this.data.name + '_-',
229+
});
227230
}
228231

229-
this.uiAnalytics.trackEvent(
230-
BEAN_TRACKING.TITLE,
231-
BEAN_TRACKING.ACTIONS.ADD_ROASTER + '_' + this.data.roaster,
232-
this.data.name,
233-
);
232+
eventsToTrack.push({
233+
category: BEAN_TRACKING.TITLE,
234+
action:
235+
BEAN_TRACKING.ACTIONS.ADD_ROASTER + '_' + (this.data.roaster || '-'),
236+
name: this.data.name,
237+
});
234238

235239
if (this.data.roaster) {
236-
this.uiAnalytics.trackContentImpression(
237-
TrackContentImpression.STATISTICS_ROASTER_NAME,
238-
this.data.roaster,
239-
);
240+
impressionsToTrack.push({
241+
contentName: TrackContentImpression.STATISTICS_ROASTER_NAME,
242+
contentPiece: this.data.roaster,
243+
});
244+
impressionsToTrack.push({
245+
contentName: TrackContentImpression.STATISTICS_BEAN_ROASTER_NAME,
246+
contentPiece: this.data.roaster + ' | ' + this.data.name,
247+
});
248+
} else {
249+
impressionsToTrack.push({
250+
contentName: TrackContentImpression.STATISTICS_BEAN_ROASTER_NAME,
251+
contentPiece: ' - | ' + this.data.name,
252+
});
253+
}
254+
255+
if (eventsToTrack.length > 0) {
256+
this.uiAnalytics.trackBulkEvents(eventsToTrack);
257+
}
258+
259+
if (impressionsToTrack.length > 0) {
260+
this.uiAnalytics.trackBulkContentImpressions(impressionsToTrack);
240261
}
241262

242263
this.uiBeanHelper.logUsedBeanParameters();

0 commit comments

Comments
 (0)