iOS でのユーザー ID マッピング
注:
このオファリングは現在アルファ版であり、予告なく変更または廃止される可能性があります。
概要
Xandr では、広告リクエストでサードパーティのソースから パブリッシャーファーストパーティ ID と ユーザー ID を 送信するオプションが提供されます。 これらはグローバル設定であり、これらの値は同じセッション内のすべての連続した広告要求で使用されるため、アプリ セッションごとに 1 回ユーザー ID を設定するだけで十分です。 Xandr は、異なるアプリ セッション間でこれらの値を格納しないことに注意してください。
Mobile SDK の構造
発行元のファースト パーティ ID
注:
非推奨のお知らせ:
The
externalUid
、、およびANInstreamVideoAd
クラスのANNativeAdRequest
ANBannerAdView
InterstitialAdView
プロパティは非推奨になりました。 代わりに、クラスで以下にANSDKSettings
説明するプロパティを使用publisherUserId
できます。 非推奨のメソッドは SDK v8.0 で削除されます。
Mobile SDK API の プロパティANSDKSettings
をpublisherUserId
使用して、Publisher First Party ID を設定できます。
プロパティ | 種類 | 属性 | 説明 |
---|---|---|---|
publisherUserId |
NSString |
Readwrite | 現在のアプリケーション ユーザーのパブリッシャー ユーザー ID に対応する文字列を指定します。 |
発行元のファースト パーティ ID としての IDFV
iOS 14.5 以降で App Tracking Transparency (ATT) の変更が導入されたため、Xandr Mobile SDK では、社内のパブリッシャーファースト パーティ ID と広告主識別子 (IDFA) が利用できない場合に、デバイスの Identifier for Vendors (IDFV) を使用するパブリッシャーが提供されます。 この機能により、パブリッシャーは、パブリッシャーファーストパーティ ID と IDFA の両方が存在しない場合に、広告要求で IDFV を自動的に渡すことができます。 この機能は既定で有効になっており、パブリッシャーが無効にする場合は、Mobile SDK API で の ANSDKSettings
プロパティを使用disableIDFVUsage
できます。
プロパティ | 型 | 属性 | 説明 |
---|---|---|---|
disableIDFVUsage |
BOOL |
Readwrite | 広告要求の IDFV フィールドを除外するブール値を指定します。 プロパティの既定値は NO に設定され、IDFV は特定の広告要求に対して IDFV と Publisher First Party ID の両方が存在しない場合に使用されます。 |
/**
An AppNexus disableIDFVUsage is a boolean value which exclude the IDFV field in ad request. Default value of disableIDFVUsage is set to NO and IDFV will be used in cases where IDFV and Publisher First Party ID is not present.
*/
@property (nonatomic, readwrite) BOOL disableIDFVUsage;
[ユーザー ID]
注:
非推奨のお知らせ:
プロパティ 'ANSDKSettings.externalUserIdArray' と 'ANExternalUserId' クラスは非推奨になり、SDK v8.0 で削除されます。 代わりに、以下で説明する同等のプロパティ 'ANSDKSettings.userIdArray' と 'ANUserId' クラスを使用できます。
Xandr では、次の外部ソースからのユーザー ID がサポートされています。
- NetID
- Utiq
- ID5
- Criteo
- 統合 ID 1.0 Trade Desk ID
- Hydron ID (Audigent)
- Publink (Epsilon)
- SharedID
- EUID
- Yahoo Connect ID
- パノラマ ID
- ザ トレード デスク
- NetID
- LiveRamp
- UID 2.0
- パブリッシャーが指定した ID/PPID (発行元は API を介して独自のソースを登録でき、ユーザー ID を渡すことができます)。
ユーザー ID は、
- ANUserId オブジェクトの配列を作成し、
- Mobile SDK API の の プロパティにオブジェクトの
ANSDKSettings
配列をuserIdArray
割り当てます。
プロパティ | 型 | 属性 | 説明 |
---|---|---|---|
userIdArray |
NSArray |
Readwrite | ユーザー ID パラメーターを保持するオブジェクトを含むディクショナリを指定します。 |
// In ANSDKSettings.h:
/**
A Dictionary containing objects that hold UserId parameters.
*/
@property (nonatomic, readwrite, strong, nullable) NSArray<ANUserId *> *userIdArray ;
// In ANUserId.h
/*
* Supported Third Party ID Sources
* */
typedef NS_ENUM(NSUInteger, ANUserIdSource) {
ANUserIdSourceLiveRamp,
ANUserIdSourceNetId,
ANUserIdSourceCriteo,
ANUserIdSourceTheTradeDesk,
ANUserIdSourceUID2
};
/**
Defines the User Id Object from an Extended Third Party Source
*/
@interface ANUserId : NSObject
/**
Source of the User Id
*/
@property (nonatomic, readwrite, strong, nonnull) NSString *source;
/**
The User Id String
*/
@property (nonatomic, readwrite, strong, nonnull) NSString *userId;
- (nullable instancetype)initWithSource:(ANUserIdSource)source userId:(nonnull NSString *)userId;
- (nullable instancetype)initWithStringSource:(nonnull NSString *)source userId:(nonnull NSString *)userId isFirstParytId:(BOOL)firstParytId;
@end
使用例
// iOS: ObjC to show a banner ad
#import "MyViewController.h"
#import "ANBannerAdView.h"
@interface MyViewController ()
@property (nonatomic, strong) ANBannerAdView *banner;
@end
@implementation MyViewController
ANBannerAdView *banner = nil;
- (void) viewDidLoad
{
// User Id from External Third Party Sources
NSMutableArray<ANUserId *> *userIdArray = [[NSMutableArray<ANUserId *> alloc] init];
[userIdArray addObject:[[ANUserId alloc] initWithANUserIdSource:ANUserIdSourceNetId userId:@"userid-netid-foobar" ]];
[userIdArray addObject:[[ANUserId alloc] initWithANUserIdSource:ANUserIdSourceTheTradeDesk userId:@"userid-ttd-foobar" ]];
[userIdArray addObject:[[ANUserId alloc] initWithANUserIdSource:ANUserIdSourceUID2 userId:@"userid-uid2-foobar" ]];
[userIdArray addObject:[[ANUserId alloc] initWithANUserIdSource:ANUserIdSourceCriteo userId:@"userid-Criteo-foobar"]];
[userIdArray addObject:[[ANUserId alloc] initWithANUserIdSource:ANUserIdSourceLiveRamp userId:@"userid-liveramp-foobar" ]];
[userIdArray addObject:[[ANUserId alloc] initWithStringSource:@“Generic Source” userId:@“userid-generic-foobar” isFirstParytId:true]];
ANSDKSettings.sharedInstance.userIdArray = userIdArray;
// Publisher User Id
ANSDKSettings.sharedInstance.publisherUserId = @"foobar-publisherfirstpartyid";
// IDFV as Publisher User Id
ANSDKSettings.sharedInstance.disableIDFVUsage = NO;
// Load Banner Ad
CGSize size = CGSizeMake(300, 250);
// NOTE Setting size is necessary only for fetching banner and video ad objects.
// This field is ignored when the placement returns a native ad object.
CGRect someRect = CGRectMake(...);
// Create the banner ad view here, but wait until the delegate fires before displaying.
self.banner = [ANBannerAdView adViewWithFrame:someRect placementId:@"13572468" adSize:size];
//... Needed Setup
// Load an ad!
[self.banner loadAd];
}
@end