-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from adjust/criteo_plugin
Criteo plugin
- Loading branch information
Showing
11 changed files
with
346 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
Pod::Spec.new do |s| | ||
s.name = "Adjust" | ||
s.version = "4.0.6" | ||
s.version = "4.0.7" | ||
s.summary = "This is the iOS SDK of adjust. You can read more about it at http://adjust.com." | ||
s.homepage = "http://adjust.com" | ||
s.license = { :type => 'MIT', :file => 'MIT-LICENSE' } | ||
s.author = { "Christian Wellenbrock" => "[email protected]" } | ||
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.6" } | ||
s.source = { :git => "https://github.com/adjust/ios_sdk.git", :tag => "v4.0.7" } | ||
s.platform = :ios, '4.3' | ||
s.framework = 'SystemConfiguration' | ||
s.weak_framework = 'AdSupport', 'iAd' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.0.6 | ||
4.0.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
## Criteo plugin | ||
|
||
Integrate adjust with Criteo events by following these steps: | ||
|
||
1. Locate the `plugin` folder inside the downloaded archive from our [releases page](https://github.com/adjust/ios_sdk/releases). | ||
|
||
2. Drag the `ADJCriteo.h` and `ADJCriteo.m` files into the `Adjust` folder inside your project. | ||
|
||
3. In the dialog `Choose options for adding these files` make sure to check the checkbox | ||
to `Copy items if needed` and select the radio button to `Create groups`. | ||
|
||
Now you can integrate each of the different Criteo events, like in the following examples: | ||
|
||
### View Homepage | ||
|
||
```objc | ||
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewHomepageEventToken}"]; | ||
|
||
[Adjust trackEvent:event]; | ||
``` | ||
### View Search | ||
```objc | ||
#import "ADJCriteo.h" | ||
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewSearchEventToken}"]; | ||
[ADJCriteo injectViewSearchIntoEvent:event checkInDate:@"2015-01-01" checkOutDate:@"2015-01-07"]; | ||
[Adjust trackEvent:event]; | ||
``` | ||
|
||
### View Listing | ||
|
||
```objc | ||
#import "ADJCriteo.h" | ||
|
||
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"]; | ||
|
||
ADJCriteoProduct *product1 = [ADJCriteoProduct productWithId:@"productId1" price:100.0 quantity:1]; | ||
ADJCriteoProduct *product2 = [ADJCriteoProduct productWithId:@"productId2" price:77.7 quantity:3]; | ||
ADJCriteoProduct *product3 = [ADJCriteoProduct productWithId:@"productId3" price:50 quantity:2]; | ||
NSArray *products = @[product1, product2, product3]; | ||
|
||
[ADJCriteo injectViewListingIntoEvent:event products:products customerId:@"customerId1"]; | ||
|
||
[Adjust trackEvent:event]; | ||
``` | ||
### View Product | ||
```objc | ||
#import "ADJCriteo.h" | ||
ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewProductEventToken}"]; | ||
[ADJCriteo injectViewProductIntoEvent:event productId:@"productId1" customerId:@"customerId1"]; | ||
[Adjust trackEvent:event]; | ||
``` | ||
|
||
### Cart | ||
|
||
```objc | ||
#import "ADJCriteo.h" | ||
|
||
ADJEvent *event = [ADJEvent eventWithEventToken:@"{cartEventToken}"]; | ||
|
||
ADJCriteoProduct *product1 = [ADJCriteoProduct productWithId:@"productId1" price:100.0 quantity:1]; | ||
ADJCriteoProduct *product2 = [ADJCriteoProduct productWithId:@"productId2" price:77.7 quantity:3]; | ||
ADJCriteoProduct *product3 = [ADJCriteoProduct productWithId:@"productId3" price:50 quantity:2]; | ||
NSArray *products = @[product1, product2, product3]; | ||
|
||
[ADJCriteo injectCartIntoEvent:event products:products customerId:@"customerId1"]; | ||
|
||
[Adjust trackEvent:event]; | ||
``` | ||
### Transaction confirmation | ||
```objc | ||
#import "ADJCriteo.h" | ||
ADJEvent *event = [ADJEvent eventWithEventToken:@"{transactionConfirmedEventToken}"]; | ||
ADJCriteoProduct *product1 = [ADJCriteoProduct productWithId:@"productId1" price:100.0 quantity:1]; | ||
ADJCriteoProduct *product2 = [ADJCriteoProduct productWithId:@"productId2" price:77.7 quantity:3]; | ||
ADJCriteoProduct *product3 = [ADJCriteoProduct productWithId:@"productId3" price:50 quantity:2]; | ||
NSArray *products = @[product1, product2, product3]; | ||
[ADJCriteo injectTransactionConfirmedIntoEvent:event products:products customerId:@"customerId1"]; | ||
[Adjust trackEvent:event]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// ADJCriteoEvents.h | ||
// | ||
// | ||
// Created by Pedro Filipe on 06/02/15. | ||
// | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "ADJEvent.h" | ||
|
||
@interface ADJCriteoProduct : NSObject | ||
|
||
@property (nonatomic, assign) float criteoPrice; | ||
@property (nonatomic, assign) NSUInteger criteoQuantity; | ||
@property (nonatomic, copy) NSString *criteoProductID; | ||
|
||
- (id) initWithId:(NSString*)productId | ||
price:(float)price | ||
quantity:(NSUInteger)quantity; | ||
|
||
+ (ADJCriteoProduct *)productWithId:(NSString*)productId | ||
price:(float)price | ||
quantity:(NSUInteger)quantity; | ||
|
||
@end | ||
|
||
@interface ADJCriteo : NSObject | ||
|
||
+ (void)injectViewSearchIntoEvent:(ADJEvent *)event | ||
checkInDate:(NSString *)din | ||
checkOutDate:(NSString *)dout; | ||
|
||
+ (void)injectViewListingIntoEvent:(ADJEvent *)event | ||
products:(NSArray *)products | ||
customerId:(NSString *)customerId; | ||
|
||
+ (void)injectViewProductIntoEvent:(ADJEvent *)event | ||
productId:(NSString *)productId | ||
customerId:(NSString *)customerId; | ||
|
||
+ (void)injectCartIntoEvent:(ADJEvent *)event | ||
products:(NSArray *)products | ||
customerId:(NSString *)customerId; | ||
|
||
+ (void)injectTransactionConfirmedIntoEvent:(ADJEvent *)event | ||
products:(NSArray *)products | ||
customerId:(NSString *)customerId; | ||
|
||
@end |
Oops, something went wrong.