adjust-icon

Criteo

You can integrate the Adjust Android SDK with Criteo events by using the Adjust Criteo plugin.

Set up your environment

Maven

If you are using Maven, add the following dependency to your build.gradle file:

build.gradle
dependencies {
implementation 'com.adjust.sdk:adjust-android:4.38.5'
implementation 'com.adjust.sdk:adjust-android-criteo:4.38.5'
}

Add as JAR

You can also add the plugin as a JAR file from the releases page.

Work with Criteo events

Once you have set up your environment, you can start recording Criteo events with the Adjust SDK.

View listing

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{viewListingEventToken}");
List<String> productIds = Arrays.asList("productId1", "productId2", "productId3");
AdjustCriteo.injectViewListingIntoEvent(event, productIds);
Adjust.trackEvent(event);

View product

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{viewProductEventToken}");
AdjustCriteo.injectViewProductIntoEvent(event, "productId1");
Adjust.trackEvent(event);

Cart

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{cartEventToken}");
CriteoProduct product1 = new CriteoProduct(100, 1, "productId1");
CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2");
CriteoProduct product3 = new CriteoProduct(50, 2, "productId3");
List<CriteoProduct> products = Arrays.asList(product1, product2, product3);
AdjustCriteo.injectCartIntoEvent(event, products);
Adjust.trackEvent(event);

Transaction confirmed

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{transactionConfirmedEventToken}");
CriteoProduct product1 = new CriteoProduct(100, 1, "productId1");
CriteoProduct product2 = new CriteoProduct(77.7f, 3, "productId2");
CriteoProduct product3 = new CriteoProduct(50, 2, "productId3");
List<CriteoProduct> products = Arrays.asList(product1, product2, product3);
AdjustCriteo.injectTransactionConfirmedIntoEvent(event, products, "transactionId", "newCustomerId");
Adjust.trackEvent(event);

User level

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{userLevelEventToken}");
AdjustCriteo.injectUserLevelIntoEvent(event, 1);
Adjust.trackEvent(event);

User status

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{userStatusEventToken}");
AdjustCriteo.injectUserStatusIntoEvent(event, "uiStatusValue");
Adjust.trackEvent(event);

Achievement unlocked

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{achievementUnlockedEventToken}");
AdjustCriteo.injectAchievementUnlockedIntoEvent(event, "AchievementUnlocked");
Adjust.trackEvent(event);

Custom event

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{customEventEventToken}");
AdjustCriteo.injectCustomEventIntoEvent(event, "uiDataValue");
Adjust.trackEvent(event);

Custom event 2

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustEvent event = new AdjustEvent("{customEvent2EventToken}");
AdjustCriteo.injectCustomEvent2IntoEvent(event, "uiData2Value", 3);
Adjust.trackEvent(event);

Hashed email

You can attach a hashed email to every Criteo event. To do this, call the injectHashedEmailIntoCriteoEvents method. The SDK will send a hashed email with every Criteo event throughout the app lifecycle. This means it will need to be set again when the app is re-launched. You can remove the hashed email by setting the injectHashedEmailIntoCriteoEvents value to nil.

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustCriteo.injectHashedEmailIntoCriteoEvents("8455938a1db5c475a87d76edacb6284e");

Search dates

You can attach a check-in and check-out date to every Criteo event. To do this, call the injectViewSearchDatesIntoCriteoEvent method. The SDK will send the dates with every Criteo event throughout the app lifecycle. This means you will need to set them again when the app is re-launched.

You can remove the search dates by setting the injectViewSearchDatesIntoCriteoEvent values to nil.

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustCriteo.injectViewSearchDatesIntoCriteoEvents("2015-01-01", "2015-01-07");

Partner ID

You can attach a partner ID to every Criteo event. To do this, call the injectPartnerIdIntoCriteoEvents method. The SDK will send the partner ID with every Criteo throughout the app lifecycle. This means you will need to set it again when the app is re-launched.

You can remove the partner ID by setting the injectPartnerIdIntoCriteoEvents value to null.

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustCriteo.injectPartnerIdIntoCriteoEvents("{CriteoPartnerId}");

You can add deep link information to Criteo events. To do this, call the injectDeeplinkIntoEvent method with the event and URL.

import com.adjust.sdk.plugin.AdjustCriteo;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
Uri data = intent.getData();
AdjustEvent event = new AdjustEvent("{deeplinkEventToken}");
AdjustCriteo.injectDeeplinkIntoEvent(event, data);
Adjust.trackEvent(event);
}

Customer ID

You can attach a customer ID to every Criteo event. To do this, call the injectCustomerIdIntoCriteoEvents method. The SDK will send the customer ID with every Criteo event throughout the app lifecycle. This means you will need to set them again when the app is re-launched.

You can remove the customer ID by setting the injectCustomerIdIntoCriteoEvents value to nil.

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustCriteo.injectCustomerIdIntoCriteoEvents("{CriteoCustomerId}");

User segment

You can attach the user segment to every Criteo event. To do this, call the injectUserSegmentIntoCriteoEvents method. The SDK will send the user segment with every Criteo event throughout the app lifecycle. This means you will need to set it again when the app is re-launched.

You can remove the user segment by setting the injectUserSegmentIntoCriteoEvents value to nil.

import com.adjust.sdk.plugin.AdjustCriteo;
AdjustCriteo.injectUserSegmentIntoCriteoEvents("{CriteoUserSegment}");