Skip to content

Commit

Permalink
Merge pull request #94 from visenze/feature/batch_trans
Browse files Browse the repository at this point in the history
[ES-5955],[API-8676] Support transaction batch events
  • Loading branch information
thehung111 authored Oct 10, 2022
2 parents fe0b111 + 0eda907 commit 72ee586
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
16 changes: 12 additions & 4 deletions doc/ProductSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ With the release of ViSenze's Catalog system, ViSearch Android SDK will now incl
- Aggregate search results on a product level instead of image level
- Consistent data type in API response with Catalog’s schema

> Current stable version: 2.2.4
> Current stable version: 2.2.5
> Minimum Android SDK Version: API 9, Android 2.3
Expand Down Expand Up @@ -63,8 +63,8 @@ allprojects {

include the dependency in your project using gradle:
```gradle
implementation 'com.github.visenze:visenze-tracking-android:0.2.1'
implementation 'com.github.visenze:visearch-sdk-android:2.2.4'
implementation 'com.github.visenze:visenze-tracking-android:0.2.2'
implementation 'com.github.visenze:visearch-sdk-android:2.2.5'
```

### 1.3 Add User Permissions
Expand Down Expand Up @@ -525,7 +525,7 @@ You can initialize ViSenze Analytics tracker for sending analytics events as fol

```java
ProductSeach productSearch = SearchAPI.getProductSearchInstance();
Tracker tracker = productSearch.newTracker(null, false);
Tracker tracker = productSearch.newTracker();
```

### 7.2 Send Events
Expand Down Expand Up @@ -565,6 +565,14 @@ Finally send the event via the tracker:
tracker.sendEvent(event);
```

User action(s) can also be sent through an batch event handler.

A common use case for this batch event method is to group up all transaction by sending it in a batch. This SDK will automatically generate a transaction ID to group transactions as an order if the transaction ID is not provided.

```java
tracker.sendEvents(eventList);
```

Below are the brief description for various parameters:

Field | Description | Required
Expand Down
16 changes: 12 additions & 4 deletions doc/ViSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ViSearch is an API that provides accurate, reliable and scalable image search. V

The ViSearch Android SDK is an open source software to provide easy integration of ViSearch Search API with your Android mobile applications. It provides three search methods based on the ViSearch Search API - pre-indexed search, color search and upload search. For source code and references, please visit the [Github Repository](https://github.com/visenze/visearch-sdk-android).

>Current stable version: 2.2.4
>Current stable version: 2.2.5
>Minimum Android SDK Version: API 9, Android 2.3
Expand Down Expand Up @@ -79,8 +79,8 @@ allprojects {

include the dependency in your project using gradle:
```gradle
implementation 'com.github.visenze:visenze-tracking-android:0.2.1'
implementation 'com.github.visenze:visearch-sdk-android:2.2.4'
implementation 'com.github.visenze:visenze-tracking-android:0.2.2'
implementation 'com.github.visenze:visearch-sdk-android:2.2.5'
```

### 1.3 Add User Permissions
Expand Down Expand Up @@ -533,7 +533,7 @@ In addition, to improve subsequent search quality, it is recommended to send use
You can initialize ViSenze Analytics tracker for sending analytics events by providing the code (found in ViSenze Dashboard).

```java
Tracker tracker = visearch.newTracker(code, false);
Tracker tracker = visearch.newTracker(code);
```

### 6.2 Send Events
Expand Down Expand Up @@ -571,6 +571,14 @@ Finally send the event via the tracker:
tracker.sendEvent(event);
```

User action(s) can also be sent through an batch event handler.

A common use case for this batch event method is to group up all transaction by sending it in a batch. This SDK will automatically generate a transaction ID to group transactions as an order if the transaction ID is not provided.

```java
tracker.sendEvents(eventList);
```

Below are the brief description for various parameters:

Field | Description | Required
Expand Down
6 changes: 3 additions & 3 deletions visearch-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ plugins {

def versionMajor = 2
def versionMinor = 2
def versionPatch = 4
version = '2.2.4'
def versionPatch = 5
version = '2.2.5'

android {
compileSdkVersion 29
Expand Down Expand Up @@ -38,7 +38,7 @@ android {


dependencies {
implementation 'com.github.visenze:visenze-tracking-android:0.2.1'
implementation 'com.github.visenze:visenze-tracking-android:0.2.2'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,19 @@ private void addAnalyticsParams(BaseProductSearchParams searchParams) {
}

// tracking related
public Tracker newTracker() {
return newTracker(null, false);
}

public Tracker newTracker(String code) {
return newTracker(code, false);
}

public Tracker newTracker(String code, boolean useCnEndpoint) {
if(code == null) code = trackCode;
return visenzeAnalytics.newTracker(code, useCnEndpoint);
}



public static class Builder {
private String mAppKey;
private int mPlacement;
Expand Down

0 comments on commit 72ee586

Please sign in to comment.