Sociomantic plugin integration

You can integrate the Adjust SDK with Sociomantic events by following one of the methods below.

Before you begin

You need to download and set up the Adjust SDK for your platform. Follow the instructions linked below to get started.

⚙️ iOS / Android

Set up your environment

iOS

Cocoapods

Carthage

Install from source

Android

Maven

Add as JAR

React

In your .js file, add the following import statement:

import { Adjust, AdjustEvent, AdjustConfig } from 'react-native-adjust';`

In your App.js file, initialize the Adjust SDK with the following code:

constructor(props) {
    super(props);
    const adjustConfig = new AdjustConfig("{YourAppToken}", AdjustConfig.EnvironmentSandbox);
    Adjust.create(adjustConfig);
}

componentWillUnmount() {
  Adjust.componentWillUnmount();
}

Replace {YourAppToken} with the app token found in your Adjust dashboard.

Sociomantic events

Once you have installed the Sociomantic plugin, you will have access to the Sociomantic events methods as well as the following constants. You should use these as the property names of your dictionaries.

Sociomantic constants iOS

Sociomantic constants Android

Before sending any Sociomantic events, you should set a partner ID as shown below:

Objective-C
Swift
Java
#import "ADJSociomantic.h"

[ADJSociomantic injectPartnerIdIntoSociomanticEvents:@"{sociomanticPartnerId}"];

Once you have set your partner ID, you can integrate the different Sociomantic events.

Examples

Customer event

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:ANY_TOKEN];
NSDictionary *customerData = @{
    SCMCustomerID: @"123456"
};

[ADJSociomantic injectCustomerDataIntoEvent:event withData:customerData];
[Adjust trackEvent:event];

View home page

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:HOMEPAGE_TOKEN];

[ADJSociomantic injectHomePageIntoEvent:event];
[Adjust trackEvent:event];

View listing

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:LISTING_TOKEN];
NSArray *categories = @[@"category_1", @"category_2", @"category_3"];
NSString *date = @"1427792434";

[ADJSociomantic injectViewListingIntoEvent:event withCategories:categories];
// You also can provide a date like this
[ADJSociomantic injectViewListingIntoEvent:event withCategories:categories withDate:date];
[Adjust trackEvent:event];

View product

Note:
If you're not sure what setup you should use, please contact your technical account manager at Sociomantic.
Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event      = [ADJEvent eventWithEventToken:PRODUCT_VIEW_TOKEN];
NSDictionary *params = @{
    SCMCategory     : @[@"cat1", @"cat2"],
    SCMProductName  : @"stuff",
    SCMDescription  : @"pure awesomeness"
};

[ADJSociomantic injectViewProductIntoEvent:event productId:@"productId_4" withParameters:params];
[Adjust trackEvent:event];

Available product parameters

Cart

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:CART_TOKEN];
NSDictionary *product5 = @{
    SCMAmount    : @100,
    SCMCurrency  : @"EUR",
    SCMQuantity  : @1,
    SCMProductID : @"productId_5",
};
NSString *product6 = @"productId_6";
NSDictionary *product7 = @{
    SCMProductID : @"productId_7"
};


NSArray * productList = @[product5, product6, product7];

[ADJSociomantic injectCartIntoEvent:event cart:productList];
[Adjust trackEvent:event];

Available cart parameters

Unconfirmed transaction

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:TRANSACTION_TOKEN];
NSString *product5 =  @"productId_5";
NSDictionary *product6 = @{
    SCMQuantity  : @3,
    SCMProductID : @"productId_6"
};
NSArray * productList = @[product5, product6];

[ADJSociomantic injectTransactionIntoEvent:event transactionId:@"123456" withProducts:productList];
[Adjust trackEvent:event];

Or with parameters:

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:TRANSACTION_TOKEN];
NSString *product5 =  @"productId_5";
NSDictionary *product6 = @{
    SCMQuantity  : @3,
    SCMProductID : @"productId_6"
};
NSArray *productList = @[product5, product6];
NSDictionary *parameters = @{
    SCMQuantity: @4  // 3 times product6 and 1 product5
};

[ADJSociomantic injectTransactionIntoEvent:event transactionId:@"123456" withProducts:productList withParameters:parameters];
[Adjust trackEvent:event];

Confirmed transactions

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:TRANSACTION_TOKEN];
NSString *product5 =  @"productId_5";
NSDictionary *product6 = @{
    SCMQuantity  : @3,
    SCMProductID : @"productId_6"
};
NSArray * productList = @[product5, product6];

[ADJSociomantic injectConfirmedTransactionIntoEvent:event transactionId:@"123456" withProducts:productList];
[Adjust trackEvent:event];

Or with parameters:

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:TRANSACTION_TOKEN];
NSString *product5 =  @"productId_5";
NSDictionary *product6 = @{
    SCMQuantity  : @3,
    SCMProductID : @"productId_6"
};
NSArray *productList = @[product5, product6];
NSDictionary *parameters = @{
    SCMQuantity: @4  // 3 times product6 and 1 product5
};

[ADJSociomantic injectConfirmedTransactionIntoEvent:event transactionId:@"123456" withProducts:productList withParameters:parameters];
[Adjust trackEvent:event];

Available cart parameters

Lead event

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:LEAD_TOKEN];

[ADJSociomantic injectLeadIntoEvent:event leadID:@"123456789"];
[Adjust trackEvent:event];

Or confirmed lead:

Objective-C
Swift
Java
#import "ADJSociomantic.h"

ADJEvent *event = [ADJEvent eventWithEventToken:LEAD_TOKEN];

[ADJSociomantic injectLeadIntoEvent:event leadID:@"123456789" andConfirmed:YES];
[Adjust trackEvent:event];