diff --git a/README.md b/README.md index 9bd0548fa..685ce2341 100644 --- a/README.md +++ b/README.md @@ -1,1411 +1,17 @@ -**This guide is being retired.** +# Adjust SDK for iOS -This README file will be retired shortly. The SDK documentation can now be found on our help center: +This is the [Adjust](https://adjust.com)™ SDK for iOS. Documentation is available on our help center in the following languages: * [English][en-helpcenter] * [中文][zh-helpcenter] * [日本語][ja-helpcenter] * [한국어][ko-helpcenter] -## Summary +## License -This is the iOS SDK of Adjust™. You can read more about Adjust™ at [adjust.com]. +Distributed under the [MIT license](https://opensource.org/licenses/MIT). See [`MIT-LICENSE`](MIT-LICENSE) for the full text. -If your app is an app which uses web views you would like to use adjust tracking from Javascript code, please consult our [iOS web views SDK guide][ios-web-views-guide]. - -Read this in other languages: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## Table of contents - -* [Example apps](#example-apps) -* [Basic integration](#basic-integration) - * [Add the SDK to your project](#sdk-add) - * [Add iOS frameworks](#sdk-frameworks) - * [Integrate the SDK into your app](#sdk-integrate) - * [Basic setup](#basic-setup) - * [iMessage specific setup](#basic-setup-imessage) - * [Adjust logging](#adjust-logging) - * [Build your app](#build-the-app) -* [Additional features](#additional-features) - * [AppTrackingTransparency framework](#att-framework) - * [App-tracking authorisation wrapper](#ata-wrapper) - * [Get current authorisation status](#ata-getter) - * [Check for ATT status change](#att-status-change) - * [SKAdNetwork framework](#skadn-framework) - * [Update SKAdNetwork conversion value](#skadn-update-conversion-value) - * [Conversion value updated callback](#skadn-cv-updated-callback) - * [Event tracking](#event-tracking) - * [Revenue tracking](#revenue-tracking) - * [Revenue deduplication](#revenue-deduplication) - * [Callback parameters](#callback-parameters) - * [Partner parameters](#partner-parameters) - * [Callback identifier](#callback-id) - * [Session parameters](#session-parameters) - * [Session callback parameters](#session-callback-parameters) - * [Session partner parameters](#session-partner-parameters) - * [Delay start](#delay-start) - * [Attribution callback](#attribution-callback) - * [Ad revenue tracking](#ad-revenue) - * [Subscription tracking](#subscriptions) - * [Event and session callbacks](#event-session-callbacks) - * [Disable tracking](#disable-tracking) - * [Offline mode](#offline-mode) - * [Event buffering](#event-buffering) - * [GDPR right to be forgotten](#gdpr-forget-me) - * [Third-party sharing](#third-party-sharing) - * [Disable third-party sharing](#disable-third-party-sharing) - * [Enable third-party sharing](#enable-third-party-sharing) - * [Consent measurement](#measurement-consent) - * [SDK signature](#sdk-signature) - * [Background tracking](#background-tracking) - * [Device IDs](#device-ids) - * [iOS Advertising Identifier](#di-idfa) - * [Adjust device identifier](#di-adid) - * [User attribution](#user-attribution) - * [Push token](#push-token) - * [Pre-installed trackers](#pre-installed-trackers) - * [Deep linking](#deeplinking) - * [Standard deep linking scenario](#deeplinking-standard) - * [Deep linking on iOS 8 and earlier](#deeplinking-setup-old) - * [Deep linking on iOS 9 and later](#deeplinking-setup-new) - * [Deferred deep linking scenario](#deeplinking-deferred) - * [Reattribution via deep links](#deeplinking-reattribution) - * [Link resolution](#link-resolution) - * [Data residency](#data-residency) - * [COPPA compliance](#af-coppa-compliance) -* [Troubleshooting](#troubleshooting) - * [Issues with delayed SDK initialisation](#ts-delayed-init) - * [I'm seeing "Adjust requires ARC" error](#ts-arc) - * [I'm seeing "\[UIDevice adjTrackingEnabled\]: unrecognized selector sent to instance" error](#ts-categories) - * [I'm seeing the "Session failed (Ignoring too frequent session.)" error](#ts-session-failed) - * [I'm not seeing "Install tracked" in the logs](#ts-install-tracked) - * [I'm seeing "Unattributable SDK click ignored" message](#ts-iad-sdk-click) - * [I'm seeing wrong revenue data in the adjust dashboard](#ts-wrong-revenue-amount) -* [License](#license) - -## Example apps - -There are example apps inside the [`examples` directory][examples] for [`iOS (Objective-C)`][example-ios-objc], [`iOS (Swift)`][example-ios-swift], [`tvOS`][example-tvos], [`iMessage`][example-imessage] and [`Apple Watch`][example-iwatch]. You can open any of these Xcode projects to see an example of how the Adjust SDK can be integrated. - -## Basic integration - -We will describe the steps to integrate the Adjust SDK into your iOS project. We are going to assume that you are using Xcode for your iOS development. - -### Add the SDK to your project - -If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue from [this step](#sdk-integrate): - -```ruby -pod 'Adjust', '~> 4.31.0' -``` - -or: - -```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.31.0' -``` - ---- - -If you're using [Carthage][carthage], you can add following line to your `Cartfile` and continue from [this step](#sdk-frameworks): - -```ruby -github "adjust/ios_sdk" -``` - ---- - -If you're using Swift Package Manager, you can add the repository address directly in Xcode going to `File > Swift Packages > Add Package Dependency` and continue from [this step](#sdk-frameworks): - -``` -https://github.com/adjust/ios_sdk -``` - ---- - -You can also choose to integrate the Adjust SDK by adding it to your project as a framework. On the [releases page][releases] you can find the following archives: - -* `AdjustSdkStatic.framework.zip` -* `AdjustSdkDynamic.framework.zip` -* `AdjustSdkTv.framework.zip` -* `AdjustSdkIm.framework.zip` - -Since the release of iOS 8, Apple has introduced dynamic frameworks (also known as embedded frameworks). If your app is targeting iOS 8 or higher, you can use the Adjust SDK dynamic framework. Choose which framework you want to use – static or dynamic – and add it to your project. - -If you are having `tvOS` app, you can use the Adjust SDK with it as well with usage of our tvOS framework which you can extract from `AdjustSdkTv.framework.zip` archive. - -If you are having `iMessage` app, you can use the Adjust SDK with it as well with usage of our IM framework which you can extract from `AdjustSdkIm.framework.zip` archive. - -### Add iOS frameworks - -Adjust SDK is able to get additional information in case you link additional iOS frameworks to your app. Please, add following frameworks in case you want to enable Adjust SDK features based on their presence in your app and mark them as optional: - -- `AdSupport.framework` - This framework is needed so that SDK can access to IDFA value and (prior to iOS 14) LAT information. -- `iAd.framework` - This framework is needed so that SDK can automatically handle attribution for ASA campaigns you might be running. -- `AdServices.framework` - For devices running iOS 14.3 or higher, this framework allows the SDK to automatically handle attribution for ASA campaigns. It is required when leveraging the Apple Ads Attribution API. -- `CoreTelephony.framework` - This framework is needed so that SDK can determine current radio access technology. -- `StoreKit.framework` - This framework is needed for access to `SKAdNetwork` framework and for Adjust SDK to handle communication with it automatically in iOS 14 or later. -- `AppTrackingTransparency.framework` - This framework is needed in iOS 14 and later for SDK to be able to wrap user's tracking consent dialog and access to value of the user's consent to be tracked or not. - -### Integrate the SDK into your app - -If you added the Adjust SDK via a Pod repository, you should use one of the following import statements: - -```objc -#import "Adjust.h" -``` - -or - -```objc -#import -``` - ---- - -If you added the Adjust SDK as a static/dynamic framework or via Carthage, you should use the following import statement: - -```objc -#import -``` - ---- - -If you are are using the Adjust SDK with your tvOS app, you should use the following import statement: - -```objc -#import -``` - ---- - -If you are are using the Adjust SDK with your iMessage app, you should use the following import statement: - -```objc -#import -``` - -Next, we'll set up basic session tracking. - -### Basic setup - -In the Project Navigator, open the source file of your application delegate. Add the `import` statement at the top of the file, then add the following call to `Adjust` in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate: - -```objc -#import "Adjust.h" -// or #import -// or #import -// or #import -// or #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -![][delegate] - -**Note**: Initialising the Adjust SDK like this is `very important`. Otherwise, you may encounter different kinds of issues as described in our [troubleshooting section](#ts-delayed-init). - -Replace `{YourAppToken}` with your app token. You can find this in your [dashboard]. - -Depending on whether you build your app for testing or for production, you must set `environment` with one of these values: - -```objc -NSString *environment = ADJEnvironmentSandbox; -NSString *environment = ADJEnvironmentProduction; -``` - -**Important:** This value should be set to `ADJEnvironmentSandbox` if and only if you or someone else is testing your app. Make sure to set the environment to `ADJEnvironmentProduction` just before you publish the app. Set it back to `ADJEnvironmentSandbox` when you start developing and testing it again. - -We use this environment to distinguish between real traffic and test traffic from test devices. It is very important that you keep this value meaningful at all times! This is especially important if you are tracking revenue. - -### iMessage specific setup - -**Adding SDK from source:** In case that you have chosen to add Adjust SDK to your iMessage app **from source**, please make sure that you have pre-processor macro **ADJUST_IM=1** set in your iMessage project settings. - -**Adding SDK as framework:** After you have added `AdjustSdkIm.framework` to your iMessage app, please make sure to add `New Copy Files Phase` in your `Build Phases` project settings and select that `AdjustSdkIm.framework` should be copied to `Frameworks` folder. - -**Session tracking:** If you would like to have session tracking properly working in your iMessage app, you will need to do one additional integration step. In standard iOS apps Adjust SDK is automatically subscribed to iOS system notifications which enable us to know when app entered or left foreground. In case of iMessage app, this is not the case, so we need you to add explicit calls to `trackSubsessionStart` and `trackSubsessionEnd` methods inside of your iMessage app view controller to make our SDK aware of the moments when your app is being in foreground or not. - -Add call to `trackSubsessionStart` inside of `didBecomeActiveWithConversation:` method: - -```objc --(void)didBecomeActiveWithConversation:(MSConversation *)conversation { - // Called when the extension is about to move from the inactive to active state. - // This will happen when the extension is about to present UI. - // Use this method to configure the extension and restore previously stored state. - - [Adjust trackSubsessionStart]; -} -``` - -Add call to `trackSubsessionEnd` inside of `willResignActiveWithConversation:` method: - -```objc --(void)willResignActiveWithConversation:(MSConversation *)conversation { - // Called when the extension is about to move from the active to inactive state. - // This will happen when the user dissmises the extension, changes to a different - // conversation or quits Messages. - - // Use this method to release shared resources, save user data, invalidate timers, - // and store enough state information to restore your extension to its current state - // in case it is terminated later. - - [Adjust trackSubsessionEnd]; -} -``` - -With this set, Adjust SDK will be able to successfully perform session tracking inside of your iMessage app. - -**Note:** You should be aware that your iOS app and iMessage extension you wrote for it are running in different memory spaces and they as well have different bundle identifiers. Initialising Adjust SDK with same app token in both places will result in two independent instances tracking things unaware of each other which might cause data mixture you don't want to see in your dashboard data. General advice would be to create separate app in Adjust dashboard for your iMessage app and initialise SDK inside of it with separate app token. - -### Adjust logging - -You can increase or decrease the amount of logs that you see during testing by calling `setLogLevel:` on your `ADJConfig` instance with one of the following parameters: - -```objc -[adjustConfig setLogLevel:ADJLogLevelVerbose]; // enable all logging -[adjustConfig setLogLevel:ADJLogLevelDebug]; // enable more logging -[adjustConfig setLogLevel:ADJLogLevelInfo]; // the default -[adjustConfig setLogLevel:ADJLogLevelWarn]; // disable info logging -[adjustConfig setLogLevel:ADJLogLevelError]; // disable warnings as well -[adjustConfig setLogLevel:ADJLogLevelAssert]; // disable errors as well -[adjustConfig setLogLevel:ADJLogLevelSuppress]; // disable all logging -``` - -If you don't want your app in production to display any logs coming from the Adjust SDK, then you should select `ADJLogLevelSuppress` and in addition to that, initialise `ADJConfig` object with another constructor where you should enable suppress log level mode: - -```objc -#import "Adjust.h" -// or #import -// or #import -// or #import -// or #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment - allowSuppressLogLevel:YES]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -### Build your app - -Build and run your app. If the build succeeds, you should carefully read the SDK logs in the console. After the app launches for the first time, you should see the info log `Install tracked`. - -![][run] - -## Additional features - -Once you integrate the Adjust SDK into your project, you can take advantage of the following features. - -### AppTrackingTransparency framework - -For each package sent, the Adjust backend receives one of the following four (4) states of consent for access to app-related data that can be used for tracking the user or the device: - -- Authorized -- Denied -- Not Determined -- Restricted - -After a device receives an authorization request to approve access to app-related data, which is used for user device tracking, the returned status will either be Authorized or Denied. - -Before a device receives an authorization request for access to app-related data, which is used for tracking the user or device, the returned status will be Not Determined. - -If authorization to use app tracking data is restricted, the returned status will be Restricted. - -The SDK has a built-in mechanism to receive an updated status after a user responds to the pop-up dialog, in case you don't want to customize your displayed dialog pop-up. To conveniently and efficiently communicate the new state of consent to the backend, Adjust SDK offers a wrapper around the app tracking authorization method described in the following chapter, App-tracking authorization wrapper. - -### App-tracking authorisation wrapper - -Adjust SDK offers the possibility to use it for requesting user authorization in accessing their app-related data. Adjust SDK has a wrapper built on top of the [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) method, where you can as well define the callback method to get information about a user's choice. Also, with the use of this wrapper, as soon as a user responds to the pop-up dialog, it's then communicated back using your callback method. The SDK will also inform the backend of the user's choice. The `NSUInteger` value will be delivered via your callback method with the following meaning: - -- 0: `ATTrackingManagerAuthorizationStatusNotDetermined` -- 1: `ATTrackingManagerAuthorizationStatusRestricted` -- 2: `ATTrackingManagerAuthorizationStatusDenied` -- 3: `ATTrackingManagerAuthorizationStatusAuthorized` - -To use this wrapper, you can call it as such: - -```objc -[Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) { - switch (status) { - case 0: - // ATTrackingManagerAuthorizationStatusNotDetermined case - break; - case 1: - // ATTrackingManagerAuthorizationStatusRestricted case - break; - case 2: - // ATTrackingManagerAuthorizationStatusDenied case - break; - case 3: - // ATTrackingManagerAuthorizationStatusAuthorized case - break; - } -}]; -``` - -### Get current authorisation status - -To get the current app tracking authorization status you can call `[Adjust appTrackingAuthorizationStatus]` that will return one of the following possibilities: - -* `0`: The user hasn't been asked yet -* `1`: The user device is restricted -* `2`: The user denied access to IDFA -* `3`: The user authorized access to IDFA -* `-1`: The status is not available - -### Check for ATT status change - -In cases where you are not using [Adjust app-tracking authorization wrapper](#ata-wrapper), Adjust SDK will not be able to know immediately upon answering the dialog what is the new value of app-tracking status. In situations like this, if you would want Adjust SDK to read the new app-tracking status value and communicate it to our backend, make sure to make a call to this method: - -```objc -[Adjust checkForNewAttStatus]; -``` - -### SKAdNetwork framework - -If you have implemented the Adjust iOS SDK v4.23.0 or above and your app is running on iOS 14, the communication with SKAdNetwork will be set on by default, although you can choose to turn it off. When set on, Adjust automatically registers for SKAdNetwork attribution when the SDK is initialized. If events are set up in the Adjust dashboard to receive conversion values, the Adjust backend sends the conversion value data to the SDK. The SDK then sets the conversion value. After Adjust receives the SKAdNetwork callback data, it is then displayed in the dashboard. - -In case you don't want the Adjust SDK to automatically communicate with SKAdNetwork, you can disable that by calling the following method on configuration object: - -```objc -[adjustConfig deactivateSKAdNetworkHandling]; -``` - -### Update SKAdNetwork conversion value - -As of iOS SDK v4.26.0 you can use Adjust SDK wrapper method `updateConversionValue:` to update SKAdNetwork conversion value for your user: - -```objc -[Adjust updateConversionValue:6]; -``` - -### Conversion value updated callback - -You can register callback to get notified each time when Adjust SDK updates conversion value for the user. You need to implement `AdjustDelegate` protocol, implement optional `adjustConversionValueUpdated:` method: - -```objc -- (void)adjustConversionValueUpdated:(NSNumber *)conversionValue { - NSLog(@"Conversion value updated callback called!"); - NSLog(@"Conversion value: %@", conversionValue); -} -``` - -### Event tracking - -You can use adjust to track events. Lets say you want to track every tap on a particular button. You would create a new event token in your [dashboard], which has an associated event token - looking something like `abc123`. In your button's `buttonDown` method you would then add the following lines to track the tap: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[Adjust trackEvent:event]; -``` - -When tapping the button you should now see `Event tracked` in the logs. - -The event instance can be used to configure the event further before tracking it: - -### Revenue tracking - -If your users can generate revenue by tapping on advertisements or making in-app purchases you can track those revenues with events. Lets say a tap is worth one Euro cent. You could then track the revenue event like this: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setRevenue:0.01 currency:@"EUR"]; - -[Adjust trackEvent:event]; -``` - -This can be combined with callback parameters of course. - -When you set a currency token, adjust will automatically convert the incoming revenues into a reporting revenue of your choice. Read more about [currency conversion here.][currency-conversion] - -You can read more about revenue and event tracking in the [event tracking guide](https://docs.adjust.com/en/event-tracking/#tracking-purchases-and-revenues). - -### Revenue deduplication - -You can also pass in an optional transaction ID to avoid tracking duplicate revenues. The last ten transaction IDs are remembered and revenue events with duplicate transaction IDs are skipped. This is especially useful for in-app purchase tracking. See an example below. - -If you want to track in-app purchases, please make sure to call `trackEvent` after `finishTransaction` in `paymentQueue:updatedTransactions` only if the state changed to `SKPaymentTransactionStatePurchased`. That way you can avoid tracking revenue that is not actually being generated. - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState) { - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - ADJEvent *event = [ADJEvent eventWithEventToken:...]; - [event setRevenue:... currency:...]; - [event setTransactionId:transaction.transactionIdentifier]; // avoid duplicates - [Adjust trackEvent:event]; - - break; - // more cases - } - } -} -``` - -### Callback parameters - -You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the event is tracked. You can add callback parameters to that event by calling `addCallbackParameter` to the event before tracking it. We will then append these parameters to your callback URL. - -For example, suppose you have registered the URL `http://www.mydomain.com/callback` then track an event like this: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -In that case we would track the event and send a request to: - - http://www.mydomain.com/callback?key=value&foo=bar - -It should be mentioned that we support a variety of placeholders like `{idfa}` that can be used as parameter values. In the resulting callback this placeholder would be replaced with the ID for Advertisers of the current device. Also note that we don't store any of your custom parameters, but only append them to your callbacks, thus without a callback they will not be saved nor sent to you. - -You can read more about using URL callbacks, including a full list of available values, in our [callbacks guide][callbacks-guide]. - -### Partner parameters - -You can also add parameters to be transmitted to network partners, which have been activated in your Adjust dashboard. - -This works similarly to the callback parameters mentioned above, but can be added by calling the `addPartnerParameter` method on your `ADJEvent` instance. - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addPartnerParameter:@"key" value:@"value"]; -[event addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -You can read more about special partners and these integrations in our [guide to special partners][special-partners]. - -### Callback identifier - -You can also add custom string identifier to each event you want to track. This identifier will later be reported in event success and/or event failure callbacks to enable you to keep track on which event was successfully tracked or not. You can set this identifier by calling the `setCallbackId` method on your `ADJEvent` instance: - - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setCallbackId:@"Your-Custom-Id"]; - -[Adjust trackEvent:event]; -``` - -### Session parameters - -Some parameters are saved to be sent in every event and session of the Adjust SDK. Once you have added any of these parameters, you don't need to add them every time, since they will be saved locally. If you add the same parameter twice, there will be no effect. - -If you want to send session parameters with the initial install event, they must be called before the Adjust SDK launches via `[Adjust appDidLaunch:]`. If you need to send them with an install, but can only obtain the needed values after launch, it's possible to [delay](#delay-start) the first launch of the Adjust SDK to allow this behavior. - -### Session callback parameters - -The same callback parameters that are registered for [events](#callback-parameters) can be also saved to be sent in every event or session of the Adjust SDK. - -The session callback parameters have a similar interface of the event callback parameters. Instead of adding the key and it's value to an event, it's added through a call to `Adjust` method `addSessionCallbackParameter:value:`: - -```objc -[Adjust addSessionCallbackParameter:@"foo" value:@"bar"]; -``` - -The session callback parameters will be merged with the callback parameters added to an event. The callback parameters added to an event have precedence over the session callback parameters. Meaning that, when adding a callback parameter to an event with the same key to one added from the session, the value that prevails is the callback parameter added to the event. - -It's possible to remove a specific session callback parameter by passing the desiring key to the method `removeSessionCallbackParameter`. - -```objc -[Adjust removeSessionCallbackParameter:@"foo"]; -``` - -If you wish to remove all key and values from the session callback parameters, you can reset it with the method `resetSessionCallbackParameters`. - -```objc -[Adjust resetSessionCallbackParameters]; -``` - -### Session partner parameters - -In the same way that there is [session callback parameters](#session-callback-parameters) that are sent every in event or session of the Adjust SDK, there is also session partner parameters. - -These will be transmitted to network partners, for the integrations that have been activated in your adjust [dashboard]. - -The session partner parameters have a similar interface to the event partner parameters. Instead of adding the key and it's value to an event, it's added through a call to `Adjust` method `addSessionPartnerParameter:value:`: - -```objc -[Adjust addSessionPartnerParameter:@"foo" value:@"bar"]; -``` - -The session partner parameters will be merged with the partner parameters added to an event. The partner parameters added to an event have precedence over the session partner parameters. Meaning that, when adding a partner parameter to an event with the same key to one added from the session, the value that prevails is the partner parameter added to the event. - -It's possible to remove a specific session partner parameter by passing the desiring key to the method `removeSessionPartnerParameter`. - -```objc -[Adjust removeSessionPartnerParameter:@"foo"]; -``` - -If you wish to remove all key and values from the session partner parameters, you can reset it with the method `resetSessionPartnerParameters`. - -```objc -[Adjust resetSessionPartnerParameters]; -``` - -### Delay start - -Delaying the start of the Adjust SDK allows your app some time to obtain session parameters, such as unique identifiers, to be send on install. - -Set the initial delay time in seconds with the method `setDelayStart` in the `ADJConfig` instance: - -```objc -[adjustConfig setDelayStart:5.5]; -``` - -In this case this will make the Adjust SDK not send the initial install session and any event created for 5.5 seconds. After this time is expired or if you call `[Adjust sendFirstPackages]` in the meanwhile, every session parameter will be added to the delayed install session and events and the Adjust SDK will resume as usual. - -**The maximum delay start time of the Adjust SDK is 10 seconds**. - -### Attribution callback - -You can register a delegate callback to be notified of tracker attribution changes. Due to the different sources considered for attribution, this information can not be provided synchronously. Follow these steps to implement the optional delegate protocol in your app delegate: - -Please make sure to consider our [applicable attribution data policies.][attribution-data] - -1. Open `AppDelegate.h` and add the import and the `AdjustDelegate` declaration. - - ```objc - @interface AppDelegate : UIResponder - ``` - -2. Open `AppDelegate.m` and add the following delegate callback function to your app delegate implementation. - - ```objc - - (void)adjustAttributionChanged:(ADJAttribution *)attribution { - } - ``` - -3. Set the delegate with your `ADJConfig` instance: - - ```objc - [adjustConfig setDelegate:self]; - ``` - -As the delegate callback is configured using the `ADJConfig` instance, you should call `setDelegate` before calling `[Adjust appDidLaunch:adjustConfig]`. - -The delegate function will be called after the SDK receives the final attribution data. Within the delegate function you have access to the `attribution` parameter. Here is a quick summary of its properties: - -- `NSString trackerToken` the tracker token of the current attribution. -- `NSString trackerName` the tracker name of the current attribution. -- `NSString network` the network grouping level of the current attribution. -- `NSString campaign` the campaign grouping level of the current attribution. -- `NSString adgroup` the ad group grouping level of the current attribution. -- `NSString creative` the creative grouping level of the current attribution. -- `NSString clickLabel` the click label of the current attribution. -- `NSString adid` the unique device identifier provided by attribution. -- `NSString costType` the cost type string. -- `NSNumber costAmount` the cost amount. -- `NSString costCurrency` the cost currency string. - -If any value is unavailable, it will default to `nil`. - -Note: The cost data - `costType`, `costAmount` & `costCurrency` are only available when configured in `ADJConfig` by calling `setNeedsCost:` method. If not configured or configured, but not being part of the attribution, these fields will have value `nil`. This feature is available in SDK v4.24.0 and above. - -### Ad revenue tracking - -**Note**: This ad revenue tracking API is available only in the native SDK v4.29.0 and above. - -You can track ad revenue information with Adjust SDK by invoking the following method: - -```objc -// initilise ADJAdRevenue instance with appropriate ad revenue source -ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source]; -// pass revenue and currency values -[adRevenue setRevenue:1.6 currency:@"USD"]; -// pass optional parameters -[adRevenue setAdImpressionsCount:adImpressionsCount]; -[adRevenue setAdRevenueUnit:adRevenueUnit]; -[adRevenue setAdRevenuePlacement:adRevenuePlacement]; -[adRevenue setAdRevenueNetwork:adRevenueNetwork]; -// attach callback and/or partner parameter if needed -[adRevenue addCallbackParameter:key value:value]; -[adRevenue addPartnerParameter:key value:value]; - -// track ad revenue -[Adjust trackAdRevenue:source payload:payload]; -``` - -Currently we support the below `source` parameter values: - -- `ADJAdRevenueSourceAppLovinMAX` - representing AppLovin MAX platform. -- `ADJAdRevenueSourceMopub` - representing MoPub platform. -- `ADJAdRevenueSourceAdMob` - representing AdMob platform. -- `ADJAdRevenueSourceIronSource` - representing IronSource platform. -- `ADJAdRevenueSourceAdMost`- representing AdMost platform. -- `ADJAdRevenueSourceUnity` - representing Unity platform. -- `ADJAdRevenueSourceHeliumChartboost` - representing Helium Chartboost platform. -- `ADJAdRevenueSourcePublisher` - representing Generic platform. - -**Note**: Additional documentation which explains detailed integration with every of the supported sources will be provided outside of this README. Also, in order to use this feature, additional setup is needed for your app in Adjust dashboard, so make sure to get in touch with our support team to make sure that everything is set up correctly before you start to use this feature. - -### Subscription tracking - -**Note**: This feature is only available in the native SDK v4.22.0 and above. We recommend using at least version 4.22.1. - -**Important**: The following steps only set up subscription tracking within the SDK. To complete setup, certain app-specific information must be added within Adjust’s internal interface. An Adjust representative must take this action: please contact support@adjust.com or your Technical Account Manager. - -You can track App Store subscriptions and verify their validity with the Adjust SDK. After a subscription has been successfully purchased, make the following call to the Adjust SDK: - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -[Adjust trackSubscription:subscription]; -``` - -Only do this when the state has changed to `SKPaymentTransactionStatePurchased` or `SKPaymentTransactionStateRestored`. Then make a call to `finishTransaction` in `paymentQueue:updatedTransactions` . - -Subscription tracking parameters: - -- [price](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc) -- currency (you need to pass [currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object) -- [transactionId](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc) -- [receipt](https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl) -- [transactionDate](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate?language=objc) -- salesRegion (you need to pass [countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc) of the [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) object) - -Just like with event tracking, you can attach callback and partner parameters to the subscription object as well: - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -// add callback parameters -[subscription addCallbackParameter:@"key" value:@"value"]; -[subscription addCallbackParameter:@"foo" value:@"bar"]; - -// add partner parameters -[subscription addPartnerParameter:@"key" value:@"value"]; -[subscription addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackSubscription:subscription]; -``` - -### Event and session callbacks - -You can register a delegate callback to be notified of successful and failed tracked events and/or sessions. The same optional protocol `AdjustDelegate` used for the [attribution callback](#attribution-callback) is used. - -Follow the same steps and implement the following delegate callback function for successful tracked events: - -```objc -- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData { -} -``` - -The following delegate callback function for failed tracked events: - -```objc -- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData { -} -``` - -For successful tracked sessions: - -```objc -- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData { -} -``` - -And for failed tracked sessions: - -```objc -- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData { -} -``` - -The delegate functions will be called after the SDK tries to send a package to the server. Within the delegate callback you have access to a response data object specifically for the delegate callback. Here is a quick summary of the session response data properties: - -- `NSString message` the message from the server or the error logged by the SDK. -- `NSString timeStamp` timestamp from the server. -- `NSString adid` a unique device identifier provided by adjust. -- `NSDictionary jsonResponse` the JSON object with the response from the server. - -Both event response data objects contain: - -- `NSString eventToken` the event token, if the package tracked was an event. -- `NSString callbackId` the custom defined callback ID set on event object. - -If any value is unavailable, it will default to `nil`. - -And both event and session failed objects also contain: - -- `BOOL willRetry` indicates that there will be an attempt to resend the package at a later time. - -### Disable tracking - -You can disable the Adjust SDK from tracking any activities of the current device by calling `setEnabled` with parameter `NO`. **This setting is remembered between sessions**. - -```objc -[Adjust setEnabled:NO]; -``` - -You can check if the Adjust SDK is currently enabled by calling the function `isEnabled`. It is always possible to activate the Adjust SDK by invoking `setEnabled` with the enabled parameter as `YES`. - -### Offline mode - -You can put the Adjust SDK in offline mode to suspend transmission to our servers while retaining tracked data to be sent later. While in offline mode, all information is saved in a file, so be careful not to trigger too many events while in offline mode. - -You can activate offline mode by calling `setOfflineMode` with the parameter `YES`. - -```objc -[Adjust setOfflineMode:YES]; -``` - -Conversely, you can deactivate offline mode by calling `setOfflineMode` with `NO`. When the Adjust SDK is put back in online mode, all saved information is sent to our servers with the correct time information. - -Unlike disabling tracking, this setting is **not remembered** bettween sessions. This means that the SDK is in online mode whenever it is started, even if the app was terminated in offline mode. - -### Event buffering - -If your app makes heavy use of event tracking, you might want to delay some HTTP requests in order to send them in one batch every minute. You can enable event buffering with your `ADJConfig` instance: - -```objc -[adjustConfig setEventBufferingEnabled:YES]; -``` - -If nothing is set, event buffering is **disabled by default**. - -### GDPR right to be forgotten - -In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten. Calling the following method will instruct the Adjust SDK to communicate the user's choice to be forgotten to the Adjust backend: - -```objc -[Adjust gdprForgetMe]; -``` - -Upon receiving this information, Adjust will erase the user's data and the Adjust SDK will stop tracking the user. No requests from this device will be sent to Adjust in the future. - -## Third-party sharing for specific users - -You can notify Adjust when a user disables, enables, and re-enables data sharing with third-party partners. - -### Disable third-party sharing for specific users - -Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@NO]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -Upon receiving this information, Adjust will block the sharing of that specific user's data to partners and the Adjust SDK will continue to work as usual. - -### Enable or re-enable third-party sharing for specific users - -Call the following method to instruct the Adjust SDK to communicate the user's choice to share data or change data sharing, to the Adjust backend: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@YES]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected. - -Call the following method to instruct the Adjust SDK to send the granular options to the Adjust backend: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:nil]; -[adjustThirdPartySharing addGranularOption:@"PartnerA" key:@"foo" value:@"bar"]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -### Consent measurement for specific users - -To enable or disable the Data Privacy settings in the Adjust Dashboard, including the consent expiry period and the user data retention period, you need to implement the below method. - -Call the following method to instruct the Adjust SDK to communicate the Data Privacy settings, to the Adjust backend: - -```objc -[Adjust trackMeasurementConsent:YES]; -``` - -Upon receiving this information, Adjust changes sharing the specific user's data to partners. The Adjust SDK will continue to work as expected. - -### SDK signature - -The Adjust SDK signature is enabled on a client-by-client basis. If you are interested in using this feature, please contact your account manager. - -If the SDK signature has already been enabled on your account and you have access to App Secrets in your Adjust Dashboard, please use the method below to integrate the SDK signature into your app. - -An App Secret is set by calling `setAppSecret` on your `AdjustConfig` instance: - -```objc -[adjustConfig setAppSecret:secretId info1:info1 info2:info2 info3:info3 info4:info4]; -``` - -### Background tracking - -The default behaviour of the Adjust SDK is to pause sending HTTP requests while the app is in the background. You can change this in your `AdjustConfig` instance: - -```objc -[adjustConfig setSendInBackground:YES]; -``` - -If nothing is set, sending in background is **disabled by default**. - -### Device IDs - -The Adjust SDK offers you possibility to obtain some of the device identifiers. - -### iOS Advertising Identifier - -Certain services (such as Google Analytics) require you to coordinate device and client IDs in order to prevent duplicate reporting. - -To obtain the device identifier IDFA, call the function `idfa`: - -```objc -NSString *idfa = [Adjust idfa]; -``` - -### Adjust device identifier - -For each device with your app installed, adjust backend generates unique **adjust device identifier** (**adid**). In order to obtain this identifier, you can make a call to the following method on the `Adjust` instance: - -```objc -NSString *adid = [Adjust adid]; -``` - -**Note**: Information about the **adid** is available after the app's installation has been tracked by the adjust backend. From that moment on, the Adjust SDK has information about the device **adid** and you can access it with this method. So, **it is not possible** to access the **adid** before the SDK has been initialised and the installation of your app has been tracked successfully. - -### User attribution - -The attribution callback will be triggered as described in the [attribution callback section](#attribution-callback), providing you with the information about any new attribution when ever it changes. In any other case, where you want to access information about your user's current attribution, you can make a call to the following method of the `Adjust` instance: - -```objc -ADJAttribution *attribution = [Adjust attribution]; -``` - -**Note**: Information about current attribution is available after app installation has been tracked by the adjust backend and attribution callback has been initially triggered. From that moment on, Adjust SDK has information about your user's attribution and you can access it with this method. So, **it is not possible** to access user's attribution value before the SDK has been initialised and attribution callback has been initially triggered. - -### Push token - -Push tokens are used for Audience Builder and client callbacks, and they are required for uninstall and reinstall tracking. - -To send us the push notification token, add the following call to `Adjust` in the `didRegisterForRemoteNotificationsWithDeviceToken` of your app delegate: - -```objc -- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [Adjust setDeviceToken:deviceToken]; -} -``` - -### Pre-installed trackers - -If you want to use the Adjust SDK to recognize users that found your app pre-installed on their device, follow these steps. - -1. Create a new tracker in your [dashboard]. -2. Open your app delegate and add set the default tracker of your `ADJConfig`: - - ```objc - ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; - [adjustConfig setDefaultTracker:@"{TrackerToken}"]; - [Adjust appDidLaunch:adjustConfig]; - ``` - - Replace `{TrackerToken}` with the tracker token you created in step 2. Please note that the dashboard displays a tracker - URL (including `http://app.adjust.com/`). In your source code, you should specify only the six-character token and not - the entire URL. - -3. Build and run your app. You should see a line like the following in XCode: - - ``` - Default tracker: 'abc123' - ``` - -### Deep linking - -If you are using the adjust tracker URL with an option to deep link into your app from the URL, there is the possibility to get info about the deep link URL and its content. Hitting the URL can happen when the user has your app already installed (standard deep linking scenario) or if they don't have the app on their device (deferred deep linking scenario). Both of these scenarios are supported by the Adjust SDK and in both cases the deep link URL will be provided to you after you app has been started after hitting the tracker URL. In order to use this feature in your app, you need to set it up properly. - -### Standard deep linking scenario - -If your user already has the app installed and hits the tracker URL with deep link information in it, your application will be opened and the content of the deep link will be sent to your app so that you can parse it and decide what to do next. With introduction of iOS 9, Apple has changed the way how deep linking should be handled in the app. Depending on which scenario you want to use for your app (or if you want to use them both to support wide range of devices), you need to set up your app to handle one or both of the following scenarios. - -### Deep linking on iOS 8 and earlier - -Deep linking on iOS 8 and earlier devices is being done with usage of a custom URL scheme setting. You need to pick a custom URL scheme name which your app will be in charge for opening. This scheme name will also be used in the adjust tracker URL as part of the `deep_link` parameter. In order to set this in your app, open your `Info.plist` file and add new `URL types` row to it. In there, as `URL identifier` write you app's bundle ID and under `URL schemes` add scheme name(s) which you want your app to handle. In the example below, we have chosen that our app should handle the `adjustExample` scheme name. - -![][custom-url-scheme] - -After this has been set up, your app will be opened after you click the adjust tracker URL with `deep_link` parameter which contains the scheme name which you have chosen. After app is opened, `openURL` method of your `AppDelegate` class will be triggered and the place where the content of the `deep_link` parameter from the tracker URL will be delivered. If you want to access the content of the deep link, override this method. - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url object contains your deep link content - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -With this setup, you have successfully set up deep linking handling for iOS devices with iOS 8 and earlier versions. - -### Deep linking on iOS 9 and later - -In order to set deep linking support for iOS 9 and later devices, you need to enable your app to handle Apple universal links. To find out more about universal links and how their setup looks like, you can check [here][universal-links]. - -Adjust is taking care of lots of things to do with universal links behind the scenes. But, in order to support universal links with the adjust, you need to perform small setup for universal links in the adjust dashboard. For more information on that should be done, please consult our official [docs][universal-links-guide]. - -Once you have successfully enabled the universal links feature in the dashboard, you need to do this in your app as well: - -After enabling `Associated Domains` for your app in Apple Developer Portal, you need to do the same thing in your app's Xcode project. After enabling `Assciated Domains`, add the universal link which was generated for you in the adjust dashboard in the `Domains` section by prefixing it with `applinks:` and make sure that you also remove the `http(s)` part of the universal link. - -![][associated-domains-applinks] - -After this has been set up, your app will be opened after you click the adjust tracker universal link. After app is opened, `continueUserActivity` method of your `AppDelegate` class will be triggered and the place where the content of the universal link URL will be delivered. If you want to access the content of the deep link, override this method. - -``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - // url object contains your universal link content - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -With this setup, you have successfully set up deep linking handling for iOS devices with iOS 9 and later versions. - -We provide a helper function that allows you to convert a universal link to an old style deep link URL, in case you had some custom logic in your code which was always expecting deep link info to arrive in old style custom URL scheme format. You can call this method with universal link and the custom URL scheme name which you would like to see your deep link prefixed with and we will generate the custom URL scheme deep link for you: - -``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### Deferred deep linking scenario - -You can register a delegate callback to be notified before a deferred deep link is opened and decide if the Adjust SDK will try to open it. The same optional protocol `AdjustDelegate` used for the [attribution callback](#attribution-callback) and for [event and session callbacks](#event-session-callbacks) is used. - -Follow the same steps and implement the following delegate callback function for deferred deep links: - -```objc -- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink { - // deeplink object contains information about deferred deep link content - - // Apply your logic to determine whether the Adjust SDK should try to open the deep link - return YES; - // or - // return NO; -} -``` - -The callback function will be called after the SDK receives a deferred deep link from our server and before opening it. Within the callback function you have access to the deep link. The returned boolean value determines if the SDK will launch the deep link. You could, for example, not allow the SDK to open the deep link at the current moment, save it, and open it yourself later. - -If this callback is not implemented, **the Adjust SDK will always try to open the deep link by default**. - -### Reattribution via deep links - -Adjust enables you to run re-engagement campaigns with usage of deep links. For more information on how to do that, please check our [official docs][reattribution-with-deeplinks]. - -If you are using this feature, in order for your user to be properly reattributed, you need to make one additional call to the Adjust SDK in your app. - -Once you have received deep link content information in your app, add a call to the `appWillOpenUrl` method. By making this call, the Adjust SDK will try to find if there is any new attribution info inside of the deep link and if any, it will be sent to the adjust backend. If your user should be reattributed due to a click on the adjust tracker URL with deep link content in it, you will see the [attribution callback](#attribution-callback) in your app being triggered with new attribution info for this user. - -The call to `appWillOpenUrl` should be done like this to support deep linking reattributions in all iOS versions: - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url object contains your deep link content - - [Adjust appWillOpenUrl:url]; - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL url = [userActivity webpageURL]; - - [Adjust appWillOpenUrl:url]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### Link resolution - -If you are serving deep links from an Email Service Provider (ESP) and need to track clicks through a custom tracking link, you can use the `resolveLinkWithUrl` method of the `ADJLinkResolution` class to resolve the link. This ensures that you record the interaction with your email tracking campaigns when a deep link is opened in your application. - -The `resolveLinkWithUrl` method takes the following parameters: - -- `url` - the deep link that opened the application -- `resolveUrlSuffixArray` - the custom domains of the configured campaigns that need to be resolved -- `callback` - the callback that will contain the final URL - -If the link received does not belong to any of the domains specified in the `resolveUrlSuffixArray`, the callback will forward the deep link URL as is. If the link does contain one of the domains specified, the SDK will attempt to resolve the link and return the resulting deep link to the `callback` parameter. The returned deep link can also be reattributed in the Adjust SDK using the `[Adjust appWillOpenUrl:]` method. - -> **Note**: The SDK will automatically follow up to ten redirects when attempting to resolve the URL. It will return the latest URL it has followed as the `callback` URL, meaning that if there are more than ten redirects to follow the **tenth redirect URL** will be returned. - -**Example** - -```objc -[ADJLinkResolution - resolveLinkWithUrl:url - resolveUrlSuffixArray:@[@"example.com"] - callback:^(NSURL * _Nullable resolvedLink) - { - [Adjust appWillOpenUrl:resolvedLink]; - }]; -``` - -### Data residency - -In order to enable data residency feature, make sure to make a call to `setUrlStrategy:` method of the `ADJConfig` instance with one of the following constants: - -```objc -[adjustConfig setUrlStrategy:ADJDataResidencyEU]; // for EU data residency region -[adjustConfig setUrlStrategy:ADJDataResidencyTR]; // for Turkey data residency region -[adjustConfig setUrlStrategy:ADJDataResidencyUS]; // for US data residency region -``` - -**Note:** Please, do not turn this setting on before making sure with the support team that this feature is enabled for your app because otherwise SDK traffic will get dropped. - -### COPPA compliance - -By default Adjust SDK doesn't mark app as COPPA compliant. In order to mark your app as COPPA compliant, make sure to call `setCoppaCompliantEnabled` method of `AdjustConfig` instance with boolean parameter `true`: - - - - - - - - - - - - - - -
-Native App SDK -
- -```objc -[adjustConfig setCoppaCompliantEnabled:YES]; -``` -
-Web View SDK -
- -```js -adjustConfig.setCoppaCompliantEnabled(true); -``` -
- -**Note:** By enabling this feature, third-party sharing will be automatically disabled for the users. If later during the app lifetime you decide not to mark app as COPPA compliant anymore, third-party sharing **will not be automatically re-enabled**. Instead, next to not marking your app as COPPA compliant anymore, you will need to explicitly re-enable third-party sharing in case you want to do that. - -## Troubleshooting - -### Issues with delayed SDK initialisation - -As described in the [basic setup step](#basic-setup), we strongly advise you to initialise the Adjust SDK in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate. It is imperative to initialise the Adjust SDK in as soon as possible so that you can use all the features of the SDK. - -Deciding not to initialise the Adjust SDK immediately can have all kinds of impacts on the tracking in your app: **In order to perform any kind of tracking in your app, the Adjust SDK *must* be initialised.** - -If you decide to perform any of these actions: - -* [Event tracking](#event-tracking) -* [Reattribution via deep links](#deeplinking-reattribution) -* [Disable tracking](#disable-tracking) -* [Offline mode](#offline-mode) - -before initialising the SDK, `they won't be performed`. - -If you want any of these actions to be tracked with the Adjust SDK before its actual initialisation, you must build a `custom actions queueing mechanism` inside your app. You need to queue all the actions you want our SDK to perform and perform them once the SDK is initialised. - -Offline mode state won't be changed, tracking enabled/disabled state won't be changed, deep link reattributions will not be possible to happen, any of tracked events will be `dropped`. - -Another thing which might be affected by delayed SDK initialisation is session tracking. The Adjust SDK can't start to collect any session length info before it is actually initialised. This can affect your DAU numbers in the dashboard which might not be tracked properly. - -As an example, let's assume this scenario: You are initialising the Adjust SDK when some specific view or view controller is loaded and let's say that this is not the splash nor the first screen in your app, but user has to navigate to it from the home screen. If user downloads your app and opens it, the home screen will be displayed. At this moment, this user has made an install which should be tracked. However, the Adjust SDK doesn't know anything about this, because the user needs to navigate to the screen mentioned previously where you decided to initialise the Adjust SDK. Further, if the user decides that he/she doesn't like the app and uninstalls it right after seeing home screen, all the information mentioned above will never be tracked by our SDK, nor displayed in the dashboard. - -#### Event tracking - -For the events you want to track, queue them with some internal queueing mechanism and track them after SDK is initialised. Tracking events before initialising SDK will cause the events to be `dropped` and `permanently lost`, so make sure you are tracking them once SDK is `initialised` and [`enabled`](#is-enabled). - -#### Offline mode and enable/disable tracking - -Offline mode is not the feature which is persisted between SDK initialisations, so it is set to `false` by default. If you try to enable offline mode before initialising SDK, it will still be set to `false` when you eventually initialise the SDK. - -Enabling/disabling tracking is the setting which is persisted between the SDK initialisations. If you try to toggle this value before initialising the SDK, toggle attempt will be ignored. Once initialised, SDK will be in the state (enabled or disabled) like before this toggle attempt. - -#### Reattribution via deep links - -As described [above](#deeplinking-reattribution), when handling deep link reattributions, depending on deep linking mechanism you are using (old style vs. universal links), you will obtain `NSURL` object after which you need to make following call: - -```objc -[Adjust appWillOpenUrl:url] -``` - -If you make this call before the SDK has been initialised, information about the attribution information from the deep link URL will be permanetly lost. If you want the Adjust SDK to successfully reattribute your user, you would need to queue this `NSURL` object information and trigger `appWillOpenUrl` method once the SDK has been initialised. - -#### Session tracking - -Session tracking is something what the Adjust SDK performs automatically and is beyond reach of an app developer. For proper session tracking it is crucial to have the Adjust SDK initialised as advised in this README. Not doing so can have unpredicted influences on proper session tracking and DAU numbers in the dashboard. - -For example: -* A user opens but then deletes your app before the SDK was even inialised, causing the install and session to have never been tracked, thus never reported in the dashboard. -* If a user downloads and opens your app before midnight, and the Adjust SDK gets initialised after midnight, all queued install and session data will be reported on wrong day. -* If a user didn't use your app on some day but opens it shortly after midnight and the SDK gets initialised after midnight, causing DAU to be reported on another day from the day of the app opening. - -For all these reasons, please follow the instructions in this document and initialise the Adjust SDK in the `didFinishLaunching` or `didFinishLaunchingWithOptions` method of your app delegate. - -### I'm seeing "Adjust requires ARC" error - -If your build failed with the error `Adjust requires ARC`, it looks like your project is not using [ARC][arc]. In that case we recommend [transitioning your project][transition] so that it does use ARC. If you don't want to use ARC, you have to enable ARC for all source files of adjust in the target's Build Phases: - -Expand the `Compile Sources` group, select all adjust files and change the `Compiler Flags` to `-fobjc-arc` (Select all and press the `Return` key to change all at once). - -### I'm seeing "[UIDevice adjTrackingEnabled]: unrecognized selector sent to instance" error - -This error can occur when you are adding the Adjust SDK framework to your app. The Adjust SDK contains `categories` among it's source files and for this reason, if you have chosen this SDK integration approach, you need to add `-ObjC` flags to `Other Linker Flags` in your Xcode project settings. Adding this flag will fix this error. - -### I'm seeing the "Session failed (Ignoring too frequent session.)" error - -This error typically occurs when testing installs. Uninstalling and reinstalling the app is not enough to trigger a new install. The servers will determine that the SDK has lost its locally aggregated session data and ignore the erroneous message, given the information available on the servers about the device. - -This behaviour can be cumbersome during tests, but is necessary in order to have the sandbox behaviour match production as much as possible. - -You can reset the session data of the device in our servers. Check the error message in the logs: - -``` -Session failed (Ignoring too frequent session. Last session: YYYY-MM-DDTHH:mm:ss, this session: YYYY-MM-DDTHH:mm:ss, interval: XXs, min interval: 20m) (app_token: {yourAppToken}, adid: {adidValue}) -``` - -With the `{yourAppToken}` and either `{adidValue}` or `{idfaValue}` values filled in below, open one of the following links: - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&adid={adidValue} -``` - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&idfa={idfaValue} -``` - -When the device is forgotten, the link just returns `Forgot device`. If the device was already forgotten or the values were incorrect, the link returns `Device not found`. - -### I'm not seeing "Install tracked" in the logs - -If you want to simulate the installation scenario of your app on your test device, it is not enough if you just re-run the app from the Xcode on your test device. Re-running the app from the Xcode doesn't cause app data to be wiped out and all internal files that our SDK is keeping inside your app will still be there, so upon re-run, our SDK will see those files and think of your app was already installed (and that SDK was already launched in it) but just opened for another time rather than being opened for the first time. - -In order to run the app installation scenario, you need to do following: - -* Uninstall app from your device (completely remove it) -* Forget your test device from the adjust backend like explained in the issue [above](#forget-device) -* Run your app from the Xcode on the test device and you will see log message "Install tracked" - -### I'm seeing the "Unattributable SDK click ignored" message - -You may notice this message while testing your app in `sandbox` environment. It is related to some changes Apple introduced in `iAd.framework` version 3. With this, a user can be directed to your app from a click on iAd banner and this will cause our SDK to send an `sdk_click` package to the adjust backend informing it about the content of the clicked URL. For some reason, Apple decided that if the app was opened without clicking on iAd banner, they will artificially generate an iAd banner URL click with some random values. Our SDK won't be able to distinguish if the iAd banner click was genuine or artificially generated and will send an `sdk_click` package regardless to the adjust backend. If you have your log level set to `verbose`, you will see this `sdk_click` package looking something like this: - -``` -[Adjust]d: Added package 1 (click) -[Adjust]v: Path: /sdk_click -[Adjust]v: ClientSdk: ios4.10.1 -[Adjust]v: Parameters: -[Adjust]v: app_token {YourAppToken} -[Adjust]v: created_at 2016-04-15T14:25:51.676Z+0200 -[Adjust]v: details {"Version3.1":{"iad-lineitem-id":"1234567890","iad-org-name":"OrgName","iad-creative-name":"CreativeName","iad-click-date":"2016-04-15T12:25:51Z","iad-campaign-id":"1234567890","iad-attribution":"true","iad-lineitem-name":"LineName","iad-creative-id":"1234567890","iad-campaign-name":"CampaignName","iad-conversion-date":"2016-04-15T12:25:51Z"}} -[Adjust]v: environment sandbox -[Adjust]v: idfa XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -[Adjust]v: idfv YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY -[Adjust]v: needs_response_details 1 -[Adjust]v: source iad3 -``` - -If for some reason this `sdk_click` would be accepted, it would mean that a user who has opened your app by clicking on some other campaign URL or even as an organic user, will get attributed to this unexisting iAd source. This is the reason why our backend ignores it and informs you with this message: - -``` -[Adjust]v: Response: {"message":"Unattributable SDK click ignored."} -[Adjust]i: Unattributable SDK click ignored. -``` - -So, this message doesn't indicate any issue with your SDK integration but it's simply informing you that our backend has ignored this artificially created `sdk_click` which could have lead to your user being wrongly attributed/reattributed. - -### I'm seeing incorrect revenue data in the adjust dashboard - -The Adjust SDK tracks what you tell it to track. If you are attaching revenue to your event, the number you write as an amount is the only amount which will reach the adjust backend and be displayed in the dashboard. Our SDK does not manipulate your amount value, nor does our backend. So, if you see wrong amount being tracked, it's because our SDK was told to track that amount. - -Usually, a user's code for tracking revenue event looks something like this: - -```objc -// ... - -- (double)someLogicForGettingRevenueAmount { - // This method somehow handles how user determines - // what's the revenue value which should be tracked. - - // It is maybe making some calculations to determine it. - - // Or maybe extracting the info from In-App purchase which - // was successfully finished. - - // Or maybe returns some predefined double value. - - double amount; // double amount = some double value - - return amount; -} - -// ... - -- (void)someRandomMethodInTheApp { - double amount = [self someLogicForGettingRevenueAmount]; - - ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - [event setRevenue:amount currency:@"EUR"]; - [Adjust trackEvent:event]; -} - -``` - -If you are seing any value in the dashboard other than what you expected to be tracked, **please, check your logic for determining amount value**. - - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[en-readme]: README.md -[zh-readme]: doc/chinese/README.md -[ja-readme]: doc/japanese/README.md -[ko-readme]: doc/korean/README.md - [en-helpcenter]: https://help.adjust.com/en/developer/ios-sdk-documentation [zh-helpcenter]: https://help.adjust.com/zh/developer/ios-sdk-documentation [ja-helpcenter]: https://help.adjust.com/ja/developer/ios-sdk-documentation [ko-helpcenter]: https://help.adjust.com/ko/developer/ios-sdk-documentation - -[sdk2sdk-mopub]: doc/english/sdk-to-sdk/mopub.md - -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[examples]: http://github.com/adjust/ios_sdk/tree/master/examples -[carthage]: https://github.com/Carthage/Carthage -[releases]: https://github.com/adjust/ios_sdk/releases -[cocoapods]: http://cocoapods.org -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html - -[example-tvos]: examples/AdjustExample-tvOS -[example-iwatch]: examples/AdjustExample-iWatch -[example-imessage]: examples/AdjustExample-iMessage -[example-ios-objc]: examples/AdjustExample-ObjC -[example-ios-swift]: examples/AdjustExample-Swift - -[AEPriceMatrix]: https://github.com/adjust/AEPriceMatrix -[event-tracking]: https://docs.adjust.com/en/event-tracking -[callbacks-guide]: https://docs.adjust.com/en/callbacks -[universal-links]: https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html - -[special-partners]: https://docs.adjust.com/en/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[ios-web-views-guide]: doc/english/web_views.md -[currency-conversion]: https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies -[universal-links-guide]: https://docs.adjust.com/en/universal-links/ -[adjust-universal-links]: https://docs.adjust.com/en/universal-links/#redirecting-to-universal-links-directly -[universal-links-testing]: https://docs.adjust.com/en/universal-links/#testing-universal-link-implementations -[reattribution-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[ios-purchase-verification]: https://github.com/adjust/ios_purchase_sdk - -[reattribution-with-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link - -[run]: https://raw.github.com/adjust/sdks/master/Resources/ios/run5.png -[add]: https://raw.github.com/adjust/sdks/master/Resources/ios/add5.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag5.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate5.png -[framework]: https://raw.github.com/adjust/sdks/master/Resources/ios/framework5.png - -[adc-ios-team-id]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-ios-team-id5.png -[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png -[adc-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-associated-domains5.png -[xcode-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/xcode-associated-domains5.png -[universal-links-dashboard]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard5.png - -[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png -[universal-links-dashboard-values]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard-values5.png - -## License - -The Adjust SDK is licensed under the MIT License. - -Copyright (c) 2012-Present Adjust GmbH, http://www.adjust.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/doc/chinese/README.md b/doc/chinese/README.md deleted file mode 100644 index 7ba933771..000000000 --- a/doc/chinese/README.md +++ /dev/null @@ -1,1366 +0,0 @@ -**该指南即将过期。** - -该自述文件即将过期。现在,您可以前往我们的帮助中心查看此 SDK 文档。 - -* [English][en-helpcenter] -* [中文][zh-helpcenter] -* [日本語][ja-helpcenter] -* [한국어][ko-helpcenter] - -## 摘要 - -这是 Adjust™ 的 iOS SDK 包。您可以在 [adjust.com] 了解更多有关 Adjust™ 的信息。 - -如果您的应用使用 web views,且您希望 Adjust 通过 Javascript 代码跟踪,请参阅我们的 [iOS web views SDK 指南][ios-web-views-guide]。 - -阅读本文的其他语言版本:[English][en-readme]、[中文][zh-readme]、[日本語][ja-readme]、[한국어][ko-readme]。 - -## 目录 - -* [应用示例](#example-apps) -* [基本集成](#basic-integration) - * [添加 SDK 至您的项目](#sdk-add) - * [添加 iOS 框架](#sdk-frameworks) - * [集成 SDK 至您的应用](#sdk-integrate) - * [基本设置](#qs-basic-setup) - * [iMessage 的特定设置](#basic-setup-imessage) - * [Adjust 日志](#adjust-logging) - * [构建您的应用](#build-the-app) -* [附加功能](#additional-feature) - * [AppTrackingTransparency 框架](#att-framework) - * [应用跟踪授权包装器](#ata-wrapper) - * [了解当前授权状态](#ata-getter) - * [SKAdNetwork 框架](#skadn-framework) - * [更新 SKAdNetwork 转化值](#skadn-update-conversion-value) - * [转化值更新回传](#skadn-cv-updated-callback) - * [事件跟踪](#event-tracking) - * [收入跟踪](#revenue-tracking) - * [收入数据去重](#revenue-deduplication) - * [应用内收入验证](#iap-verification) - * [回传参数](#callback-parameters) - * [合作伙伴参数](#partner-parameters) - * [回传标识符](#cp-event-callback-id) - * [会话参数](#session-parameters) - * [会话回传参数](#session-callback-parameters) - * [会话合作伙伴参数](#session-partner-parameters) - * [延迟启动](#delay-start) - * [归因回传](#attribution-callback) - * [广告收入跟踪](#ad-revenue) - * [订阅跟踪](#subscriptions) - * [事件与会话回传](#event-session-callbacks) - * [禁用跟踪](#disable-tracking) - * [离线模式](#offline-mode) - * [事件缓冲](#event-buffering) - * [GDPR 被遗忘权](#gdpr-forget-me) - * [第三方分享](#third-party-sharing) - * [禁用第三方分享](#disable-third-party-sharing) - * [启用第三方分享](#enable-third-party-sharing) - * [许可监测](#measurement-consent) - * [SDK 签名](#sdk-signature) - * [后台跟踪](#background-tracking) - * [设备 ID](#device-ids) - * [iOS 广告标识符](#di-idfa) - * [Adjust 设备 ID](#adid) - * [用户归因](#user-attribution) - * [推送标签 (Push token)](#push-token) - * [预安装跟踪码](#pre-installed-trackers) - * [深度链接](#deeplinking) - * [标准深度链接场景](#deeplinking-standard) - * [iOS 8 及以下版本的深度链接设置](#deeplinking-setup-old) - * [iOS 9 及以上版本的深度链接设置](#deeplinking-setup-new) - * [延迟深度链接场景](#deeplinking-deferred) - * [通过深度链接的再归因](#deeplinking-reattribution) - * [链接解析](#link-resolution) - * [[beta] 数据驻留](#data-residency) -* [问题排查](#troubleshooting) - * [SDK 延迟初始化问题](#ts-delayed-init) - * [显示 "Adjust requires ARC" 出错信息](#ts-arc) - * [显示 "\[UIDevice adjTrackingEnabled\]: unrecognized selector sent to instance" 出错信息](#ts-categories) - * [显示 "Session failed (Ignoring too frequent session.)"出错信息](#ts-session-failed) - * [日志未显示 "Install tracked"](#ts-install-tracked) - * [显示 "Unattributable SDK click ignored" 信息](#ts-iad-sdk-click) - * [Adjust 控制面板显示错误收入数据](#ts-wrong-revenue-amount) -* [许可协议](#license) - -## 应用示例 - -[`examples` 目录][examples]内有 [`iOS (Objective-C)`][example-ios-objc]、[`iOS (Swift)`][example-ios-swift]、[`tvOS`][example-tvos]、[`iMessage`][example-imessage] 和 [`Apple Watch`][example-iwatch] 的应用示例。您可以打开任何一个 Xcode 项目查看集成 Adjust SDK 的例子。 - -## 基本集成 - -我们将介绍把 Adjust SDK 集成到 iOS 项目中的步骤。我们假定您使用 Xcode 进行 iOS 开发。 - -### 添加 SDK 至您的项目 - -如果您正在使用 [CocoaPods][cocoapods],可以将以下代码行添加至 `Podfile`,然后继续进行[此步骤](#sdk-integrate): - -```ruby -pod 'Adjust', '~> 4.31.0' -``` - -或: - -```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.31.0' -``` - ---- - -如果您正在使用 [Carthage][carthage],可以将以下代码行添加至 `Cartfile`,然后继续进行[此步骤](#sdk-frameworks): - -```ruby -github "adjust/ios_sdk" -``` - ---- - -如果您正在使用 Swift Pacage Manager,可以转到 `File > Swift Packages > Add Package Dependency`,直接在 Xcode 中添加库的地址,然后继续进行[此步骤](#sdk-frameworks): - -``` -https://github.com/adjust/ios_sdk -``` - ---- - -您也可以把 Adjust SDK 作为框架添加至您的项目中,来进行集成。在[发布专页][releases],您可以找到以下文档: - -* `AdjustSdkStatic.framework.zip` -* `AdjustSdkDynamic.framework.zip` -* `AdjustSdkTv.framework.zip` -* `AdjustSdkIm.framework.zip` - -自 iOS 8 发布以来,Apple 引入了动态框架 (dynamic frameworks),也称为嵌入式框架 (embedded frameworks)。如果您的应用目标对象是 iOS 8 或以上版本,则可以使用 Adjust SDK 动态框架。请选择您希望使用的框架 – 静态或动态 – 并将其添加到项目中。 - -如果您正在使用 `tvOS` 应用,可以使用 Adjust SDK,也可使用我们的 tvOS 框架,该框架可从 `AdjustSdkTv.framework.zip` 文档中提取。 - -如果您正在使用 `iMessage` 应用,可以使用 Adjust SDK,也可使用我们的 IM 框架,该框架可从 `AdjustSdkIm.framework.zip` 文档中提取。 - -### 添加 iOS 框架 - -如果您关联额外的 iOS 框架到应用中,Adjust SDK 将能获取更多的信息。请根据应用启用 Adjust SDK 功能的情况,添加下列框架,并将其标记为 "可选" (optional): - -- `AdSupport.framework` - 请务必添加该框架,让 SDK 能访问 IDFA 值和 (iOS 14 以前的) LAT 信息。 -- `iAd.framework` - 如果您希望 SDK 自动处理您的 ASA 推广活动归因数据,请添加该框架。 -- `AdServices.framework`- 对于 iOS 14.3 及以上的设备,该框架允许 SDK 自动处理 ASA 推广活动归因数据。使用 Apple Ads 归因 API 时必须采用该框架。 -- `CoreTelephony.framework`- 如果您希望 SDK 能辨识当前的无线接入技术 (radio access),请添加该框架。 -- `StoreKit.framework`- 如果您希望访问 `SKAdNetwork` 框架,同时让 Adjust SDK 在 iOS 14 或未来版本的 iOS 中自动处理与`SKAdNetwork` 的通讯,请添加该框架。 -- `AppTrackingTransparency.framework` - 如果您希望 SDK 能在 iOS 14 或未来版本的 iOS 中包装用户的跟踪许可对话框,并访问用户跟踪许可的值,请添加该框架。 - -### 集成 SDK 至您的应用 - -如果您从 Pod 库添加 Adjust SDK,请从以下导入语句中选一使用: - -```objc -#import "Adjust.h" -``` - -或 - -```objc -#import -``` - ---- - -如果您是以静态/动态框架 (static/dynamic framework) 或者经 Carthage 添加 Adjust SDK,请使用以下导入语句: - -```objc -#import -``` - ---- - -如果您在 tvOS 应用中使用 Adjust SDK,请使用以下导入语句: - -```objc -#import -``` - ---- - -如果您在 iMessage 应用中使用 Adjust SDK,请使用以下导入语句: - -```objc -#import -``` - -接下来,我们将设置基本会话跟踪。 - -### 基本设置 - -在项目导航 (Project Navigator) 中,打开您的应用委托 (application delegate) 源文件。在文件顶部添加 `import` (import) 语句,然后在应用委托的 `didFinishLaunching` 或 `didFinishLaunchingWithOptions` 方法中,将以下调用添加至 `Adjust`: - -```objc -#import "Adjust.h" -// or #import -// or #import -// or #import -// or #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -![][delegate] - -**请注意**:Adjust SDK 初始化设置 `非常重要`。否则,您有可能会遇到[问题排查](#ts-delayed-init)中描述的多种问题。 - -用您的应用识别码 (app token) 替换 `{YourAppToken}`。您可以在[控制面板]上找到该应用识别码。 - -取决于您的应用创建是用于测试或产品开发目的,您必须将 `environment` (环境模式) 设为以下值之一: - -```objc -NSString *environment = ADJEnvironmentSandbox; -NSString *environment = ADJEnvironmentProduction; -``` - -**重要提示:** 只有在您或其他人测试应用时,才应将该值设为 `ADJEnvironmentSandbox`。在发布应用之前,请确保将环境设为 `ADJEnvironmentProduction`。再次开始研发和测试时,将其设回 `ADJEnvironmentSandbox`。 - -我们按照设置的环境来区分真实流量和来自测试设备的测试流量。非常重要的是,您必须始终让该值保持有意义!这一点在进行收入跟踪时尤为重要。 - -### iMessage 的特定设置 - -**从源代码添加 SDK**:如果您选择**从源代码**添加 Adjust SDK 到 iMessage 应用,请确保您已在 iMessage 项目中设置了预处理宏 **ADJUST_IM=1**。 - -**将 SDK 作为框架添加**:在将 `AdjustSdkIm.framework` 添加到 iMessage 应用后,请确保在 `Build Phases` 项目设置中添加 `New Copy Files Phase` 并选择将 `AdjustSdkIm.framework`复制到 `Frameworks` 文件夹。 - -**会话跟踪**:如果您希望在 iMessage 应用中正常使用会话跟踪功能,则需要执行一个额外的集成步骤。在标准 iOS 应用中,Adjust SDK 会自动订阅 iOS 系统通知,让我们能够知晓应用进入或离开前台的时间。在 iMessage 应用的情况则有所不同,您需要在 iMessage 应用视图控制器中添加对 `trackSubsessionStart` 和 `trackSubsessionEnd` 方法的显示调用,以在应用进入前台时通知我们的 SDK。 - -在 `didBecomeActiveWithConversation:` 方法中添加对 `trackSubsessionStart` 的调用: - -```objc --(void)didBecomeActiveWithConversation:(MSConversation *)conversation { - // Called when the extension is about to move from the inactive to active state. - // This will happen when the extension is about to present UI. - // Use this method to configure the extension and restore previously stored state. - - [Adjust trackSubsessionStart]; -} -``` - -在 `willResignActiveWithConversation:` 方法中添加对 `trackSubsessionEnd` 的调用: - -```objc --(void)willResignActiveWithConversation:(MSConversation *)conversation { - // Called when the extension is about to move from the active to inactive state. - // This will happen when the user dissmises the extension, changes to a different - // conversation or quits Messages. - - // Use this method to release shared resources, save user data, invalidate timers, - // and store enough state information to restore your extension to its current state - // in case it is terminated later. - - [Adjust trackSubsessionEnd]; -} -``` - -设置完成后,Adjust SDK 就能够在您的 iMessage 应用中成功执行会话跟踪。 - -**请注意**:您的 iOS 应用和为其创建的 iMessage 扩展程序是在不同的内存空间中运行的,它们也拥有不同的 Bundle ID。如果使用相同的应用识别码来初始化 Adjust SDK ,将导致独立的两者在没有注意到彼此的状况下进行跟踪,进而使控制面板上的数据显得混杂,为您带来不便。我们通常建议您在 Adjust 控制面板中为 iMessage 应用创建单独的应用,并使用单独的应用识别码来初始化 SDK。 - -### Adjust 日志 - -您可以增加或减少在测试中看到的日志数量,方法是用以下参数之一来调用 `ADJconfig` 实例上的 `setLogLevel`: - -```objc -[adjustConfig setLogLevel:ADJLogLevelVerbose]; // enable all logging -[adjustConfig setLogLevel:ADJLogLevelDebug]; // enable more logging -[adjustConfig setLogLevel:ADJLogLevelInfo]; // the default -[adjustConfig setLogLevel:ADJLogLevelWarn]; // disable info logging -[adjustConfig setLogLevel:ADJLogLevelError]; // disable warnings as well -[adjustConfig setLogLevel:ADJLogLevelAssert]; // disable errors as well -[adjustConfig setLogLevel:ADJLogLevelSuppress]; // disable all logging -``` - -如果您不希望开发中的应用显示来自 Adjust SDK 的任何日志,请选择 `ADJLogLevelSuppress`,并通过另一个构建函数初始化 `ADJConfig` 对象,启用抑制日志级别模式: - -```objc -#import "Adjust.h" -// or #import -// or #import -// or #import -// or #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment - allowSuppressLogLevel:YES]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -### 构建您的应用 - -创建并运行自己的应用。如果构建成功,您应当仔细阅读控制台的 SDK 日志。应用首次启动之后,您应当看到信息日志 `Install tracked`(安装已跟踪)。 - -![][run] - -## 附加功能 - -将 Adjust SDK 集成到项目中后,您即可利用以下功能。 - -### AppTrackingTransparency 框架 - -每发送一个包,Adjust 的后端就会收到下列四 (4) 种许可状态之一,了解用户是否授权分享应用相关数据,用于用户或设备跟踪: - -- Authorized (授权) -- Denied (拒绝) -- Not Determined (待定) -- Restricted (受限) - -如果设备收到了用于用户设备跟踪目的应用相关数据访问授权请求,那么返回的状态要么是 Authorized,要么是 Denied。 - -如果设备尚未收到用于用户设备跟踪目的应用相关数据访问授权请求,那么返回的状态是 Not Determined。 - -如果应用跟踪数据授权受限,那么返回的状态是 Restricted。 - -如果您不需要自定义显示的弹出对话框,SDK 拥有内置机制可在用户回复弹出对话框后接收更新后的状态。为了简便、高效地向后端发送用户许可的新状态,Adjust SDK 会提供一个应用跟踪授权方法包装器,详情请参阅下一章节 "应用跟踪授权包装器"。 - -### 应用跟踪授权包装器 - -您可以使用 Adjust SDK 请求用户授权,让用户允许您访问他们的应用相关数据。基于 [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) 方法,Adjust SDK 打造了一个包装器,您可以定义回传方法,了解用户是否授予了数据跟踪许可。借助该包装器,只要用户回复弹出对话框,这一信息就能通过您定义的回传方式传递回来。SDK 也会通知后端用户的许可选择。`NSUInteger` 值将通过您的回传方法传递,不同值的含义如下: - -- 0: `ATTrackingManagerAuthorizationStatusNotDetermined` (授权状态待定) -- 1: `ATTrackingManagerAuthorizationStatusRestricted` (授权状态受限) -- 2: `ATTrackingManagerAuthorizationStatusDenied`(已拒绝) -- 3: `ATTrackingManagerAuthorizationStatusAuthorized`(已授权) - -要使用该包装器,您可以按照下列方法进行调用: - -```objc -[Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) { - switch (status) { - case 0: - // ATTrackingManagerAuthorizationStatusNotDetermined case - break; - case 1: - // ATTrackingManagerAuthorizationStatusRestricted case - break; - case 2: - // ATTrackingManagerAuthorizationStatusDenied case - break; - case 3: - // ATTrackingManagerAuthorizationStatusAuthorized case - break; - } -}]; -``` - -### 获得当前授权状态 - -要接收当前应用跟踪授权状态,请调用 `[Adjust appTrackingAuthorizationStatus]`,会返回下列可能的值之一: - -* `0`:用户尚未收到请求 -* `1`:用户设备受限 -* `2`:用户拒绝提供 IDFA -* `3`:用户授权访问 IDFA -* `-1`:状态不可用 - - -### SKAdNetwork 框架 - -如果您已经安装了 Adjust iOS SDK v4.23.0 或更新版本,且您的应用在 iOS 14 端运行,那么与 SKAdNetwork 之间的通讯会默认启用,但您可以自行禁用通讯。启用状态下,Adjust 会在 SDK 初始化时自动注册 SKAdNetwork 归因。如果您在 Adjust 控制面板中对事件进行了接收转化值设置,那么 Adjust 后端就会将转化值数据发送给 SDK。然后 SDK 会设定转化值。Adjust 收到 SKAdNetwork 回传数据后,会在控制面板中予以显示。 - -如果您不希望 Adjust SDK 自动与 SKAdNetwork 通讯,可以针对配置对象调用如下方法: - -```objc -[adjustConfig deactivateSKAdNetworkHandling]; -``` - -### 更新 SKAdNetwork 转化值 - -从 iOS SDK v4.26.0 开始,您就可以使用 Adjust SDK 包装器方法 `updateConversionValude:` 为用户更新 SKAdNetwork 转化值: - -```objc -[Adjust updateConversionValue:6]; -``` - -### 转化值更新回传 - -您可以注册回传,在每次 Adjust SDK 更新用户转化值时获得通知。请安装 `AdjustDelegate` 协议,以及可选的 `adjustConversionValueUpdated:` 方法: - -```objc -- (void)adjustConversionValueUpdated:(NSNumber *)conversionValue { - NSLog(@"Conversion value updated callback called!"); - NSLog(@"Conversion value: %@", conversionValue); -} -``` - -### 事件跟踪 - -您可以通过 Adjust 来跟踪事件。假设您想要跟踪具体按钮的每一次点击。要达到这个目的,您要在[控制面板]上创建新的事件识别码,[控制面板]有相关的事件识别码,例如 `abc123` 等。在按钮 `bottonDown` 方法中,添加以下代码行以跟踪点击: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[Adjust trackEvent:event]; -``` - -您在点击按钮时,应当可以在日志中看到 `Event tracked`(事件已跟踪)。 - -事件实例可以用于在跟踪之前对事件作进一步配置: - -### 收入跟踪 - -如果您的用户可以通过点击广告或应用内购为您带来收入,您可以按照事件来跟踪这些收入。假设一次点击值一欧分。那么您可以这样来跟踪收入事件: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setRevenue:0.01currency:@"EUR"]; - -[Adjust trackEvent:event]; -``` - -当然,这可以和回传参数相结合。 - -设置货币识别码后,Adjust 会自动将收入转化为您所选的报告收入。[在此了解更多货币换算相关信息][currency-conversion]。 - -要更多地了解收入和事件跟踪相关信息,欢迎参阅[事件跟踪指南](https://help.adjust.com/zh/article/app-events#tracking-purchases-and-revenues)。 - -### 收入数据去重 - -您也可以输入可选的交易 ID,以避免跟踪重复收入。最近的十个交易 ID 将被记录下来,带有重复交易 ID 的收入事件将被跳过。这对于应用内购跟踪尤其有用。参见以下例子。 - -如果您想要跟踪应用内购,请确保只有状态变为 `SKPaymentTransactionStatePurchased` 时,才在 finishTransaction` 之后在 `paymentQueue:updatedTransaction` 中调用 `trackEvent`。这样您可以避免跟踪实际未产生的收入。 - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState){ - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - ADJEvent *event = [ADJEvent eventWithEventToken:...]; - [event setRevenue:... currency:...]; - [event setTransactionId:transaction.transactionIdentifier];// avoid duplicates - [Adjust trackEvent:event]; - - break; - // more cases - } - } -} -``` - -### 应用内收入验证 - -如果您希望使用收入验证(即 Adjust 服务器端收据验证工具)来检查应用内购的真实性,请查看我们的 iOS 购买 SDK 并[在此][ios-purchase-verification]阅读详细内容。 - -### 回传参数 - -您可以在 [控制面板] 中为事件输入回传 URL。这样,只要跟踪到事件,我们都会向该 URL 发送 GET 请求。您可以在跟踪前调用事件的 `addCallbackParameter` ,向该事件添加回传参数。之后我们会将这些参数附加至您的回传 URL。 - -例如,假设您输入了 URL `http://www.mydomain.com/callback` 则使用以下方式跟踪事件: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -在这种情况下,我们会跟踪该事件并发送请求至: - - http://www.mydomain.com/callback?key=value&foo=bar - -值得一提的是,我们支持各种可以用作参数值的占位符,例如 `{idfa}`。在接下来的回传中,该占位符将被当前设备的广告 ID 代替。同时请注意,我们不会存储您的任何自定义参数。我们仅将这些参数附加到您的回传中。所以如果没有设置回传,这些参数不会被保存,也不会发送给您。 - -若想进一步了解 URL 回传,查看可用参数的完整列表,请参阅我们的 [回传指南][callbacks-guide]。 - -### 合作伙伴参数 - -在 Adjust 控制面板中启用了相关功能后,您还可以添加与合作伙伴共享的参数。 - -工作方式和上述提及的回传参数类似,但可以通过调用 `ADJEvent` 实例上的 `addPartnerParameter` 方法来添加。 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addPartnerParameter:@"key" value:@"value"]; -[event addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -您可以在我们的 [特殊合作伙伴指南][special-partners] 中进一步了解特殊合作伙伴以及这些集成的信息。 - -### 回传标识符 - -您还可为想要跟踪的每个事件添加自定义字符串 ID。此 ID 将在之后的事件成功和/或事件失败回传中被报告,以便您及时了解哪些事件跟踪成功或者失败。您可通过调用 `ADJEvent` 实例上的 `setCallbackId` 方法来设置此标识符: - - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setCallbackId:@"Your-Custom-Id"]; - -[Adjust trackEvent:event]; -``` - -### 会话参数 - -一些参数被保存发送到 Adjust SDK 的每一个事件和会话中。一旦添加此类参数,则无需再每次重复添加,因为这些参数将被保存至本地。如果您添加同样参数两次,也不会有任何效果。 - -如果您希望和初始安装事件一同发送会话参数,这些参数必须在 Adjust SDK 通过 `[Adjust appDidLaunch:]`启动之前被调用。如果您需要在安装同时发送参数,但只有在 SDK 启动后才能获得必需的值,则可以[延迟](#delay-start) Adjust SDK 的首次启动以允许该行为。 - -### 会话回传参数 - -被注册在[事件](#callback-parameters) 中的相同回传参数也可以被保存发送至 Adjust SDK 的每一个事件和会话中。 - -会话回传参数拥有与事件回传参数类似的接口。该参数是通过调用 `Adjust` 方法 `addSessionCallbackParameter:value:`(添加会话回调参数值) 被添加,而不是添加 Key 和值至事件: - -```objc -[Adjust addSessionCallbackParameter:@"foo" value:@"bar"]; -``` - -会话回传参数将与被添加至事件的回传参数合并。被添加至事件的回传参数拥有高于会话回传参数的优先级。这意味着,当被添加至事件的回传参数拥有与会话回传参数同样的 Key 时,以被添加至事件的回传参数值为准。 - -您可以通过传递 Key 至 `removeSessionCallbackParameter` 方法来删除特定会话回传参数。 - -```objc -[Adjust removeSessionCallbackParameter:@"foo"]; -``` - -如果您希望删除会话回传参数中所有的 Key 及值,可以通过 `resetSessionCallbackParameters` 方法重置。 - -```objc -[Adjust resetSessionCallbackParameters]; -``` - -### 会话合作伙伴参数 - -与 [会话回传参数](#session-callback-parameters) 的方式一样,会话合作伙伴参数也会与 SDK 的每个事件或会话一同发送。 - -它们将被传送至渠道合作伙伴,用于 Adjust [控制面板]上已经激活的模块集成。 - -会话合作伙伴参数拥有与事件合作伙伴参数类似的接口。该参数是通过调用 `Adjust` 方法 `addSessionPartnerParameter:value:`(添加会话合作伙伴参数值) 被添加,而不是添加 Key 和值至事件: - -```objc -[Adjust addSessionPartnerParameter:@"foo" value:@"bar"]; -``` - -会话合作伙伴参数将与被添加至事件的合作伙伴参数合并。被添加至事件的合作伙伴参数具有高于会话合作伙伴参数的优先级。这意味着,当被添加至事件的合作伙伴参数拥有与会话合作伙伴参数同样的 Key 时,以被添加至事件的合作伙伴参数值为准。 - -您可以通过传递 Key 至 `Adjust.removeSessionPartnerParameter` 方法,删除特定的会话合作伙伴参数。 - -```objc -[Adjust removeSessionPartnerParameter:@"foo"]; -``` - -如果您希望删除会话合作伙伴参数中所有的 Key 及值,则可以通过 `resetSessionPartnerParameters` 方法重置。 - -```objc -[Adjust resetSessionPartnerParameters]; -``` - -### 延迟启动 - -延迟 Adjust SDK 的启动可以为您的应用提供更充裕的时间,来接收所有想要随安装发送的会话参数 (例如:唯一标识符)。 - -利用 `ADJConfig` 实例中的 `setDelayStart` 方法,以秒为单位设置初始延迟时间: - -```objc -[adjustConfig setDelayStart:5.5]; -``` - -在此种情况下,Adjust SDK 不会在 5.5 秒内发送初始安装会话以及所创建的任何事件。在该时间过期后或同时调用 `[Adjust sendFirstPackages]`时,每个会话参数将被添加至延迟的安装会话和事件中,Adjust SDK 将恢复正常。 - -**您最多可以将 Adjust SDK 的启动时间延长 10 秒**。 - -### 归因回传 - -您可以注册一个委托回传,以获取跟踪链接归因变化的通知。由于考虑到归因的不同来源,归因信息无法被同步提供。遵循以下步骤在您的应用委托中启用可选的委托协议: - -请务必考虑我们的[适用归因数据政策][attribution-data]。 - -1. 打开 `AppDelegate.h`,添加导入和 `AdjustDelegate` 声明。 - - ```objc - @interface AppDelegate : UIResponder - ``` - -2. 打开 `AppDelegate.m`,添加以下委托回传功能至您的应用委托执行 (app delegate implementation)。 - - ```objc - - (void)adjustAttributionChanged:(ADJAttribution *)attribution { - } - ``` - -3. 用您的 `ADJConfig` 实例设置委托: - - ```objc - [adjustConfig setDelegate:self]; - ``` - -由于委托回调使用 `ADJConfig` 实例进行配置,您应当在调用 `[Adjust appDidLaunch:adjustConfig]` 之前调用 `setDelegate`。 - -当 SDK 接收到最终归因数据后,将会调用委托功能。在委托功能内,您可以访问 `attribution` (归因)参数。以下是归因属性的摘要: - -- `NSString trackerToken` 当前归因的跟踪码 -- `NSString trackerName` 当前归因的跟踪链接名称 -- `NSString network` 当前归因的渠道分组级别 -- `NSString campaign` 当前归因的推广活动分组级别 -- `NSString adgroup` 当前归因的广告组分组级别 -- `NSString creative` 当前归因的素材分组级别 -- `NSString clickLabel` 当前归因的点击标签 -- `NSString adid` 归因提供的唯一设备 ID -- `NSString costType` 成本类型字符串。 -- `NSNumber costAmount` 成本金额。 -- `NSString costCurrency` 成本币种字符串。 - -当值不可用时,将默认为 `nil`。 - -请注意:只有在 `ADJConfig` 中通过调用 `setNeedsCost` 方法来进行配置后,`costType`、 `costAmount` 和 `costCurrency` 成本数据才可用。如果未进行配置,或已配置但这些字段不属于归因的一部分,那么字段值就会为 `nil`。此功能仅适用于 SDK 4.24.0 及以上版本。 - -### 广告收入跟踪 - -**注意**:该广告收入跟踪 API 仅适用于原生 SDK v.29.0 及更高版本。 - -您可以通过调用以下方法,使用 Adjust SDK 对广告收入进行跟踪: - -```objc -// initilise ADJAdRevenue instance with appropriate ad revenue source -ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source]; -// pass revenue and currency values -[adRevenue setRevenue:1.6currency:@"USD"]; -// pass optional parameters -[adRevenue setAdImpressionsCount:adImpressionsCount]; -[adRevenue setAdRevenueUnit:adRevenueUnit]; -[adRevenue setAdRevenuePlacement:adRevenuePlacement]; -[adRevenue setAdRevenueNetwork:adRevenueNetwork]; -// attach callback and/or partner parameter if needed -[adRevenue addCallbackParameter:key value:value]; -[adRevenue addPartnerParameter:key value:value]; - -// track ad revenue -[Adjust trackAdRevenue:source payload:payload]; -``` - -目前,我们支持以下 `source` 参数值: - -- `ADJAdRevenueSourceAppLovinMAX` - representing AppLovin MAX platform. -- `ADJAdRevenueSourceMopub` - representing MoPub platform. -- `ADJAdRevenueSourceAdMob` - representing AdMob platform. -- `ADJAdRevenueSourceIronSource` - representing IronSource platform. - -**请注意**:会有独立于本 REDME 之外的文档,解释每个受支持来源的详细集成信息。此外,要使用该功能,您需要在 Adjust 控制面板中进行额外的应用设置。因此,请务必联系我们的支持团队,在启用功能前确保一切设置妥当。 - -### 订阅跟踪 - -**请注意**:此功能仅适用于原生 SDK 4.22.0 及以上版本。我们推荐您使用最低 4.22.1 版本。 - -**重要提示**:下列步骤仅会在 SDK 中设置订阅跟踪。要完成设置,您必须在 Adjust 内部界面中提供具体应用的特定信息。该操作必须由 Adjust 代表完成。请联系 support@adjust.com 或您的技术客户经理。 - -您可以用 Adjust SDK 跟踪 App Store 的订阅,并验证这些订阅是否有效。订阅购买成功后,请向 Adjust SDK 进行如下调用: - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -[Adjust trackSubscription:subscription]; -``` - -请确保只有状态变为 `SKPaymentTransactionStatePurchased` 或 `SKPaymentTransactionStateRestored` 时才进行该操作。然后在 `paymentQueue:updatedTransactions` 中调用 `finishTransaction`。 - -订阅跟踪参数: - -- [price](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc) -- currency (您需要发送 [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) 对象的 [currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc) ) -- [transactionId](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc) -- [receipt](https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl) -- [transactionDate](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate?language=objc) -- salesRegion (您需要发送 [priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) 对象的 [countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc) ) - -与事件跟踪一样,您也可以向订阅对象附加回传和合作伙伴参数: - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -// add callback parameters -[subscription addCallbackParameter:@"key" value:@"value"]; -[subscription addCallbackParameter:@"foo" value:@"bar"]; - -// add partner parameters -[subscription addPartnerParameter:@"key" value:@"value"]; -[subscription addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackSubscription:subscription]; -``` - -### 事件和会话回传 - -您可以设置委托回调,用于在事件和/或会话跟踪成功和失败时获取通知。使用的是和[归因回传][#attribution-callback]一样的 `AdjustDelegate` 可选协议。 - -按照同样的步骤,执行以下委托回传函数,于成功跟踪事件时调用: - -```objc -- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData { -} -``` - -以下为事件跟踪失败的委托回传函数: - -```objc -- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData { -} -``` - -跟踪成功的会话: - -```objc -- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData { -} -``` - -跟踪失败的会话: - -```objc -- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData { -} -``` - -委托函数将于 SDK 尝试发送包 (package) 到服务器后调用。在委托回传内,您能访问专为委托回传所设的响应数据对象。会话响应数据属性摘要如下: - -- `NSString message` 服务器信息或者 SDK 记录的错误信息 -- `NSString timeStamp` 服务器的时间戳 -- `NSString adid` Adjust 提供的唯一设备标识符 -- `NSDictionary jsonResponse` JSON 对象及服务器响应 - -两个事件响应数据对象都包含: - -- 如果跟踪的包是一个事件,`NSString eventToken` 代表事件识别码。 -- `NSString callbackId`为事件对象设置的自定义回传 ID。 - -当值不可用时,将默认为 `nil`。 - -事件和会话跟踪失败的对象也均包含: - -- `BOOL willRetry` 表示稍后将再次尝试发送数据包。 - -### 禁用跟踪 - -您可以调用参数为 `NO`的 `setEnabled`,停用 Adjust SDK 跟踪目前设备所有活动的功能。**该设置在会话间保存**。 - -```objc -[Adjust setEnabled:NO]; -``` - -您可以通过调用 `isEnabled` 函数来查看 Adjust SDK 目前是否启用。您始终可以通过调用启用参数设置为 `YES` 的 `setEnabled` 来激活 Adjust SDK。 - -### 离线模式 - -您可以把 Adjust SDK 设置为离线模式,以暂停发送数据到我们的服务器,但仍然继续跟踪及保存数据并于之后发送。当设为离线模式时,所有数据将存放于一个文件中,所以请注意不要在离线模式时触发太多事件。 - -您可以调用参数为 `YES` 的 `setOfflineMode`,以激活离线模式。 - -```objc -[Adjust setOfflineMode:YES]; -``` - -相反地,您可以调用 `setOfflineMode`,启用参数为 `NO`,以终止离线模式。当Adjust SDK 回到在线模式时,所有被保存的数据将被发送到我们的服务器,并保留正确的时间信息。 - -跟禁用跟踪设置不同的是,此设置在会话与会话之间将**不被保存**。也就是说,即使应用在处于离线模式时停用,SDK 每次启动时都必定处于在线模式。 - -### 事件缓冲 - -如果您的应用大量使用事件跟踪,您可能会想要延迟部分 HTTP 请求,以便按分钟成批发送这些请求。您可以通过 `ADJConfig` 实例启用事件缓冲: - -```objc -[adjustConfig setEventBufferingEnabled:YES]; -``` - -如果不做任何设置,事件缓冲为 **默认禁用**。 - -### GDPR 被遗忘权 - -根据欧盟的《一般数据保护条例》(GDPR) 第 17 条规定,用户行使被遗忘权时,您可以通知 Adjust。调用以下方法时,Adjust SDK 将会收到指示向 Adjust 后端传达用户选择被遗忘的信息: - -```objc -[Adjust gdprForgetMe]; -``` - -收到此信息后,Adjust 将清除用户数据,并且 Adjust SDK 将停止跟踪该用户。以后不会再向 Adjust 发送来自此设备的请求。 - -## 具体用户的第三方数据分享 - -当有用户禁用、启用或重启第三方合作伙伴数据分享时,您可以通知 Adjust。 - -### 为具体用户禁用第三方数据分享 - -请调用以下方法,指示 Adjust SDK 将用户禁用数据分享的选择传递给 Adjust 后端: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@NO]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -收到此信息后,Adjust 会停止向合作伙伴分享该用户的数据,而 Adjust SDK 将会继续如常运行。 - -### 为具体用户启用或重启第三方数据分享 - -请调用以下方法,指示 Adjust SDK 将用户启用或变更数据分享的选择传递给 Adjust 后端: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@YES]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -收到此信息后,Adjust 会就是否与合作伙伴分享该用户的数据做出相应变更,而 Adjust SDK 将会继续如常运行。 - -请调用以下方法,指示 Adjust SDK 向 Adjust 后端发送精细选项: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:nil]; -[adjustThirdPartySharing addGranularOption:@"PartnerA" key:@"foo" value:@"bar"]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -### 监测具体用户的许可 - -要在 Adjust 控制面板中启用或禁用数据隐私设置,包括许可有效期和用户数据留存期,您需要安装以下方法。 - -请调用以下方法,指示 Adjust SDK 将数据隐私设置传递给 Adjust 后端: - -```objc -[Adjust trackMeasurementConsent:YES]; -``` - -收到此信息后,Adjust 会就是否与合作伙伴分享该用户的数据做出相应变更,而 Adjust SDK 将会继续如常运行。 - -### SDK 签名 - -Adjust SDK 签名功能是按客户逐一启用的。如果您希望使用该功能,请联系您的客户经理。 - -如果您已经在账户中启用了 SDK 签名,并可访问 Adjust 控制面板的应用密钥,请使用以下方法来集成 SDK 签名到您的应用。 - -在您的 `AdjustConfig` 实例中调用 `setAppSecret` 来设置应用密钥。 - -```objc -[adjustConfig setAppSecret:secretId info1:info1 info2:info2 info3:info3 info4:info4]; -``` - -### 后台跟踪 - -Adjust SDK 的默认行为是当应用处于后台时暂停发送 HTTP 请求。您可以在 `AdjustConfig` 实例中更改此设置: - -```objc -[adjustConfig setSendInBackground:YES]; -``` - -如果不做任何设置,后台发送为**默认禁用**。 - -### 设备 ID - -Adjust SDK 支持您获取一些设备 ID。 - -### iOS 广告 ID - -某些服务 (如 Google Analytics) 要求您协调设备及客户 ID 以避免重复报告。 - -请调用 `idfa` 以获取设备ID IDFA: - -```objc -NSString *idfa = [Adjust idfa]; -``` - -### Adjust 设备 ID - -Adjust 后台将为每一台安装了您应用的设备生成一个唯一的 **Adjust 设备 ID** (**adid**)。您可以在 `Adjust` 示例上调用下列方法,获得该 ID: - -```objc -NSString *adid = [Adjust adid]; -``` - -**请注意:**只有在 Adjust 后台跟踪到应用安装后,您才能获取 **adid** 的相关信息。跟踪到应用安装后,Adjust SDK 将拥有设备 **adid** 的信息,您可以使用此方法来访问此信息。因此,在 SDK 初始化以及您的应用安装被成功跟踪之前,您将**无法**访问 **adid**。 - -### 用户归因 - -归因回传通过[归因回传章节](#attribution-callback)所描述的方法被触发,以向您提供关于用户归因值的任何更改信息。如果您想要在任何其他时间访问用户当前归因值的信息,您可以通过对 `Adjust` 实例调用如下方法来实现: - -```objc -ADJAttribution *attribution = [Adjust attribution]; -``` - -**请注意**:只有在 Adjust 后台跟踪到应用安装和归因回传被初始触发后,您才能获取关于当前归因的信息。自此之后,Adjust SDK 已经拥有关于用户归因的信息,您可以使用此方法来访问它。因此,在 SDK 被初始化以及归因回传被初始触发之前,您将**无法**访问用户归因值。 - -### 推送标签 (push token) - -推送标签用于受众分群工具和客户回传,是跟踪卸载和重装所需的信息。 - -请添加以下调用到应用委托 `didRegisterForRemoteNotificationsWithDeviceToken` 中的 `Adjust`,发送推送标签给我们: - -```objc -- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [Adjust setDeviceToken:deviceToken]; -} -``` - -### 预安装跟踪码 - -如果您希望使用 Adjust SDK 来识别已在其设备中预安装您的应用的用户,请执行以下步骤。 - -1. 在 [控制面板] 中创建新的跟踪码。 -2. 打开您的应用委托,并在 `ADJConfig`: 中设置默认跟踪码: - - ```objc - ADJConfig*adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; - [adjustConfig setDefaultTracker:@"{TrackerToken}"]; - [Adjust appDidLaunch:adjustConfig]; - ``` - - 用您在步骤 2 中创建的跟踪码替换 `{TrackerToken}`。请注意,控制面板中显示的是跟踪 - 链接 (包含 `http://app.adjust.com/`)。在您的源代码中,您应该仅指定六个字符的识别码,而不是 - 整个 URL。 - -3. 创建并运行应用。您应该可以看到如下的一行 Xcode: - - ``` - 默认跟踪码:'abc123' - ``` - -### 深度链接 - -如果您正在使用可从 URL 深度链接至您的应用的 Adjust 跟踪链接,您将可以获取深度链接 URL 及其内容的相关信息。点击 URL 的情况发生在用户已经安装了您的应用 (标准深度链接场景),或用户尚未在其设备上安装您的应用 (延迟深层链接场景)。Adjust SDK 支持此两种场景,在两种场景下,一旦用户点击跟踪链接启动您的应用之后,深度链接 URL 都将被提供给您。您必须正确设置,以便在应用中使用此功能。 - -### 标准深度链接场景 - -如果用户已经安装了您的应用,并点击了带有深度链接信息的跟踪链接,您的应用将被打开,深度链接的内容将被发送至应用,这样您就可以解析它们并决定下一步动作。自 iOS 9 推出后,Apple 已经改变了在应用程序中处理深度链接的方式。取决于您希望在应用中使用哪种场景 (或者您希望同时使用两种场景以支持更广泛的设备),您需要设置应用以处理以下一种或两种场景。 - -### iOS 8 及以下版本的深度链接设置 - -iOS 8 及以下版本设备上的深度链接是通过使用自定义 URL 方案设置的。您需要选择一个由您的应用负责开启的自定义 URL 方案名。该方案名也将作为 deep_link (深度链接) 参数的一部分被用于 Adjust 跟踪链接。打开您的 `Info.plist` 文件,添加新的 `URL types` 行,以在您的应用中设置 URL 方案名。在 `URL identifier` 输入您的应用 `bundle ID`,于 `URL schemes` 下添加您希望在应用中处理的方案名称。在以下例子中,我们已经选择应用程序处理以 `adjustExample` 命名的方案。 - -![][custom-url-scheme] - -该设置完成之后,一旦点击包含自定义方案名的 `deep_link` 参数的 Adjust 跟踪链接, 您的应用将被打开。应用打开后,您的 `AppDelegate` 中的 `openURL` 方法将被触发,来自跟踪链接的 `deep_link` 参数内容来源将被发送。如果您希望访问该深度链接内容,请改写此方法。 - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url object contains your deep link content - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -通过以上设置,您已经成功为 iOS 8 及以下版本的 iOS 设备设置深度链接。 - -### iOS 9 及以上版本的深度链接设置 - -为 iOS 9 及以上版本设备设置深度链接,您需要启用您的应用处理 Apple 通用链接的功能。查看[这里][universal-links],了解更多关于通用链接及其设置的相关信息。 - -Adjust 在后台负责处理与通用链接相关的大部分工作。但是,为了让 Adjust 支持通用链接,您需要在 Adjust 控制面板中为通用链接做一些小的设置。请查看我们的[官方文档][universal-links-guide]以了解设置信息。 - -一旦在控制面板中成功启用通用链接功能,您还需要在应用中作如下设置: - -在 Apple Developer Portal 上为您的应用启用 `Associated Domains` 后,您需要为应用的 Xcode 项目作同样设置。启用 `Assciated Domains` 后,通过前缀 `applinks:` 的方式添加从 Adjust 控制面板中 `Domains` 部分生成的通用链接,并确保您同时也删除了通用链接的 `http(s)` 部分。 - -![][associated-domains-applinks] - -完成该设置后,一旦点击 Adjust 跟踪通用链接,您的应用将被打开。应用打开后,您的 `AppDelegate` 中的 `continueUserActivity` 方法将被触发,来自通用链接 URL 的内容来源将被发送。如果您希望访问该深度链接内容,请改写此方法。 - -```objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - // url object contains your universal link content - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -通过以上设置,您已经成功为 iOS 9 及以上版本的 iOS 设备设置深度链接。 - -如果在您的代码中包含某些自定义逻辑,其仅接受旧式自定义 URL 方案名格式的深度链接信息,我们为您提供一个辅助函数,可以让您将通用链接转化为旧式的深度链接 URL。您可以使用通用链接以及您希望的深度链接前缀自定义 URL 方案名来调用该方法,我们将为您生成自定义 URL 方案深度链接: - -```objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### 延迟深度链接场景 - -您可以注册一个委托回传,以在延迟深度链接被打开之前获取通知,并决定是否由 Adjust SDK 尝试打开该链接。其所使用的是和[归因回传](#attribution-callback)及[事件及会话回传](#event-session-callbacks)同样的可选协议 `AdjustDelegate`。 - -按照同样步骤,为延迟深度链接执行以下委托回传函数: - -```objc -- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink { - // deeplink object contains information about deferred deep link content - - // Apply your logic to determine whether the Adjust SDK should try to open the deep link - return YES; - // or - // return NO; -} -``` - -在 SDK 从我们的服务器中接收延迟深度链接之后,回传函数将在打开该链接之前被调用。您可以在回传功能中访问该深度链接。返回的布尔值将决定是否由 SDK 打开该深度链接。您可以在此时不允许 SDK 打开该深度链接,将其保存,并在此之后由您自己打开。 - -如果不执行回传,**Adjust SDK 将始终默认尝试打开深度链接**。 - -### 通过深度链接的再归因 - -Adjust 支持您使用深度链接进行交互推广活动。请查看我们的[官方文档][reattribution-with-deeplinks]了解更多相关操作信息。 - -如果您正在使用该功能,您需要在应用中对 Adjust SDK 做一个额外的调用,以便用户被正确地再归因。 - -一旦您已经在应用中接收到深度链接内容信息,添加一个至 `appWillOpenUrl` 方法的调用。通过该调用,Adjust SDK 将会尝试在深度链接内寻找是否有任何新的归因信息,一旦找到,该信息将被发送至 Adjust 后台。如果您的用户因为点击带有深度链接内容的 Adjust 跟踪链接,而应该被再归因,您将会在应用中看到[归因回传](#attribution-callback)被该用户新的归因信息触发。 - -在所有的 iOS 版本中,请参照如下调用 `appWillOpenUrl` 以设置深度链接再归因: - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url object contains your deep link content - - [Adjust appWillOpenUrl:url]; - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -```objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL url = [userActivity webpageURL]; - - [Adjust appWillOpenUrl:url]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### 链接解析 - -通过电子邮件服务提供商 (ESP) 投放深度链接且需要使用自定义跟踪链接来跟踪点击时,可以使用 `ADJLinkResolution` 类的 `resolveLinkWithUrl` 方法进行链接解析。这样,当用户在应用中打开深度链接时,您就能记录用户与电子邮件推广活动的互动了。 - -`resolveLinkWithUrl` 方法携带下列参数: - -- `url` - 打开应用的深度链接 -- `resolveUrlSuffixArray` - 需要解析的、已设置推广活动的自定义域名 -- `callback` - 将包含最终 URL 的回传 - -如果接收到的链接不属于 `resolveUrlSuffixArray` 中指定的任何域名,那么回传就会原样转发深度链接 URL;如果链接包含所指定的域名,那么 SDK 就会尝试解析链接,并将解析得出的深度链接返回至 `callback` 参数。您也可以使用 [`Adjust appWillOpenUrl:]` 方法,在 Adjust SDK 中针对返回的深度链接进行再归因。 - -> **请注意**:在尝试解析 URL 时,SDK 会自动追溯最多 3 个重定向 (redirect),并将其中最新的 URL 返回为 `回传` URL,也就是说,如果要追溯的重定向超过 3 个,那么 SDK 就会返回 **第 3 个重定向 URL**。 - -**示例** - -```objc -[ADJLinkResolution - resolveLinkWithUrl:url - resolveUrlSuffixArray:@[@"example.com"] - callback:^(NSURL * _Nullable resolvedLink) - { - [Adjust appWillOpenUrl:resolvedLink]; - }]; -``` - -### [beta] 数据驻留 - -要启用数据驻留功能,请务必通过以下常量之一调用`ADJConfig` 实例中的 `setUrlStrategy:` 方法 : - -```objc -[adjustConfig setUrlStrategy:ADJDataResidencyEU]; // for EU data residency region -[adjustConfig setUrlStrategy:ADJDataResidencyTR]; // for Turkey data residency region -``` - -**注意:** 该功能当前尚处于 BETA 测试阶段。如果您希望启用该功能,请联系您的客户经理,或发送邮件至 support@adjust.com。为避免 SDK 流量丢失,请务必在启用该功能设置前联系我们的支持团队,保证该功能已为您的应用启用。 - -## 问题排查 - -### SDK 延迟初始化问题 - -如在[基本设置步骤](#basic-setup)中所描述的那样,我们强烈建议您在应用委托中以 `didFinishLaunching` 或者 `didFinishLaunchingWithOptions` 方法初始化 Adjust SDK。为了能够使用 SDK 的所有功能,您必须尽快地初始化 Adjust SDK。 - -不立即初始化 Adjust SDK 将会对应用跟踪产生多种影响。**为了在您的应用中执行所有的跟踪,Adjust SDK *一定*要被初始化。** - -如果您决定执行以下任一操作: - -* [事件跟踪](#event-tracking) -* [通过深度链接的再归因](#deeplinking-reattribution) -* [禁用跟踪](#disable-tracking) -* [离线模式](#offline-mode) - -在您初始化 SDK 之前,`这些操作不会被执行`。 - -如果您希望在 Adjust SDK 被真正初始化之前跟踪以上任一操作,则必须在应用中创建 `custom actions queueing mechanism` (自定义操作队列机制)。您需要将所有希望 SDK 执行的操作排成队列,在 SDK 被初始化之后执行它们。 - -离线模式状态不会被改变,跟踪启用/禁用状态不会被改变,深度链接再归因无法执行,所有跟踪事件将被`dropped` (丢弃)。 - -另一个可能会被 SDK 延迟初始化影响的是会话跟踪。Adjust SDK 在被初始化之前,不能收集任何会话长度的信息。您控制面板中的 DAU 数量将无法被正确跟踪。 - -举例来说,让我们假设这个场景:您正在初始化 Adjust SDK,要求一些特定的视图或视图控制器(view controller) 被加载。假设这不是您的应用初始启动或第一个屏幕,但是用户必须从主屏幕中导航至它们。如果用户下载并打开您的应用,主屏幕将被显示。正常情况下此时该安装应该被跟踪。然而,因为用户需要导航至之前提到的您初始化 Adjust SDK 的屏幕,所以 Adjust SDK 无法获取任何相关信息。此外,如果用户不喜欢该应用,并在看到主屏幕之后立即卸载该应用,以上提到的所有信息将不会被我们的 SDK 跟踪,也不会被显示在控制面板中。 - -### 事件跟踪 - -对于要跟踪的事件,请使用内部队列机制将其排列,并在 SDK 初始化之后跟踪它们。在初始化 SDK 之前跟踪事件将会造成事件被`dropped` (丢弃) 且 `permanently lost` (永久丢失),所以请确认您在 SDK 被 `initialised` (初始化) 并 [`enabled`](#is-enabled) (启用) 之后跟踪它们。 - -#### 离线模式和启用/禁用跟踪 - -离线模式功能在 SDK 初始化之间无法保留,所以它被默认设置为 `false`。如果您尝试在 SDK 初始化之前启用离线模式,当 SDK 最终被初始化之后,将仍然被设置为 `false`。 - -启用/禁用跟踪状态在 SDK 初始化之间保持不变。如果您尝试在 SDK 初始化之前切换它们,切换尝试将被忽略。当 SDK 被初始化之后,SDK 将处于切换尝试之前的 (启用或禁用) 状态。 - -#### 通过深度链接的再归因 - -如[之前](#deeplinking-reattribution)所描述的,当处理深度链接再归因时,取决于您正在使用的深度链接机制 (旧式或通用链接),在进行以下调用后您将获得 `NSURL` 对象: - -```objc -[Adjust appWillOpenUrl:url] -``` - -如果您在 SDK 被初始化之前进行此调用,来自深度链接的归因信息将会永久丢失。如果您希望 Adjust SDK 成功再归因用户,则需要在 SDK 被初始化之后,队列 `NSURL` 对象信息,并触发 `appWillOpenUrl` 方法。 - -#### 会话跟踪 - -会话跟踪将由 Adjust SDK 自动执行,不受应用开发者的影响。按照本自述文件说明初始化 Adjust SDK 对于会话跟踪是至关重要的,否则将对会话跟踪以及控制面板的 DAU 数量产生不可预测的影响。 - -例如: -* 用户打开应用,但在 SDK 初始化之前删除应用,导致安装和会话从未被跟踪,因此也不会在控制面板中被报告。 -* 如果用户在午夜前下载并打开您的应用,然而 Adjust SDK 在午夜后被初始化,则所有的安装和会话数据将在错误日期被报告。 -* 如果用户在午夜之后短暂打开了应用,但是没有在同一天使用应用,Adjust SDK 于午夜后被初始化,那没 DAU 的报告日期也将不是应用打开的那一天。 - -由于以上原因,请按照本文档的说明,在您的应用委托 `didFinishLaunching` 或 `didFinishLaunchingWithOptions` 方法中初始化 Adjust SDK。 - -### 显示 "adjust requires ARC" 出错信息 - -如果您的构建失败,错误为 `Adjust requires ARC`,可能是因为您的项目没有使用 ARC。在这种情况下,我们建议[过渡您的项目至 ARC][transition]。如果您不想使用 ARC,则必须在目标的 Build Phase 中,对 Adjust 的所有源文件启用 ARC: - -展开 `Compile Sources` 组,选择所有 Adjust 文件并将 `Compiler Flags` 改为 `-fobjc-arc` (选择全部并按下 `Return` 键立即全部更改)。 - -### 显示 "[UIDevice adjTrackingEnabled]: unrecognized selector sent to instance" 出错信息 - -当添加 Adjust SDK 框架至您的应用时可能发生该错误。Adjust SDK 源文件包含 `categories`,因此如果您已经选择此种 SDK 集成方式,则需要添加 `-ObjC` flags 至 Xcode 项目设置中 `Other Linker Flags`。添加该 flag 可以解决此错误。 - -### 显示 "Session failed (Ignoring too frequent session.)"出错信息 - -该错误一般发生在安装测试时。单凭卸载和重装应用不足以触发新安装。由于我们服务器已经有该设备的纪录,服务器会认定该设备的 SDK 丢失了本地聚合的会话数据,并忽略该错误信息。 - -这种行为在测试期间可能很麻烦,但为了尽可能地让沙箱(sandbox) 行为与生产 (production) 情况匹配,该行为是非常必要的。 - -您可以在我们的服务器上重置设备会话数据。请查看日志中的错误信息: - -``` -Session failed (Ignoring too frequent session.Last session: YYYY-MM-DDTHH:mm:ss, this session: YYYY-MM-DDTHH:mm:ss, interval: XXs, min interval: 20m) (app_token: {yourAppToken}, adid: {adidValue}) -``` - -With the `{yourAppToken}` and either `{adidValue}` or `{idfaValue}` values filled in below, open one of the following links: - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&adid={adidValue} -``` - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&idfa={idfaValue} -``` - -当设备被忘记,链接仅返回 `Forgot device`。如果设备之前已经被忘记或出现错误值,链接将返回 `Device not found`。 - -### 日志未显示 "Install tracked" - -如果您希望在测试设备上模拟应用的安装场景,仅仅在您的测试设备上重新运行 Xcode 开发的应用是不够的。重新运行 Xcode 开发的应用不会清除应用数据,SDK 保存在您的应用中的所有内部数据仍然会存在。因此在重新运行时,我们的 SDK 将会看到这些文件并认为您的应用已被安装 (SDK 已被启用),应用只是又一次被打开,而不是第一次。 - -为了运行应用安装场景,您需要进行以下步骤: - -* 从您的设备中卸载应用 (完全删除应用) -*如[之前](#forgot-device)所解释的,在 Adjust 后台忘记您的测试设备 -* 在测试设备上运行 Xcode 开发的应用,您将会看到日志信息 "Install tracked" - -### 显示 "Unattributable SDK click ignored" 信息 - -当您在 `sandbox` 环境中测试您的应用时,可能会看到该信息。这与 `iAd.framework` 版本 3 中 Apple 作出的一些更改有关。因此,点击 iAd banner 的用户将被定向至您的应用,导致我们的 SDK 发送一个 `sdk_click` 包至 Adjust 后台并通知后台被点击 URL 的内容。由于某些原因,Apple 决定如果应用在没有点击 iAD banner 的情况下被打开,将人工生成一个带有随机值的 iAd banner URL 点击。我们的 SDK 无法区分 iAd banner 点击是真实或者人工生成的,所以无论在何种情况下都会发送一个 `sdk_click` 包至 Adjust 后台。如果您已将日志级别设置为 `verbose` 级别,您将看到如下 `sdk_click` 包: - -``` -[Adjust]d: Added package 1 (click) -[Adjust]v: Path: /sdk_click -[Adjust]v: ClientSdk: ios4.10.1 -[Adjust]v: Parameters: -[Adjust]v: app_token {YourAppToken} -[Adjust]v: created_at 2016-04-15T14:25:51.676Z+0200 -[Adjust]v: details {"Version3.1":{"iad-lineitem-id":"1234567890","iad-org-name":"OrgName","iad-creative-name":"CreativeName","iad-click-date":"2016-04-15T12:25:51Z","iad-campaign-id":"1234567890","iad-attribution":"true","iad-lineitem-name":"LineName","iad-creative-id":"1234567890","iad-campaign-name":"CampaignName","iad-conversion-date":"2016-04-15T12:25:51Z"}} -[Adjust]v: environment sandbox -[Adjust]v: idfa XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -[Adjust]v: idfv YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY -[Adjust]v: needs_response_details 1 -[Adjust]v: source iad3 -``` - -如果由于某种原因,该 `sdk_click` 被接受,这表示通过点击其他推广链接或者自然搜索打开您的应用的用户,被归因到这个不存在的 iAd 来源。因此,我们的后台将忽略该点击,并显示以下信息: - -``` -[Adjust]v: Response: {"message":"Unattributable SDK click ignored."} -[Adjust]i: Unattributable SDK click ignored. -``` - -所以,该错误信息并不代表您的 SDK 集成出现问题,而仅是告知您我们的后台忽略了这个人工生成的 `sdk_click`,避免您的用户被错误地归因/再归因。 - -### Adjust 控制面板显示错误收入金额 - -Adjust SDK 仅跟踪您要求它跟踪的内容。如果您添加收入至事件,您所输入的金额是唯一到达 Adjust 后台并显示在控制面板中的金额。我们的 SDK 和后台都不会更改您的金额。如果您看到错误的金额被跟踪,那是因为我们的 SDK 被告知跟踪该金额。 - -通常,跟踪收入事件的用户代码如下: - -```objc -// ... - -- (double)someLogicForGettingRevenueAmount { - // This method somehow handles how user determines - // what's the revenue value which should be tracked. - - // It is maybe making some calculations to determine it. - - // Or maybe extracting the info from In-App purchase which - // was successfully finished. - - // Or maybe returns some predefined double value. - - double amount; // double amount = some double value - - return amount; -} - -// ... - -- (void)someRandomMethodInTheApp { - double amount = [self someLogicForGettingRevenueAmount]; - - ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - [event setRevenue:amount currency:@"EUR"]; - [Adjust trackEvent:event]; -} - -``` - -如果您在控制面板中看到任何您不期望被跟踪的值,**请务必检查您决定量值的逻辑**。 - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[en-readme]: ../../README.md -[zh-readme]: ../chinese/README.md -[ja-readme]: ../japanese/README.md -[ko-readme]: ../korean/README.md - -[sdk2sdk-mopub]: ../chinese/sdk-to-sdk/mopub.md - -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[examples]: http://github.com/adjust/ios_sdk/tree/master/examples -[carthage]: https://github.com/Carthage/Carthage -[releases]: https://github.com/adjust/ios_sdk/releases -[cocoapods]: http://cocoapods.org -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html - -[example-tvos]: ../../examples/AdjustExample-tvOS -[example-iwatch]: ../../examples/AdjustExample-iWatch -[example-imessage]: ../../examples/AdjustExample-iMessage -[example-ios-objc]: ../../examples/AdjustExample-ObjC -[example-ios-swift]: ../../examples/AdjustExample-Swift - -[AEPriceMatrix]: https://github.com/adjust/AEPriceMatrix -[event-tracking]: https://docs.adjust.com/zh/event-tracking -[callbacks-guide]: https://docs.adjust.com/zh/callbacks -[universal-links]: https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html -[special-partners]: https://docs.adjust.com/zh/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[ios-web-views-guide]: https://github.com/adjust/ios_sdk/tree/master/doc/chinese -[currency-conversion]: https://docs.adjust.com/zh/event-tracking/#tracking-purchases-in-different-currencies - -[universal-links-guide]: https://docs.adjust.com/zh/universal-links/ -[adjust-universal-links]: https://docs.adjust.com/zh/universal-links/#redirecting-to-universal-links-directly -[universal-links-testing]: https://docs.adjust.com/zh/universal-links/#testing-universal-link-implementations -[reattribution-deeplinks]: https://docs.adjust.com/zh/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[ios-purchase-verification]: https://github.com/adjust/ios_purchase_sdk - -[reattribution-with-deeplinks]: https://docs.adjust.com/zh/deeplinking/#manually-appending-attribution-data-to-a-deep-link - -[run]: https://raw.github.com/adjust/sdks/master/Resources/ios/run5.png -[add]: https://raw.github.com/adjust/sdks/master/Resources/ios/add5.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag5.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate5.png -[framework]: https://raw.github.com/adjust/sdks/master/Resources/ios/framework5.png - -[adc-ios-team-id]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-ios-team-id5.png -[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png -[adc-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-associated-domains5.png -[xcode-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/xcode-associated-domains5.png -[universal-links-dashboard]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard5.png - -[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png -[universal-links-dashboard-values]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard-values5.png - -[en-helpcenter]: https://help.adjust.com/en/developer/ios-sdk-documentation -[zh-helpcenter]: https://help.adjust.com/zh/developer/ios-sdk-documentation -[ja-helpcenter]: https://help.adjust.com/ja/developer/ios-sdk-documentation -[ko-helpcenter]: https://help.adjust.com/ko/developer/ios-sdk-documentation - -## License - -The Adjust SDK is licensed under the MIT License. - -Copyright (c) 2012-2019 Adjust GmbH, http://www.adjust.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/doc/chinese/fb_pixel.md b/doc/chinese/fb_pixel.md deleted file mode 100644 index b8fb536d6..000000000 --- a/doc/chinese/fb_pixel.md +++ /dev/null @@ -1,126 +0,0 @@ -## Facebook像素集成 - -[Facebook像素](https://www.facebook.com/business/help/952192354843755)是由Facebook提供的仅限于Web的分析工具。在过去,我们无法使用Facebook SDK来跟踪应用网页视图(Webview)中的像素事件。[FB SDK](https://developers.facebook.com/docs/analytics)4.34版本的发布使之成为可能,并通过[混合移动应用事件(Hybrid Mobile App Events)](https://developers.facebook.com/docs/app-events/hybrid-app-events)将Facebook像素事件转化为Facebook应用事件。 - -您现在还可通过Adjust SDK跟踪Facebook像素,而无需集成FB SDK。 - -## Facebook集成 - -### 示例应用 - -[`AdjustExample-FbPixel`目录][example-fbpixel]中的示例应用向您演示了如何使用Adjust网页视图SDK跟踪Facebook像素事件。 - -### Facebook应用ID - -虽然无需集成FB SDK,但您必须遵循与FB SDK相同的一些集成步骤以将Facebook像素集成到Adjust SDK中。 - -如[FB SDK iOS SDK指南](https://developers.facebook.com/docs/ios/getting-started/#xcode)中所述,您须将Facebook应用ID添加到应用中。 您可按照该指南中的步骤操作,同时我们将步骤复制如下: - -- 在Xcode中,右键单击项目的`Info.plist`文件,然后选择Open As(打开方式) - > Source Code(源代码)。 -- 在最后的``元素前将以下XML代码片段插入到文件正文中: - - ```xml - - ... - FacebookAppID - {your-app-id} - ... - - ``` - -- 将`{your-app-id}`替换为您应用的应用ID(该ID可在*Facebook应用控制面板*中找到)。 - -### Facebook像素配置 - -请参考Facebook指南了解如何集成Facebook像素。Javascript代码应如下所示: - -```js - - -... - -``` - -现在,正如[混合移动应用事件指南](https://developers.facebook.com/docs/app-events/hybrid-app-events)`Update Your Pixel(更新您的像素)`部分所述,您须更新Facebook像素代码如下: - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**注意**:**非常重要**的一点是您必须首先调用''init'`并且之后立即调用`'set'`方法。Facebook提供给您需粘贴到HTML网页的代码片段(如上所示)包含调用`'init'`方法后的页面视图事件的`'track'`方法。为了正确跟踪此页面视图事件,请务必在两者之间调用`'set'`方法! - -## Adjust集成 - -### 加载网页视图 - -请按照[iOS Web视图](web_views.md)应用的集成指南进行操作。如下文加载网页视图桥: - -```objc -- (void)viewWillAppear:(BOOL)animated { - ... - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - // or with WKWebView: - // WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - self.adjustBridge = [[AdjustBridge alloc] init]; - [self.adjustBridge loadUIWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadUIWebViewBridge:webView webViewDelegate:(UIWebViewDelegate*)self]; - - // or with WKWebView: - // [self.adjustBridge loadWKWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; - ... -``` - -无论您选择如何将网页视图加载到Adjust桥,请通过添加以下行来执行该步骤: - -```objc -[self.adjustBridge augmentHybridWebView]; -``` - -### 事件名称配置 - -Adjust网桥SDK将Facebook像素事件转化为Adjust事件。 - -因此,您必须将Facebook像素映射到特定的Adjust事件,或者在启动Adjust SDK和跟踪任意Facebook像素事件***之前***配置默认的Adjust事件识别码,包括从Facebook像素配置中复制粘贴的`fbq('track', 'PageView');`。 - -为了将Facebook像素事件映射到Adjust事件,请在初始化Adjust SDK之前在`adjustConfig`实例中调用`addFbPixelMapping(fbEventNameKey,adjEventTokenValue)`。应类似以下示例: - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -请注意,在跟踪Facebook像素事件:`fbq('track', 'Search', ...);` 和 `fbq('track', 'Purchase', ...);` 时应可实现匹配。但遗憾的是我们无法访问Javascript中跟踪的事件名称与FB SDK使用的事件名称之间的完整映射方案。 - -以下为到目前为止我们收集的事件名称信息,供您参考: - -| 像素事件名称 | 对应Facebook应用事件名称 -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - -以上列表也许还不完整;Facebook也可能添加或更新当前列表。在测试时,请查看Adjust日志以获取提示信息,例如: - -``` -未就名称为:'fb_mobile_search'的事件配置默认事件识别码或找到匹配。它将不会被Adjust作为事件来跟踪。 -``` - -如果您未配置映射,还可以选择使用默认的Adjust事件。您只需在初始化Adjust SDK之前调用`adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);`。 - -[example-fbpixel]: ../../examples/AdjustExample-FbPixel diff --git a/doc/chinese/sdk-to-sdk/admob.md b/doc/chinese/sdk-to-sdk/admob.md deleted file mode 100644 index bf8371bae..000000000 --- a/doc/chinese/sdk-to-sdk/admob.md +++ /dev/null @@ -1,29 +0,0 @@ -# 通过 Adjust SDK 跟踪 AdMob 广告收入 - -[Adjust iOS SDK 自述文件][ios-readme] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.29.0** - -如果您想使用 AdMob SDK 跟踪广告收入,可以借助我们的 SDK 到 SDK 集成,将数据发送到 Adjust 后端。要做到这一点,您需要构建 Adjust 广告收入对象,其中包含想记录的信息,然后将对象发送到 `trackAdRevenue` 方法。 - -> 请注意:如果您对 AdMob 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 [support@adjust.com](mailto:support@adjust.com)。 - -### 示例 - -```objc -- (void)requestRewardedAd { - self.rewardedAd = [[GADRewardedAd alloc] initWithAdUnitID:@"ad unit ID"]; - ViewController *strongSelf = weakSelf; - self.rewardedAd.paidEventHandler = ^void(GADAdValue *_Nonnull value) { - // ... - // send ad revenue info to Adjust - ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAdMob]; - [adRevenue setRevenue:value.value currency:value.currencyCode]; - [Adjust trackAdRevenue:adRevenue]; - } -}; -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/chinese/README.md diff --git a/doc/chinese/sdk-to-sdk/applovin-max.md b/doc/chinese/sdk-to-sdk/applovin-max.md deleted file mode 100644 index c7abb14de..000000000 --- a/doc/chinese/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,29 +0,0 @@ -# 通过 Adjust SDK 跟踪 AppLovin MAX 广告收入 - -[Adjust iOS SDK 自述文件][ios-readme] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.29.0** - -如果您想使用 AppLovin MAX SDK 跟踪广告收入,可以借助我们的 SDK-to-SDK 集成,将数据发送到 Adjust 后端。要做到这一点,您需要构建 Adjust 广告收入对象,其中包含想记录的信息,然后将对象发送到 `trackAdRevenue` 方法。 - -> 请注意:如果您对 AppLovin MAX 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 [support@adjust.com](mailto:support@adjust.com)。 - -### 示例 - -```objc -- (void)didPayRevenueForAd:(MAAd *)ad { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAppLovinMAX]; - - adjustAdRevenue.setRevenue(ad.revenue,"USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.networkName); - adjustAdRevenue.setAdRevenueUnit(ad.adUnitIdentifier); - adjustAdRevenue.setAdRevenuePlacement(ad.placement); - - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/chinese/README.md - diff --git a/doc/chinese/sdk-to-sdk/ironsource.md b/doc/chinese/sdk-to-sdk/ironsource.md deleted file mode 100644 index 3a9e8701f..000000000 --- a/doc/chinese/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# 通过 Adjust SDK 跟踪 ironSource 广告收入 - -[Adjust iOS SDK 自述文件][ios-readme] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.29.0** - -如果您想使用 ironSource SDK 跟踪广告收入,可以借助我们的 SDK-to-SDK 集成,将数据发送到 Adjust 后端。要做到这一点,您需要构建 Adjust 广告收入对象,其中包含想记录的信息,然后将对象发送到 `trackAdRevenue` 方法。 - -> 请注意:如果您对 ironSource 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 [support@adjust.com](mailto:support@adjust.com)。 - -### 示例 - -```objc -- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceIronSource]; - [adjustAdRevenue setRevenue:impressionData.revenue currency:@"USD"]; - // optional fields - [adjustAdRevenue setAdRevenueNetwork:impressionData.ad_network]; - [adjustAdRevenue setAdRevenueUnit:impressionData.ad_unit]; - [adjustAdRevenue setAdRevenuePlacement:impressionData.placement]; - // track Adjust ad revenue - [Adjust trackAdRevenue:adjustAdRevenue]; -} -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/chinese/README.md diff --git a/doc/chinese/sdk-to-sdk/mopub.md b/doc/chinese/sdk-to-sdk/mopub.md deleted file mode 100644 index 3db9e3568..000000000 --- a/doc/chinese/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,33 +0,0 @@ -## 通过 Adjust SDK 跟踪 MoPub 广告收入 - -[Adjust iOS SDK 自述文件][ios-readme] - -[MoPub iOS 文档][mopub-docs] - -此功能最低 SDK 版本要求: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -如果您在展示**奖励式视频广告**:在实施 MoPub SDK `didTrackImpressionWithAdUnitID:impressionData:` 回传方法时,请确保按照如下方式调用 Adjust SDK 的 `trackAdRevenue:payload:`方法: - -```objc -- (void)didTrackImpressionWithAdUnitID:(NSString *)adUnitID - impressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` -如果您在展示**其他的广告格式**:在实施 MoPub SDK `mopubAd:didTrackImpressionWithImpressionData:` 回传方法时,请确保按照如下方式调用 Adjust SDK 的 `trackAdRevenue:payload:` 方法: - -```objc -- (void)mopubAd:(id)ad didTrackImpressionWithImpressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -如果您对 MoPub 广告收入跟踪有任何疑问,请联系您的专属客户经理,或发送邮件至 support@adjust.com。 - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[ios-readme]: ../../chinese/README.md diff --git a/doc/english/adobe.md b/doc/english/adobe.md deleted file mode 100644 index 97b330dd4..000000000 --- a/doc/english/adobe.md +++ /dev/null @@ -1,34 +0,0 @@ -## Integrate Adjust with the Adobe SDK - -To integrate Adjust with all Adobe SDK tracked events, you must send your Adjust attribution data to the Adobe SDK after receiving the attribution response from our backend. Follow the steps in the [attribution callback][attribution-callback] chapter of our iOS SDK guide to implement this. To use the Adobe SDK API, the callback method can be set as the following: - -```objc -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { - NSMutableDictionary *adjustData= [NSMutableDictionary dictionary]; - - if (attribution.network != nil) { - // Do not change the key "Adjust Network". This key is being used in the Data Connector Processing Rule - [adjustData setObject:@attribution.network forKey:@"Adjust Network"]; - } - if (attribution.campaign != nil) { - // Do not change the key "Adjust Campaign". This key is being used in the Data Connector Processing Rule - [adjustData setObject:@attribution.campaign forKey:@"Adjust Campaign"]; - } - if (attribution.adgroup != nil) { - // Do not change the key "Adjust AdGroup". This key is being used in the Data Connector Processing Rule - [adjustData setObject:@attribution.adgroup forKey:@"Adjust AdGroup"]; - } - if (attribution.creative != nil) { - // Do not change the key "Adjust Creative". This key is being used in the Data Connector Processing Rule - [adjustData setObject:@attribution.creative forKey:@"Adjust Creative"]; - } - - // Send Data to Adobe using Track Action - [ADBMobile trackAction:@"Adjust Campaign Data Received" data:adjustData]; -} -``` - -Before you implement this interface, please take care to consider the [possible conditions for usage of some of your data][attribution-data]. - -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[attribution-callback]: https://github.com/adjust/ios_sdk#attribution-callback diff --git a/doc/english/batch.md b/doc/english/batch.md deleted file mode 100644 index b980d0403..000000000 --- a/doc/english/batch.md +++ /dev/null @@ -1,27 +0,0 @@ -## Integrate Adjust with the Batch.com SDK - -To integrate Adjust with Batch.com SDK, you must send your Adjust attribution data to the Batch SDK after receiving the attribution response from our backend. Follow the steps in the [attribution callback][attribution-callback] chapter of our iOS SDK guide to implement this. To use the Batch.com SDK API, the callback method can be set as the following: - -```objc -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { - // initiate Batch user editor to set new attributes - BatchUserDataEditor *editor = [BatchUser editor]; - - if (attribution.network != nil) - [editor setAttribute:attribution.network forKey:@"adjust_network"]; - if (attribution.campaign != nil) - [editor setAttribute:attribution.campaign forKey:@"adjust_campaign"]; - if (attribution.adgroup != nil) - [editor setAttribute:attribution.adgroup forKey:@"adjust_adgroup"]; - if (attribution.creative != nil) - [editor setAttribute:attribution.creative forKey:@"adjust_creative"]; - - // send new attributes to Batch servers - [editor save]; -} -``` - -Before you implement this interface, please take care to consider the [possible conditions for usage of some of your data][attribution-data]. - -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[attribution-callback]: https://github.com/adjust/ios_sdk#attribution-callback \ No newline at end of file diff --git a/doc/english/criteo_plugin.md b/doc/english/criteo_plugin.md deleted file mode 100644 index 9f6246525..000000000 --- a/doc/english/criteo_plugin.md +++ /dev/null @@ -1,236 +0,0 @@ -## Criteo plugin - -Integrate adjust with Criteo events by following one of these methods: - -### CocoaPods - -If you're using [CocoaPods](http://cocoapods.org/), you can add the following line to your Podfile: - -```ruby -pod 'Adjust/Criteo' -``` - -### Carthage - -If you're using [Carthage](https://github.com/Carthage/Carthage), you can add following line to your Cartfile: - -```ruby -github "adjust/ios_sdk" "criteo" -``` - -### Source - -You can also integrate adjust with Criteo events by following these steps: - -1. Locate the `plugin/Criteo` 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`. - -### Criteo events -Now you can integrate each of the different Criteo events, like in the following examples: - -#### View Listing - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"]; - -NSArray *productIds = @[@"productId1", @"productId2", @"product3"]; - -[ADJCriteo injectViewListingIntoEvent:event productIds:productIds]; - -[Adjust trackEvent:event]; -``` - -#### View Product - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewProductEventToken}"]; - -[ADJCriteo injectViewProductIntoEvent:event productId:@"productId1"]; - -[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]; - -[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 - transactionId:@"transactionId1" newCustomer:@"newCustomerId"]; - -[Adjust trackEvent:event]; -``` - -#### User Level - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{userLevelEventToken}"]; - -[ADJCriteo injectUserLevelIntoEvent:event uiLevel:1]; - -[Adjust trackEvent:event]; -``` - -#### User Status - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{userStatusEventToken}"]; - -[ADJCriteo injectUserStatusIntoEvent:event uiStatus:@"uiStatusValue"]; - -[Adjust trackEvent:event]; -``` - -#### Achievement Unlocked - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{achievementUnlockedEventToken}"]; - -[ADJCriteo injectAchievementUnlockedIntoEvent:event uiAchievement:@"uiAchievementValue"]; - -[Adjust trackEvent:event]; -``` - -#### Custom Event - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEventEventToken}"]; - -[ADJCriteo injectCustomEventIntoEvent:event uiData:@"uiDataValue"]; - -[Adjust trackEvent:event]; -``` - -#### Custom Event 2 - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEvent2EventToken}"]; - -[ADJCriteo injectCustomEvent2IntoEvent:event uiData2:@"uiDataValue2" uiData3:3]; - -[Adjust trackEvent:event]; -``` - -#### Hashed Email - -It's possible to attach an hashed email in every Criteo event with the `injectHashedEmailIntoCriteoEvents` method. -The hashed email will be sent with every Criteo event for the duration of the application lifecycle, -so it must be set again when the app is re-lauched. -The hashed email can be removed by setting the `injectHashedEmailIntoCriteoEvents` value with `nil`. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectHashedEmailIntoCriteoEvents:@"8455938a1db5c475a87d76edacb6284e"]; -``` - -#### Search dates - -It's possible to attach a check-in and check-out date to every Criteo event with the `injectViewSearchDatesIntoCriteoEvent` method. The dates will be sent with every Criteo event for the duration of the application lifecycle, so it must be set again when the app is re-lauched. - -The search dates can be removed by setting the `injectViewSearchDatesIntoCriteoEvents` values with `nil`. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectViewSearchDatesIntoCriteoEvents:@"2015-01-01" checkOutDate:@"2015-01-07"]; -``` - -#### Partner id - -It's possible to attach a partner id to every Criteo event with the `injectPartnerIdIntoCriteoEvent` method. The partner id will be sent with every Criteo event for the duration of the application lifecycle, so it must be set again when the app is re-lauched. - -The search dates can be removed by setting the `injectPartnerIdIntoCriteoEvent` value with `nil`. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectPartnerIdIntoCriteoEvents:@"{criteoPartnerId}"]; -``` - -#### Send deeplink - -In the Project Navigator open the source file your Application Delegate. Find or add the method openURL and add the following call to adjust: - -```objc -#import "ADJCriteo.h" - -- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation -{ - ADJEvent *event = [ADJEvent eventWithEventToken:@"{deeplinkEventToken}"]; - - [ADJCriteo injectDeeplinkIntoEvent:event url:url]; - - [Adjust trackEvent:event]; - - //... -} -``` - -#### Customer ID - -It's possible to attach the customer ID to every Criteo event with the `injectCustomerIdIntoCriteoEvents` method. The customer ID will be sent with every Criteo event for the duration of the application life cycle, so it must be set again when the app is re-launched. - -The customer ID can be removed by setting the `injectCustomerIdIntoCriteoEvents` value to `nil`. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectCustomerIdIntoCriteoEvents:@"{CriteoCustomerId}"]; - -``` - -#### User Segment - -It's possible to attach the user segment to every Criteo event with the `injectUserSegmentIntoCriteoEvents` method. The user segment will be sent with every Criteo event for the duration of the application life cycle, so it must be set again when the app is re-launched. - -The user segment can be removed by setting the `injectUserSegmentIntoCriteoEvents` value to `nil`. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectUserSegmentIntoCriteoEvents:@"{CriteoUserSegment}"]; -``` diff --git a/doc/english/fb_pixel.md b/doc/english/fb_pixel.md deleted file mode 100644 index 53b81cb10..000000000 --- a/doc/english/fb_pixel.md +++ /dev/null @@ -1,126 +0,0 @@ -## Facebook pixel integration - -[The Facebook Pixel](https://www.facebook.com/business/help/952192354843755) is a web-only analytics tool from Facebook. In the past it was impossible to use the Facebook SDK to track Pixel events in an app's webview. Since the release of [FB SDK](https://developers.facebook.com/docs/analytics) v4.34, it's now possible to do so, and use the [Hybrid Mobile App Events](https://developers.facebook.com/docs/app-events/hybrid-app-events) to convert Facebook Pixel events into Facebook App events. - -It is also now possible to use the Facebook Pixel with the Adjust SDK, without integrating the FB SDK. - -## Facebook integration - -### Example app - -There is an example app inside the [`AdjustExample-FbPixel` directory][example-fbpixel] that demonstrates how Facebook Pixel events can be tracked with usage of Adjust web view SDK. - -### Facebook App ID - -There is no need to integrate the FB SDK; however, you must follow a few of the same integration steps from the FB SDK in order for the Adjust SDK to integrate the Facebook Pixel. - -As is described in the [FB SDK iOS SDK guide](https://developers.facebook.com/docs/ios/getting-started/#xcode) you will need to add your Facebook App ID to the app. You can follow the steps in that guide, but we've also copied them here below: - -- In Xcode, right click on your project's `Info.plist` file and select Open As -> Source Code. -- Insert the following XML snippet into the body of your file just before the final `` element: - - ```xml - - ... - FacebookAppID - {your-app-id} - ... - - ``` - -- Replace `{your-app-id}` with your app's App ID (found on the *Facebook App Dashboard*). - -### Facebook Pixel configuration - -Follow Facebook's guide on how to integrate the Facebook Pixel. The Javascript code should look something like this: - -```js - - -... - -``` - -Now, just as described in the [Hybrid Mobile App Events guide](https://developers.facebook.com/docs/app-events/hybrid-app-events) `Update Your Pixel` section, you'll need to update the Facebook Pixel code like this: - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**Note**: Please pay attention that it is **very important** that you first call `'init'` and immediately afterwards `'set'` method. Facebook's script snipet they offer you to paste to your HTML web page (like shown above) contains `'track'` method for page view event right after call to `'init'` method. In order for this page view event to be properly tracked, please make sure to call `'set'` method in between! - -## Adjust integration - -### Augment the web view - -Follow the integration guide for [iOS web view](web_views.md) apps. In the section where you load the webview bridge (see below): - -```objc -- (void)viewWillAppear:(BOOL)animated { - ... - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - // or with WKWebView: - // WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - self.adjustBridge = [[AdjustBridge alloc] init]; - [self.adjustBridge loadUIWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadUIWebViewBridge:webView webViewDelegate:(UIWebViewDelegate*)self]; - - // or with WKWebView: - // [self.adjustBridge loadWKWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; - ... -``` - -No matter how you choose to load the web view into the Adjust bridge, follow that step by adding the following line: - -```objc -[self.adjustBridge augmentHybridWebView]; -``` - -### Event name configuration - -The Adjust web bridge SDK translates Facebook Pixel events into Adjust events. - -For this reason, it's necessary to map Facebook Pixels to specific Adjust events, or to configure a default Adjust event token ***before*** starting Adjust SDK and tracking any Facebook Pixel event, including the copy-pasted `fbq('track', 'PageView');` from the Facebook Pixel configuration. - -To map Facebook Pixel events and Adjust events, call `addFbPixelMapping(fbEventNameKey, adjEventTokenValue)` in the `adjustConfig` instance before initializing the Adjust SDK. Here's an example of what that could look like: - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -Note that this would match when tracking the following Facebook Pixel events: `fbq('track', 'Search', ...);` and `fbq('track', 'Purchase', ...);` respectively. Unfortunately, we do not have access to the entire mapping scheme between the event names tracked in Javascript and the event names used by the FB SDK. - -To help you, here is the event name information we've found so far: - -| Pixel event name | Corresponding Facebook app event name -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - -This may not be an exhaustive list; it's also possible that Facebook adds to or updates the current listing. While testing, check the Adjust logs for warnings such as: - -``` -There is not a default event token configured or a mapping found for event named: 'fb_mobile_search'. It won't be tracked as an adjust event -``` - -There is also the option to use a default Adjust event if you do not have mapping configured. Just call `adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);` before initializing the Adjust SDK. - -[example-fbpixel]: ../../examples/AdjustExample-FbPixel diff --git a/doc/english/idfa.md b/doc/english/idfa.md deleted file mode 100644 index 446a77e6d..000000000 --- a/doc/english/idfa.md +++ /dev/null @@ -1,44 +0,0 @@ -## Remove IDFA support - -If your app got rejected by Apple because your app is using the advertising -identifier, this document is for you. - -1. Contact us at [support@adjust.com](mailto:support@adjust.com). We would like - to make sure that you are aware of the consequences of removing IDFA - support. - -2. After you talked with us, or when you just can't wait any longer, proceed - with the following steps to remove the IDFA support. - -### Remove the AdSupport framework - -- In the Project Navigator select your project. Make sure your target is - selected in the top left corner of the right hand window. - -- Select the `Build Phases` tab and expand the group `Link Binary with - Libraries`. - -- Select the `AdSupport.framework` and press the `-` button to remove it. - -- In the Project Navigator, expand the group `Frameworks`. - -- If the `AdSupport.framework` is in there, right click it, select `Delete` and - confirm `Remove Reference`. - -### Add the compiler flag `ADJUST_NO_IDFA` - -- In the Project Navigator select your project. Make sure your target is - selected in the top left corner of the right hand window. - -- Select the `Build Settings` tab and search for `Other C Flags` in the search - field below. - -- Double click on the right side of the `Other C Flags` line to change its - value - -- Press on the `+` button at the bottom of the overlay and paste the following - text into the selected line: - - ``` - -DADJUST_NO_IDFA - ``` diff --git a/doc/english/migrate.md b/doc/english/migrate.md deleted file mode 100644 index 13858778d..000000000 --- a/doc/english/migrate.md +++ /dev/null @@ -1,211 +0,0 @@ -## Migrate your Adjust SDK for iOS to v4.31.0 from v3.4.0 - -### Initial setup - -We've changed how you configure the adjust SDK. All initial setup is now done with -a new config object. We've also replaced the adjust prefix from `AI` to `ADJ`. -Here is an example of how the setup in `AppDelegate.m` might look before and -after the migration: - -##### Before - -```objc -[Adjust appDidLaunch:@"{YourAppToken}"]; -[Adjust setEnvironment:AIEnvironmentSandbox]; -[Adjust setLogLevel:AILogLevelInfo]; -[Adjust setDelegate:self]; - -- (void)adjustFinishedTrackingWithResponse:(AIResponseData *)responseData { -} -``` - -##### After - -```objc -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; -[adjustConfig setLogLevel:ADJLogLevelInfo]; -[adjustConfig setDelegate:self]; -[Adjust appDidLaunch:adjustConfig]; - -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { -} -``` - -### Event tracking - -We've also introduced proper event objects that can be set up before they are -tracked. Again, an example of how it might look like before and after: - -##### Before - -```objc -NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; -[parameters setObject:@"value" forKey:@"key"]; -[parameters setObject:@"bar" forKey:@"foo"]; -[Adjust trackEvent:@"abc123" withParameters:parameters]; -``` - -##### After - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; -[Adjust trackEvent:event]; -``` - -### Revenue tracking - -Revenues are now handled like normal events. You simply set a revenue and a -currency to track revenues. Note that it is no longer possible to track revenues -without associated event tokens. You might need to create an additional event token -in your dashboard. The optional transaction ID is now a property of the event -instance. - -*Please note* - the revenue format has been changed from a cent float to a whole -currency-unit float. Current revenue tracking must be adjusted to whole currency -units (i.e., divided by 100) in order to remain consistent. - -##### Before - -```objc -[Adjust trackRevenue:1.0 transactionId:transaction.transactionIdentifier forEvent:@"xyz987"]; -``` - -##### After - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"xyz987"]; -[event setRevenue:0.01 currency:@"EUR"]; // You have to include the currency -[event setTransactionId:transaction.transactionIdentifier]; -[Adjust trackEvent:event]; -``` - -## Additional steps if you come from v3.0.0 - -We've added an optional parameter called `transactionId` to our `trackRevenue` methods. -If you are tracking In-App Purchases, then you might want to pass in the transaction -identifier provided by Apple to avoid duplicate revenue tracking. It should -look roughly like this: - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState) { - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - [Adjust trackRevenue:... - transactionId:transaction.transactionIdentifier // avoid duplicates - forEvent:... - withParameters:...]; - - break; - // more cases - } - } -} -``` - -## Additional steps if you come from v2.1.x or 2.2.x - -We renamed the main class `AdjustIo` to `Adjust`. Follow these steps to update -all adjust SDK calls. - -1. Right click on the old `AdjustIo` source folder and select `Delete`. Confirm - `Move to Trash`. - -2. From the Xcode menu select `Find → Find and Replace in Project...` to bring - up the project wide search and replace. Enter `AdjustIo` into the search - field and `Adjust` into the replace field. Press enter to start the search. - Press the preview button and deselect all matches you don't want to replace. - Press the replace button to replace all `Adjust` imports and calls. - - ![][rename] - -3. Download version v3.4.0 and drag the new folder `Adjust` into your Xcode - Project Navigator. - - ![][drag] - -4. Build your project to confirm that everything is properly connected again. - -The adjust SDK v3.4.0 added delegate callbacks. Check out the [README] for -details. - -## Additional steps if you come from v2.0.x - -In the Project Navigator open the source file your Application Delegate. Add -the `import` statement at the top of the file. In the `didFinishLaunching` or -`didFinishLaunchingWithOptions` method of your App Delegate add the following -calls to `Adjust`: - -```objc -#import "Adjust.h" -// ... -[Adjust appDidLaunch:@"{YourAppToken}"]; -[Adjust setLogLevel:AILogLevelInfo]; -[Adjust setEnvironment:AIEnvironmentSandbox]; -``` -![][delegate] - -Replace `{YourAppToken}` with your App Token. You can find in your [dashboard]. - -You can increase or decrease the amount of logs you see by calling -`setLogLevel:` with one of the following parameters: - -```objc -[Adjust setLogLevel:AILogLevelVerbose]; // enable all logging -[Adjust setLogLevel:AILogLevelDebug]; // enable more logging -[Adjust setLogLevel:AILogLevelInfo]; // the default -[Adjust setLogLevel:AILogLevelWarn]; // disable info logging -[Adjust setLogLevel:AILogLevelError]; // disable warnings as well -[Adjust setLogLevel:AILogLevelAssert]; // disable errors as well -``` - -Depending on whether or not you build your app for testing or for production -you must call `setEnvironment:` with one of these parameters: - -```objc -[Adjust setEnvironment:AIEnvironmentSandbox]; -[Adjust setEnvironment:AIEnvironmentProduction]; -``` - -**Important:** This value should be set to `AIEnvironmentSandbox` if and only -if you or someone else is testing your app. Make sure to set the environment to -`AIEnvironmentProduction` just before you publish the app. Set it back to -`AIEnvironmentSandbox` when you start testing it again. - -We use this environment to distinguish between real traffic and artificial -traffic from test devices. It is very important that you keep this value -meaningful at all times! Especially if you are tracking revenue. - -## Additional steps if you come from v1.x - -1. The `appDidLaunch` method now expects your App Token instead of your App ID. - You can find your App Token in your [dashboard]. - -2. The adjust SDK for iOS 3.4.0 uses [ARC][arc]. If you haven't done already, - we recommend [transitioning your project to use ARC][transition] as well. If - you don't want to use ARC, you have to enable ARC for all files of the - adjust SDK. Please consult the [README] for details. - -3. Remove all calls to `[+Adjust setLoggingEnabled:]`. Logging is now enabled - by default and its verbosity can be changed with the new `[Adjust - setLogLevel:]` method. See the [README] for details. - -4. Rename all calls to `[+Adjust userGeneratedRevenue:...]` to `[+Adjust - trackRevenue:...]`. We renamed these methods to make the names more - consistent. The amount parameter is now of type `double`, so you can drop - the `f` suffixes in number literals (`12.3f` becomes `12.3`). - -[README]: ../README.md -[rename]: https://raw.github.com/adjust/sdks/master/Resources/ios/rename.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag3.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate3.png -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html -[dashboard]: http://adjust.com diff --git a/doc/english/mixpanel.md b/doc/english/mixpanel.md deleted file mode 100644 index d780608f6..000000000 --- a/doc/english/mixpanel.md +++ /dev/null @@ -1,27 +0,0 @@ -##Integrate adjust with Mixpanel SDK - -The Mixpanel API allows to register common properties to be sent in all activities as `super properties`, as it is explained in the [Mixpanel page][mixpanel_ios]. To integrate adjust with all tracked events of Mixpanel, you must set the `super properties` after receiving the attribution data. Follow the steps of the [delegate callbacks][response_callbacks] chapter in our iOS SDK guide to implement it. -The delegate function can be set as the following, to use the Mixpanel API: - -```objc -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { - Mixpanel *mixpanel = [Mixpanel sharedInstance]; - - // The adjust properties will be sent - // with all future track calls. - if (attribution.network != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Network": attribution.network}]; - if (attribution.campaign != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Campaign": attribution.campaign}]; - if (attribution.adgroup != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Adgroup": attribution.adgroup}]; - if (attribution.creative != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Creative": attribution.creative}]; -} -``` - -Before you implement this interface, please take care to consider [possible conditions for usage of some of your data][attribution_data]. - -[mixpanel_ios]: https://mixpanel.com/help/reference/ios#super-properties -[attribution_data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[response_callbacks]: https://github.com/adjust/ios_sdk#9-receive-delegate-callbacks diff --git a/doc/english/sdk-to-sdk/admob.md b/doc/english/sdk-to-sdk/admob.md deleted file mode 100644 index efd722a21..000000000 --- a/doc/english/sdk-to-sdk/admob.md +++ /dev/null @@ -1,29 +0,0 @@ -# Track AdMob ad revenue with Adjust SDK - -[Adjust iOS SDK README][ios-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.0** - -> Note: In order to enable this feature, please reach out to your Google point of contact. Your point of contact will be able to activate the feature for you to access it. - -If you want to track your ad revenue with the Admob SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method. - -> Note: If you have any questions about ad revenue tracking with Admob, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com). - -### Example - -```objc -self.rewardedAd.paidEventHandler = ^void(GADAdValue *_Nonnull value) { - // ... - // send ad revenue info to Adjust - ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAdMob]; - [adRevenue setRevenue:value.value currency:value.currencyCode]; - [Adjust trackAdRevenue:adRevenue]; -} -``` - -For more information on how to properly integrate and set up AdMob SDK, please check out the [official documentation](https://developers.google.com/admob/ios/early-access/paid-events). - -[ios-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/applovin-max.md b/doc/english/sdk-to-sdk/applovin-max.md deleted file mode 100644 index a02a8e7c3..000000000 --- a/doc/english/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,28 +0,0 @@ -# Track AppLovin MAX ad revenue with Adjust SDK - -[Adjust iOS SDK README][ios-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.0** - -If you want to track your ad revenue with the AppLovin MAX SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method. - -> Note: If you have any questions about ad revenue tracking with AppLovin MAX, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com). - -### Example - -```objc -- (void)didPayRevenueForAd:(MAAd *)ad { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAppLovinMAX]; - - adjustAdRevenue.setRevenue(ad.revenue, "USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.networkName); - adjustAdRevenue.setAdRevenueUnit(ad.adUnitIdentifier); - adjustAdRevenue.setAdRevenuePlacement(ad.placement); - - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[ios-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/helium-chartboost.md b/doc/english/sdk-to-sdk/helium-chartboost.md deleted file mode 100644 index 4de8a6311..000000000 --- a/doc/english/sdk-to-sdk/helium-chartboost.md +++ /dev/null @@ -1,40 +0,0 @@ -# Track Helium Chartboost ad revenue with Adjust SDK - -[Adjust iOS SDK README][ios-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.7** - -If you want to track your ad revenue with the Helium SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method. - -> Note: If you have any questions about ad revenue tracking with Helium Chartboost, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com). - -### Example - -```objc -[NSNotificationCenter.defaultCenter addObserverForName:kHeliumDidReceiveILRDNotification - object:nil - queue:nil - usingBlock:^(NSNotification * _Nonnull notification) { - // extract the ILRD payload - HeliumImpressionData *ilrd = (HeliumImpressionData *)notification.object; - NSDictionary *json = ilrd.jsonData; - // mandatory fields - NSNumber *ad_revenue = [json objectForKey:@"ad_revenue"]; - NSString *currency_type = [json objectForKey:@"currency_type"]; - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceHeliumChartboost]; - [adjustAdRevenue setRevenue:[ad_revenue doubleValue] currency:currency_type]; - // optional fields - NSString *network_name = [json objectForKey:@"network_name"]; // Helium demand network name - NSString *placement_name = [json objectForKey:@"placement_name"]; // Helium placement name - NSString *line_item_name = [json objectForKey:@"line_item_name"]; // Helium line item name - [adjustAdRevenue setAdRevenueNetwork:network_name]; - [adjustAdRevenue setAdRevenueUnit:placement_name]; - [adjustAdRevenue setAdRevenuePlacement:line_item_name]; - // track Adjust ad revenue - [Adjust trackAdRevenue:adjustAdRevenue]; -} -``` - -[ios-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/ironsource.md b/doc/english/sdk-to-sdk/ironsource.md deleted file mode 100644 index e574bcc78..000000000 --- a/doc/english/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# Track ironSource ad revenue with Adjust SDK - -[Adjust iOS SDK README][ios-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.0** - -If you want to track your ad revenue with the ironSource SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method. - -> Note: If you have any questions about ad revenue tracking with ironSource, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com). - -### Example - -```objc -- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceIronSource]; - [adjustAdRevenue setRevenue:impressionData.revenue currency:@"USD"]; - // optional fields - [adjustAdRevenue setAdRevenueNetwork:impressionData.ad_network]; - [adjustAdRevenue setAdRevenueUnit:impressionData.ad_unit]; - [adjustAdRevenue setAdRevenuePlacement:impressionData.placement]; - // track Adjust ad revenue - [Adjust trackAdRevenue:adjustAdRevenue]; -} -``` - -[ios-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/mopub.md b/doc/english/sdk-to-sdk/mopub.md deleted file mode 100644 index 019ddcb16..000000000 --- a/doc/english/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,34 +0,0 @@ -## Track MoPub ad revenue with Adjust SDK - -[Adjust iOS SDK README][ios-readme] - -[MoPub iOS documentation][mopub-docs] - -Minimal SDK version required for this feature: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -In case you are showing **rewarded video ads**: Inside of your MoPub SDK `didTrackImpressionWithAdUnitID:impressionData:` method implementation, make sure to invoke `trackAdRevenue:payload:` method of Adjust SDK like this: - -```objc -- (void)didTrackImpressionWithAdUnitID:(NSString *)adUnitID - impressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -In case you are showing **other ad formats**: Inside of your MoPub SDK `mopubAd:didTrackImpressionWithImpressionData:` method implementation, make sure to invoke `trackAdRevenue:payload:` method of Adjust SDK like this: - -```objc -- (void)mopubAd:(id)ad didTrackImpressionWithImpressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -In case you have any questions about ad revenue tracking with MoPub, please contact your dedicated account manager or send an email to support@adjust.com. - -[mopub-docs]: https://developers.mopub.com/publishers/ios/impression-data/ -[ios-readme]: ../../../README.md diff --git a/doc/english/sdk-to-sdk/unity.md b/doc/english/sdk-to-sdk/unity.md deleted file mode 100644 index eb1e7e89f..000000000 --- a/doc/english/sdk-to-sdk/unity.md +++ /dev/null @@ -1,52 +0,0 @@ -# Track Unity ad revenue with Adjust SDK - -[Adjust iOS SDK README][ios-readme] - -Minimum SDK version required for this feature: - -- **Adjust SDK v4.29.7** - -If you want to track your ad revenue with the Unity SDK, you can use our SDK-to-SDK integration to pass this information to the Adjust backend. To do this, you will need to construct an Adjust ad revenue object containing the information you wish to record, then pass the object to the `trackAdRevenue` method. - -> Note: If you have any questions about ad revenue tracking with Unity, please contact your dedicated account manager or send an email to [support@adjust.com](mailto:support@adjust.com). - -For more information, see the Unity Mediation [API documentation](https://docs.unity.com/mediation/APIReferenceIOS.html) and [impression event documentation](https://docs.unity.com/mediation/SDKIntegrationIOSImpressionEvents.html). - -### Example - -```objc -@interface ViewController() - -@property(nonatomic, strong) UMSImpressionListenerWithBlocks * listener; - -@end - -@implementation ViewController - -- (void) viewDidLoad { - [super viewDidLoad]; - - self.listener = [[UMSImpressionListenerWithBlocks alloc] init]; - self.listener.onImpressionBlock = ^ (NSString *adUnitId, UMSImpressionData *impressionData) { - if (impressionData) { - NSLog(@ "impressionData: %@", [impressionData getJsonRepresentation]); - // send impression data to Adjust - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceUnity]; - adjustAdRevenue.setRevenue([impressionData.revenue doubleValue], impressionData.currency); - // optional fields - adjustAdRevenue.setAdRevenueNetwork(impressionData.adSourceName); - adjustAdRevenue.setAdRevenueUnit(impressionData.adUnitId); - adjustAdRevenue.setAdRevenuePlacement(impressionData.adSourceInstance); - // track Adjust ad revenue - Adjust.trackAdRevenue(adjustAdRevenue); - } else { - NSLog(@ "Data does not exist due to not enabling User-Level Reporting"); - } - }; - [UMSImpressionEventPublisher subscribe: self.listener]; -} - -@end -``` - -[ios-readme]: ../../../README.md diff --git a/doc/english/sociomantic_plugin.md b/doc/english/sociomantic_plugin.md deleted file mode 100644 index abb0c7b14..000000000 --- a/doc/english/sociomantic_plugin.md +++ /dev/null @@ -1,447 +0,0 @@ -## Sociomantic plugin - -Integrate adjust with Sociomantic events by following one of these methods: - -### CocoaPods - -If you're using [CocoaPods](http://cocoapods.org/), you can add the following line to your Podfile: - -```ruby -pod 'Adjust/Sociomantic' -``` - -### Carthage - -If you're using [Carthage](https://github.com/Carthage/Carthage), you can add following line to your Cartfile: - -```ruby -github "adjust/ios_sdk" "sociomantic" -``` - -### Source - -You can also integrate adjust with Sociomantic events by following these steps: - -1. Locate the `plugin/Sociomantic` folder inside the downloaded archive from our [releases page](https://github.com/adjust/ios_sdk/releases). - -2. Drag the `ADJSociomantic.h` and `ADJSociomantic.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`. - -### Sociomantic events - -You can now use Sociomantic events by following these steps: - -1. You now have access to the Sociomantic events methods as well as the constants you should use as the property names of your dictionaries: - - ```objc - NSString *const SCMCategory; - NSString *const SCMProductName; - NSString *const SCMSalePrice; - NSString *const SCMAmount; - NSString *const SCMCurrency; - NSString *const SCMProductURL; - NSString *const SCMProductImageURL; - NSString *const SCMBrand; - NSString *const SCMDescription; - NSString *const SCMTimestamp; - NSString *const SCMValidityTimestamp; - NSString *const SCMQuantity; - NSString *const SCMScore; - NSString *const SCMProductID; - NSString *const SCMAmount; - NSString *const SCMCurrency; - NSString *const SCMQuantity; - NSString *const SCMAmount; - NSString *const SCMCurrency; - NSString *const SCMActionConfirmed; - NSString *const SCMActionConfirmed; - NSString *const SCMCustomerAgeGroup; - NSString *const SCMCustomerEducation; - NSString *const SCMCustomerGender; - NSString *const SCMCustomerID; - NSString *const SCMCustomerMHash; - NSString *const SCMCustomerSegment; - NSString *const SCMCustomerTargeting; - ``` - -2. Before sending any Sociomantic you should set a partner ID as shown below: - - ```objc - #import "ADJSociomantic.h" - - [ADJSociomantic injectPartnerIdIntoSociomanticEvents:@"{sociomanticPartnerId}"]; - ``` - -3. Now you can integrate each of the different Sociomantic events, as in the following examples: - -#### Customer Event - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:ANY_TOKEN]; -NSDictionary *customerData = @{ - SCMCustomerID: @"123456" -}; - -[ADJSociomantic injectCustomerDataIntoEvent:event withData:customerData]; -[Adjust trackEvent:event]; -``` - -#### View Home Page - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:HOMEPAGE_TOKEN]; - -[ADJSociomantic injectHomePageIntoEvent:event]; -[Adjust trackEvent:event]; -``` - -#### View Listing - -```objc -#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 - -```objc -#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 for reporting product view* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter nameRequirementDescriptionNote
SCMCategoryRequired*Product category (entire category path)Category information provided in the tracking code on category or listing pages should match the category information provided in the feed or in the tracking code of product pages.
SCMProductNameRequired*Product nameSpecial characters should not be encoded but provided in proper UTF-8. Do not use any HTML markup.
SCMSalePriceRequired*Sale price as decimal value (e.g. 2.99)Please use a dot as a decimal separator and do not use any thousand separators.
SCMAmountRequired*Regular price as decimal value (e.g. 3.99)Please use a dot as a decimal separator and do not use any thousand separators.
SCMCurrencyRequired*Currency code in ISO 4217 format (e.g. EUR)Fixed currency code. Should have been provided to you in the tracking code examples.
SCMProductURL>Required*Product URL (deeplink)Please provide a working deeplink ideally without any click tracking parameter (Google Analytics, HURRA, Eulerian, etc.), Please always use deeplinks with http://
SCMProductImageURLRequired*Product image URLPlease provide images in a reasonable size. For an optimal appearance in the ads the images should be at least 200x200px and should have the same aspect ratio.
SCMBrandRequired*Product brandSpecial characters should not be encoded but provided in proper UTF-8 (Same as SCMProductName above). Do not use any HTML markup.
SCMDescriptionOptionalShort product descriptionSpecial characters should not be encoded but provided in proper UTF-8 (Same as SCMProductName above). Do not use any HTML markup.
SCMTimestampOptionalTimestamp until when the product is available (please use GMT time)Please provide the date a visitor has searched for. It should be an NSTimeInterval wrapped in NSNumber (see example).
SCMValidityTimestampOptionalTimestamp until when the product is available (please use GMT time)Please provide the unix timestamp until when the product is available. Please use 0 for products that are always available. It should be an NSTimeInterval wrapped in NSNumber (Same as SCMTimestamp above).
SCMQuantityOptionalNumber of products in stockPlease integrate this field only after discussion with your personal Sociomantic contact
SCMScoreOptionalPriority score of the product (value range is between 0 to 10.0)Please integrate this field only after discussion with your personal Sociomantic contact
- -\*optional, if provided in the feed - -If you’re not certain what setup you should use please contact your Technical Account Manager at Sociomantic. - -#### Cart - -```objc -#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 for reporting cart view* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter nameRequirementDescriptionNote
SCMProductIDRequiredProduct IDPlease provide the product ID without any subIDs for any color or size variations.
SCMAmountOptionalProduct price as decimal value (e.g. 2.99)Please use a dot as a decimal separator and do not use any thousand separators. Please only provide price per product, even if quantity has a value larger than 1.
SCMCurrencyOptionalCurrency code in ISO 4217 format (e.g. EUR)Fixed currency code. Should have been provided to you in the tracking code examples.
SCMQuantityOptionalQuantity of the product selectedPlease use an integer value.
- -#### Unconfirmed Transaction - -```objc -#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: - -```objc -#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 Transaction - -```objc -#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: - -```objc -#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 for reporting transaction view* - -See cart parameters - -*Available transaction parameters for reporting transaction views* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter nameRequirementDescriptionNote
SCMAmountOptionalProduct price as decimal value (e.g. 2.99)Please use a dot as a decimal separator and do not use any thousand separators. Please only provide price per product, even if quantity has a value larger than 1.
SCMCurrencyOptionalCurrency code in ISO 4217 format (e.g. EUR)Fixed currency code. Should have been provided to you in the tracking code examples.
SCMQuantityOptionalQuantity of the product selectedPlease use an integer value.
- -#### Lead Event - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:LEAD_TOKEN]; - -[ADJSociomantic injectLeadIntoEvent:event leadID:@"123456789"]; -[Adjust trackEvent:event]; -``` - -Or confirmed lead: - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:LEAD_TOKEN]; - -[ADJSociomantic injectLeadIntoEvent:event leadID:@"123456789" andConfirmed:YES]; -[Adjust trackEvent:event]; -``` diff --git a/doc/english/trademob_plugin.md b/doc/english/trademob_plugin.md deleted file mode 100644 index 20b7ad00e..000000000 --- a/doc/english/trademob_plugin.md +++ /dev/null @@ -1,102 +0,0 @@ -## Trademob plugin - -Integrate adjust with Trademob events by following one of these methods: - -### CocoaPods - -If you're using [CocoaPods](http://cocoapods.org/), you can add the following line to your Podfile: - -```ruby -pod 'Adjust/Trademob' -``` - -### Carthage - -If you're using [Carthage](https://github.com/Carthage/Carthage), you can add following line to your Cartfile: - -```ruby -github "adjust/ios_sdk" "trademob" -``` - -### Source - -You can also integrate adjust with Trademob events by following these steps: - -1. Locate the `plugin/Trademob` folder inside the downloaded archive from our [releases page](https://github.com/adjust/ios_sdk/releases). - -2. Drag the `ADJTrademob.h` and `ADJTrademob.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`. - -For questions regarding this plugin, please reach out to `eugenio.warglien@trademob.com` - -### Trademob events - -You can now use Trademob events in the following ways: - -#### View Listing - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"]; - -NSArray *itemIds = @[@"itemId1", @"itemId2", @"itemId3"]; - -NSDictionary *metadata = @{@"info1":@"value1", @"info2":@"value2"}; - -[ADJTrademob injectViewListingIntoEvent:event itemIds:itemIds metadata:metadata]; - -[Adjust trackEvent:event]; -``` - -#### View Item - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewItemEventToken}"]; - -NSDictionary *metadata = @{@"info1":@"value1", @"info2":@"value2"}; - -[ADJTrademob injectViewItemIntoEvent:event itemId:@"itemId" metadata:metadata]; - -[Adjust trackEvent:event]; -``` - -#### Add to Basket - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{addToBasketEventToken}"]; - -ADJTrademobItem *item1 = [[ADJTrademobItem alloc] initWithId:@"itemId1" price:120.4 quantity:1]; -ADJTrademobItem *item2 = [[ADJTrademobItem alloc] initWithId:@"itemId2" price:20.1 quantity:4]; - -NSArray *items = @[item1, item2]; - -[ADJTrademob injectAddToBasketIntoEvent:event items:items metadata:nil]; - -[Adjust trackEvent:event]; -``` - -#### Checkout - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{checkoutEventToken}"]; - -ADJTrademobItem *item1 = [[ADJTrademobItem alloc] initWithId:@"itemId1" price:120.4 quantity:1]; -ADJTrademobItem *item2 = [[ADJTrademobItem alloc] initWithId:@"itemId2" price:20.1 quantity:4]; - -NSArray *items = @[item1, item2]; - -NSDictionary *metadata = @{@"info1":@"value1", @"info2":@"value2"}; - -[ADJTrademob injectCheckoutIntoEvent:event items:items metadata:metadata]; - -[Adjust trackEvent:event]; -``` diff --git a/doc/english/web_view_migration.md b/doc/english/web_view_migration.md deleted file mode 100644 index 52d23bcc7..000000000 --- a/doc/english/web_view_migration.md +++ /dev/null @@ -1,42 +0,0 @@ -## Migrate your Adjust web bridge SDK to v4.18.2 or later from v4.18.1 or earlier - -Prior to v4.18.2, Adjust web bridge SDK contained methods to inject `UIWebView` objects. To address Apple's warning to developers (ITMS-90809) about `UIWebView` class deprecation, we have removed methods from our bridge which were working with `UIWebView` objects and left only methods which accept `WKWebView` objects. - -Removed methods from `AdjustBridge` class: - -```objc -- loadUIWebViewBridge: -- loadUIWebViewBridge:webViewDelegate: -``` - -Please, switch to usage of `WKWebView` in your app instead of `UIWebView` and use following methods instead: - -```objc -- loadWKWebViewBridge: -- loadWKWebViewBridge:webViewDelegate: -``` - -## Migrate your Adjust web bridge SDK to v4.18.1 from v4.9.1 or earlier - -### Integration - -Before, it was required to manualy drag-and-drop source files into your project to integrate the Adjust web view bridge. One of the main reasons to have to do this, was that we required the Javascript files from Adjust to be used on the view. Now that the Javascript files are injected into the view, it's possible to integrate the Adjust web bridge SDK by using either Cocoapods or Carthage. - -Whether you choose to keep the direct source files integration, or use Cocoapods/Carthage, you may remove the Adjust Javascript files you imported previously and their reference from your HTML file(s). - -### Adjust config - -The Adjust web bridge SDK is now accessing the bridge reference directly by name, so it's no longer necessary to pass -the bridge instance when creating the `AdjustConfig` object. So while previously you would do this: - -```js -var adjustConfig = new AdjustConfig(bridge, yourAppToken, environment); -``` - -Now you should do: - -```js -var adjustConfig = new AdjustConfig(yourAppToken, environment); -``` - -We are still detecting the previous API signature to be compatible, but you should change it when migrating. diff --git a/doc/english/web_views.md b/doc/english/web_views.md deleted file mode 100644 index 6fb33b912..000000000 --- a/doc/english/web_views.md +++ /dev/null @@ -1,836 +0,0 @@ -## Summary - -This is the guide to the iOS SDK of Adjust™ for iOS apps which are using web views. You can read more about Adjust™ at [adjust.com]. - -It provides a bridge from Javascript to native Objective-C calls (and vice versa) by using the [WebViewJavascriptBridge][web_view_js_bridge] plugin. This plugin is also licensed under `MIT License`. - -## Table of contents - -* [Example app](#example-app) -* [Basic integration](#basic-integration) - * [Add the SDK with the web bridge to your project](#sdk-add) - * [Add iOS frameworks](#sdk-frameworks) - * [Integrate the SDK into your app](#sdk-integrate) - * [Integrate AdjustBridge into your app](#bridge-integrate-app) - * [Integrate AdjustBridge into your web view](#bridge-integrate-web) - * [Basic setup](#basic-setup) - * [Adjust logging](#adjust-logging) - * [Build your app](#build-the-app) -* [Additional features](#additional-features) - * [Event tracking](#event-tracking) - * [Revenue tracking](#revenue-tracking) - * [Revenue deduplication](#revenue-deduplication) - * [Callback parameters](#callback-parameters) - * [Partner parameters](#partner-parameters) - * [Session parameters](#session-parameters) - * [Session callback parameters](#session-callback-parameters) - * [Session partner parameters](#session-partner-parameters) - * [Delay start](#delay-start) - * [Attribution callback](#attribution-callback) - * [Event and session callbacks](#event-session-callbacks) - * [Disable tracking](#disable-tracking) - * [Offline mode](#offline-mode) - * [Event buffering](#event-buffering) - * [GDPR right to be forgotten](#gdpr-forget-me) - * [Disable third-party sharing](#disable-third-party-sharing) - * [SDK signature](#sdk-signature) - * [Background tracking](#background-tracking) - * [Device IDs](#device-ids) - * [iOS Advertising Identifier](#di-idfa) - * [Adjust device identifier](#di-adid) - * [User attribution](#user-attribution) - * [Push token](#push-token) - * [Pre-installed trackers](#pre-installed-trackers) - * [Deep linking](#deeplinking) - * [Standard deep linking scenario](#deeplinking-standard) - * [Deep linking on iOS 8 and earlier](#deeplinking-setup-old) - * [Deep linking on iOS 9 and later](#deeplinking-setup-new) - * [Deferred deep linking scenario](#deeplinking-deferred) - * [Reattribution via deep links](#deeplinking-reattribution) -* [License](#license) - -## Example app - -In the repository, you can find an example [`iOS app with web view`][example-webview]. You can use this project to see how the Adjust SDK can be integrated. - -## Basic integration - -If you are migrating from the web bridge SDK v4.9.1 or previous, please follow [this migration guide](web_view_migration.md) when updating to this new version. - -We will describe the steps to integrate the Adjust SDK into your iOS project. We are going to assume that you are using Xcode for your iOS development. - -### Add the SDK with the web bridge to your project - -If you're using [CocoaPods][cocoapods], you can add the following line to your `Podfile` and continue from [this step](#sdk-integrate): - -```ruby -pod 'Adjust/WebBridge', '~> 4.31.0' -``` - ---- - -If you're using [Carthage][carthage], you can add following line to your `Cartfile` and continue from [this step](#sdk-frameworks): - -```ruby -github "adjust/ios_sdk" -``` - ---- - -You can also choose to integrate the Adjust SDK by adding it to your project as a framework. On the [releases page][releases] you can find the `AdjustSdkWebBridge.framework.zip` which contains dynamic framework. - -### Add iOS frameworks - -1. Select your project in the Project Navigator -2. In the left-hand side of the main view, select your target -3. In the `Build Phases` tab, expand the `Link Binary with Libraries` group -4. At the bottom of that section, select the `+` button -5. Select the `AdSupport.framework`, then the `Add` button -6. Repeat the same steps to add the `iAd.framework`, `CoreTelephony.framework` and `WebView.framework` -7. Change the `Status` of the frameworks to `Optional`. - -### Integrate the SDK into your app - -If you added the Adjust SDK via a Pod repository, you should use one of the following import statements in your app's source files: - -```objc -#import "AdjustBridge.h" -``` - ---- - -If you added the Adjust SDK as a static/dynamic framework or via Carthage, you should use the following import statement in your app's source files: - -```objc -#import -``` - -Next, we'll set up basic session tracking. - -### Integrate AdjustBridge into your app - -In the Project Navigator open the source file your View Controller. Add the `import` statement at the top of the file. In -the `viewDidLoad` or `viewWillAppear` method of your Web View Delegate add the following calls to `AdjustBridge`: - -```objc -#import "AdjustBridge.h" -// or #import - -- (void)viewWillAppear:(BOOL)animated { - WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - [self.adjustBridge loadWKWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; -} - -// ... -``` - -You also can make use of the WebViewJavascriptBridge library we include, by using the `bridgeRegister` property of the `AdjustBridge` instance. -The register/call handler interface is similar to what WebViewJavascriptBridge does for ObjC. See [the library documentation](https://github.com/marcuswestin/WebViewJavascriptBridge#usage) for how to use it. - -### Integrate AdjustBrige into your web view - -To use the Javascript bridge on your web view, it must be configured like the `WebViewJavascriptBridge` plugin [README][wvjsb_readme] is advising in section `4`. Include the following Javascript code to intialize the Adjust iOS web bridge: - -```js -function setupWebViewJavascriptBridge(callback) { - if (window.WebViewJavascriptBridge) { - return callback(WebViewJavascriptBridge); - } - - if (window.WVJBCallbacks) { - return window.WVJBCallbacks.push(callback); - } - - window.WVJBCallbacks = [callback]; - - var WVJBIframe = document.createElement('iframe'); - WVJBIframe.style.display = 'none'; - WVJBIframe.src = 'https://__bridge_loaded__'; - document.documentElement.appendChild(WVJBIframe); - - setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0) -} -``` - -Take notice that the line `WVJBIframe.src = 'https://__bridge_loaded__';` was changed in version 4.11.6 from `WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__';` due to a change in the `WebViewJavascriptBridge` plugin. - -### Basic setup - -In the same HTML file, initialise the Adjust SDK inside the `setupWebViewJavascriptBridge` callback: - -```js -setupWebViewJavascriptBridge(function(bridge) { - // ... - - var yourAppToken = yourAppToken; - var environment = AdjustConfig.EnvironmentSandbox; - var adjustConfig = new AdjustConfig(yourAppToken, environment); - - Adjust.appDidLaunch(adjustConfig); - - // ... -}); -``` - -**Note**: Initialising the Adjust SDK like this is `very important`. Otherwise, you may encounter different kinds of issues as described in our [troubleshooting section](#ts-delayed-init). - -Replace `yourAppToken` with your app token. You can find this in your [dashboard]. - -Depending on whether you build your app for testing or for production, you must set `environment` with one of these values: - -```js -var environment = AdjustConfig.EnvironmentSandbox; -var environment = AdjustConfig.EnvironmentProduction; -``` - -**Important:** This value should be set to `AdjustConfig.EnvironmentSandbox` if and only if you or someone else is testing your app. Make sure to set the environment to `AdjustConfig.EnvironmentProduction` just before you publish the app. Set it back to `AdjustConfig.EnvironmentSandbox` when you start developing and testing it again. - -We use this environment to distinguish between real traffic and test traffic from test devices. It is very important that you keep this value meaningful at all times! This is especially important if you are tracking revenue. - -### Adjust logging - -You can increase or decrease the amount of logs that you see during testing by calling `setLogLevel:` on your `ADJConfig` instance with one of the following parameters: - -```js -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose) // enable all logging -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug) // enable more logging -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo) // the default -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn) // disable info logging -adjustConfig.setLogLevel(AdjustConfig.LogLevelError) // disable warnings as well -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert) // disable errors as well -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress) // disable all logging -``` - -If you don't want your app in production to display any logs coming from the Adjust SDK, then you should select `AdjustConfig.LogLevelSuppress` and in addition to that, initialise `AdjustConfig` object with another constructor where you should enable suppress log level mode with `true` in the third parameter: - -```js -setupWebViewJavascriptBridge(function(bridge) { - // ... - - var yourAppToken = yourAppToken; - var environment = AdjustConfig.EnvironmentSandbox; - var adjustConfig = new AdjustConfig(yourAppToken, environment, true); - - Adjust.appDidLaunch(adjustConfig); - - // ... -}); -``` - -### Build your app - -Build and run your app. If the build succeeds, you should carefully read the SDK logs in the console. After the app launches -for the first time, you should see the info log `Install tracked`. - -## Additional features - -Once you integrate the Adjust SDK into your project, you can take advantage of the following features. - -### Event tracking - -You can use Adjust to track events. Let's say you want to track every tap on a particular button. You would create a new event token in your [dashboard], which has an associated event token - looking something like `abc123`. In your button's `onclick` method you would then add the following lines to track the tap: - -```js -var adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` - -When tapping the button you should now see `Event tracked` in the logs. - -The event instance can be used to configure the event even more before tracking it. - -### Revenue tracking - -If your users can generate revenue by tapping on advertisements or making in-app purchases you can track those revenues with events. Lets say a tap is worth one Euro cent. You could then track the revenue event like this: - -```js -var adjustEvent = new AdjustEvent(eventToken); -adjustEvent.setRevenue(0.01, 'EUR'); -Adjust.trackEvent(adjustEvent); -``` - -This can be combined with callback parameters of course. - -When you set a currency token, Adjust will automatically convert the incoming revenues into a reporting revenue of your choice. Read more about [currency conversion here.][currency-conversion] - -You can read more about revenue and event tracking in the [event tracking guide][event-tracking-guide]. - -### Revenue deduplication - -You can also pass in an optional transaction ID to avoid tracking duplicate revenues. The last ten transaction IDs are remembered and revenue events with duplicate transaction IDs are skipped. This is especially useful for in-app purchase tracking. - -If you have access to the transaction indentifier from the web view, you can pass it to the `setTransactionId` method on the Adjust event object. That way you can avoid tracking revenue that is not actually being generated. - -```js -var adjustEvent = new AdjustEvent(eventToken); -adjustEvent.setTransactionId(transactionIdentifier); -Adjust.trackEvent(adjustEvent); -``` - -### Callback parameters - -You can register a callback URL for your events in your [dashboard]. We will send a GET request to that URL whenever the event gets tracked. You can add callback parameters to that event by calling `addCallbackParameter` on the event before tracking it. We will then append these parameters to your callback URL. - -For example, suppose you have registered the URL `http://www.adjust.com/callback` then track an event like this: - -```js -var adjustEvent = new AdjustEvent(eventToken); -adjustEvent.addCallbackParameter('key', 'value'); -adjustEvent.addCallbackParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` - -In that case we would track the event and send a request to: - - http://www.adjust.com/callback?key=value&foo=bar - -It should be mentioned that we support a variety of placeholders like `{idfa}` that can be used as parameter values. In the resulting callback this placeholder would be replaced with the ID for Advertisers of the current device. Also note that we don't store any of your custom parameters, but only append them to your callbacks. If you haven't registered a callback for an event, these parameters won't even be read. - -You can read more about using URL callbacks, including a full list of available values, in our [callbacks guide][callbacks-guide]. - -### Partner parameters - -You can also add parameters to be transmitted to network partners, for the integrations that have been activated in your Adjust dashboard. - -This works similarly to the callback parameters mentioned above, but can be added by calling the `addPartnerParameter` method on your `AdjustEvent` instance. - -```js -var adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addPartnerParameter('key', 'value'); -adjustEvent.addPartnerParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` - -You can read more about special partners and these integrations in our [guide to special partners][special-partners]. - -### Session parameters - -Some parameters are saved to be sent in every event and session of the Adjust SDK. Once you have added any of these parameters, you don't need to add them every time, since they will be saved locally. If you add the same parameter twice, there will be no effect. - -If you want to send session parameters with the initial install event, they must be called before the Adjust SDK launches via `Adjust.appDidLaunch()`. If you need to send them with an install, but can only obtain the needed values after launch, it's possible to [delay](#delay-start) the first launch of the Adjust SDK to allow this behavior. - -### Session callback parameters - -The same callback parameters that are registered for [events](#callback-parameters) can be also saved to be sent in every event or session of the Adjust SDK. - -The session callback parameters have a similar interface of the event callback parameters. Instead of adding the key and it's value to an event, it's added through a call to `Adjust` method `addSessionCallbackParameter(key,value)`: - -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` - -The session callback parameters will be merged with the callback parameters added to an event. The callback parameters added to an event have precedence over the session callback parameters. Meaning that, when adding a callback parameter to an event with the same key to one added from the session, the value that prevails is the callback parameter added to the event. - -It's possible to remove a specific session callback parameter by passing the desiring key to the method `removeSessionCallbackParameter`. - -```js -Adjust.removeSessionCallbackParameter('foo'); -``` - -If you wish to remove all key and values from the session callback parameters, you can reset it with the method `resetSessionCallbackParameters`. - -```js -Adjust.resetSessionCallbackParameters(); -``` - -### Session partner parameters - -In the same way that there is [session callback parameters](#session-callback-parameters) that are sent every in event or session of the Adjust SDK, there is also session partner parameters. - -These will be transmitted to network partners, for the integrations that have been activated in your Adjust [dashboard]. - -The session partner parameters have a similar interface to the event partner parameters. Instead of adding the key and it's value to an event, it's added through a call to `Adjust` method `addSessionPartnerParameter:value:`: - -```js -Adjust.addSessionPartnerParameter('foo','bar'); -``` - -The session partner parameters will be merged with the partner parameters added to an event. The partner parameters added to an event have precedence over the session partner parameters. Meaning that, when adding a partner parameter to an event with the same key to one added from the session, the value that prevails is the partner parameter added to the event. - -It's possible to remove a specific session partner parameter by passing the desiring key to the method `removeSessionPartnerParameter`. - -```js -Adjust.removeSessionPartnerParameter('foo'); -``` - -If you wish to remove all key and values from the session partner parameters, you can reset it with the method `resetSessionPartnerParameters`. - -```js -Adjust.resetSessionPartnerParameters(); -``` - -### Delay start - -Delaying the start of the Adjust SDK allows your app some time to obtain session parameters, such as unique identifiers, to be send on install. - -Set the initial delay time in seconds with the method `setDelayStart` in the `AdjustConfig` instance: - -```js -adjustConfig.setDelayStart(5.5); -``` - -In this case this will make the Adjust SDK not send the initial install session and any event created for 5.5 seconds. After this time is expired or if you call `Adjust.sendFirstPackages()` in the meanwhile, every session parameter will be added to the delayed install session and events and the Adjust SDK will resume as usual. - -**The maximum delay start time of the Adjust SDK is 10 seconds**. - -### Attribution callback - -You can register a callback method to be notified of attribution changes. Due to the different sources considered for attribution, this information cannot by provided synchronously. - -Please make sure to consider our [applicable attribution data policies][attribution-data]. - -As the callback method is configured using the `AdjustConfig` instance, you should call `setAttributionCallback` before calling `Adjust.appDidLaunch(adjustConfig)`. - -```js -adjustConfig.setAttributionCallback(function(attribution) { - // In this example, we're just displaying alert with attribution content. - alert('Tracker token = ' + attribution.trackerToken + '\n' + - 'Tracker name = ' + attribution.trackerName + '\n' + - 'Network = ' + attribution.network + '\n' + - 'Campaign = ' + attribution.campaign + '\n' + - 'Adgroup = ' + attribution.adgroup + '\n' + - 'Creative = ' + attribution.creative + '\n' + - 'Click label = ' + attribution.clickLabel + '\n' + - 'Adid = ' + attribution.adid); -}); -``` - -The callback method will get triggered when the SDK receives final attribution data. Within the callback you have access to the `attribution` parameter. Here is a quick summary of its properties: - -- `var trackerToken` the tracker token of the current install. -- `var trackerName` the tracker name of the current install. -- `var network` the network grouping level of the current install. -- `var campaign` the campaign grouping level of the current install. -- `var adgroup` the ad group grouping level of the current install. -- `var creative` the creative grouping level of the current install. -- `var clickLabel` the click label of the current install. -- `var adid` the unique device identifier provided by attribution. - -If any value is unavailable, it will not be part of the of the attribution object. - -### Event and session callbacks - -You can register a callback to be notified when events or sessions are tracked. There are four callbacks: one for tracking successful events, one for tracking failed events, one for tracking successful sessions and one for tracking failed sessions. - -Follow these steps and implement the following callback methods to track successful events: - -```js -adjustConfig.setEventSuccessCallback(function(eventSuccess) { - // ... -}); -``` - -The following delegate callback function to track failed events: - -```js -adjustConfig.setEventFailureCallback(function(eventFailure) { - // ... -}); -``` - -To track successful sessions: - -```js -adjustConfig.setSessionSuccessCallback(function(sessionSuccess) { - // ... -}); -``` - -And to track failed sessions: - -```js -adjustConfig.setSessionFailureCallback(function(sessionFailure) { - // ... -}); -``` - -The callback methods will be called after the SDK tries to send a package to the server. Within the callback methods you have access to a response data object specifically for that callback. Here is a quick summary of the session response data properties: - -- `var message` the message from the server or the error logged by the SDK. -- `var timeStamp` timestamp from the server. -- `var adid` a unique device identifier provided by Adjust. -- `var jsonResponse` the JSON object with the response from the server. - -Both event response data objects contain: - -- `var eventToken` the event token, if the package tracked was an event. - -And both event and session failed objects also contain: - -- `var willRetry` indicates there will be an attempt to resend the package at a later time. - -### Disable tracking - -You can disable the Adjust SDK from tracking any activities of the current device by calling `setEnabled` with parameter `false`. **This setting is remembered between sessions**. - -```js -Adjust.setEnabled(false); -``` - -You can check if the Adjust SDK is currently enabled by calling the function `isEnabled`. - -```js -Adjust.isEnabled(function(isEnabled) { - if (isEnabled) { - // SDK is enabled. - } else { - // SDK is disabled. - } -}); -``` - -It is always possible to activate the Adjust SDK by invoking `setEnabled` with the enabled parameter as `true`. - -### Offline mode - -You can put the Adjust SDK in offline mode to suspend transmission to our servers while retaining tracked data to be sent later. While in offline mode, all information is saved in a file, so be careful not to trigger too many events while in offline mode. - -You can activate offline mode by calling `setOfflineMode` with the parameter `true`. - -```js -Adjust.setOfflineMode(true); -``` - -Conversely, you can deactivate offline mode by calling `setOfflineMode` with `false`. When the Adjust SDK is put back in online mode, all saved information is send to our servers with the correct time information. - -Unlike disabling tracking, this setting is **not remembered bettween sessions**. This means that the SDK is in online mode whenever it is started, even if the app was terminated in offline mode. - -### Event buffering - -If your app makes heavy use of event tracking, you might want to delay some network requests in order to send them in one batch every minute. You can enable event buffering with your `AdjustConfig` instance: - -```js -adjustConfig.setEventBufferingEnabled(true); -``` - -### GDPR right to be forgotten - -In accordance with article 17 of the EU's General Data Protection Regulation (GDPR), you can notify Adjust when a user has exercised their right to be forgotten. Calling the following method will instruct the Adjust SDK to communicate the user's choice to be forgotten to the Adjust backend: - -```js -Adjust.gdprForgetMe(); -``` - -Upon receiving this information, Adjust will erase the user's data and the Adjust SDK will stop tracking the user. No requests from this device will be sent to Adjust in the future. - - -### Disable third-party sharing - -You can now notify Adjust when a user has exercised their right to stop sharing their data with partners for marketing partners, but has allowed it to be shared for statistics purposes. - -Call the following method to instruct the Adjust SDK to communicate the user's choice to disable data sharing to the Adjust backend: - -```js -Adjust.disableThirdPartySharing(); -``` - -Upon receiving this information, Adjust will block the sharing of that specific user's data to partners and the Adjust SDK will continue to work as usual. - -### SDK signature - -The Adjust SDK signature is enabled on a client-by-client basis. If you are interested in using this feature, please contact your account manager. - -If the SDK signature has already been enabled on your account and you have access to App Secrets in your Adjust Dashboard, please use the method below to integrate the SDK signature into your app. - -An App Secret is set by calling `setAppSecret` on your `AdjustConfig` instance: - -```js -adjustConfig.setAppSecret(secretId, info1, info2, info3, info4); -``` - -### Background tracking - -The default behaviour of the Adjust SDK is to pause sending network requests while the app is in the background. You can change this behaviour in your `AdjustConfig` instance: - -```js -adjustConfig.setSendInBackground(true); -``` - -If nothing is set, sending in background is **disabled by default**. - -### Device IDs - -The Adjust SDK offers you possibility to obtain some of the device identifiers. - -### iOS Advertising Identifier - -Certain services (such as Google Analytics) require you to coordinate device and client IDs in order to prevent duplicate reporting. - -To obtain the device identifier IDFA, call the function `getIdfa`: - -```js -Adjust.getIdfa(function(idfa) { - // ... -}); -``` - -### Adjust device identifier - -For each device with your app installed, Adjust backend generates unique **adjust device identifier** (**adid**). In order to obtain this identifier, you can make a call to the following method on the `Adjust` instance: - -```js -var adid = Adjust.getAdid(); -``` - -**Note**: Information about the **adid** is available after the app's installation has been tracked by the Adjust backend. From that moment on, the Adjust SDK has information about the device **adid** and you can access it with this method. So, **it is not possible** to access the **adid** before the SDK has been initialised and the installation of your app has been tracked successfully. - -### User attribution - -The attribution callback will be triggered as described in the [attribution callback section](#attribution-callback), providing you with the information about any new attribution when ever it changes. In any other case, where you want to access information about your user's current attribution, you can make a call to the following method of the `Adjust` object: - -```js -var attribution = Adjust.getAttribution(); -``` - -**Note**: Information about current attribution is available after app installation has been tracked by the Adjust backend and attribution callback has been initially triggered. From that moment on, Adjust SDK has information about your user's attribution and you can access it with this method. So, **it is not possible** to access user's attribution value before the SDK has been initialised and attribution callback has been initially triggered. - -### Push token - -Push tokens are used for Audience Builder and client callbacks, and they are required for uninstall and reinstall tracking. - -To send us the push notification token, add the following call to `Adjust` in the `didRegisterForRemoteNotificationsWithDeviceToken` of your app delegate: - -```objc -#import "Adjust.h" -// or #import - -- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [Adjust setDeviceToken:deviceToken]; -} -``` - -Or, if you have access to the push token from the web view, you can instead call the `setDeviceToken` method in the `Adjust` object in Javascript: - -```js -Adjust.setDeviceToken(deviceToken); -``` - -### Pre-installed trackers - -If you want to use the Adjust SDK to recognize users that found your app pre-installed on their device, follow these steps. - -1. Create a new tracker in your [dashboard]. -2. Open your app delegate and add set the default tracker of your `AdjustConfig` instance: - - ```js - adjustConfig.setDefaultTracker(trackerToken); - ``` - - Replace `trackerToken` with the tracker token you created in step 2. Please note that the dashboard displays a tracker - URL (including `http://app.adjust.com/`). In your source code, you should specify only the six-character token and not - the entire URL. - -### Deep linking - -If you are using the Adjust tracker URL with an option to deep link into your app from the URL, there is the possibility to get info about the deep link URL and its content. Hitting the URL can happen when the user has your app already installed (standard deep linking scenario) or if they don't have the app on their device (deferred deep linking scenario). Both of these scenarios are supported by the Adjust SDK and in both cases the deep link URL will be provided to you after you app has been started after hitting the tracker URL. In order to use this feature in your app, you need to set it up properly. - -### Standard deep linking scenario - -If your user already has the app installed and hits the tracker URL with deep link information in it, your application will be opened and the content of the deep link will be sent to your app so that you can parse it and decide what to do next. With introduction of iOS 9, Apple has changed the way how deep linking should be handled in the app. Depending on which scenario you want to use for your app (or if you want to use them both to support wide range of devices), you need to set up your app to handle one or both of the following scenarios. - -### Deep linking on iOS 8 and earlier - -Deep linking on iOS 8 and earlier devices is being done with usage of a custom URL scheme setting. You need to pick a custom URL scheme name which your app will be in charge for opening. This scheme name will also be used in the Adjust tracker URL as part of the `deep_link` parameter. In order to set this in your app, open your `Info.plist` file and add new `URL types` row to it. In there, as `URL identifier` write you app's bundle ID and under `URL schemes` add scheme name(s) which you want your app to handle. In the example below, we have chosen that our app should handle the `adjustExample` scheme name. - -![][custom-url-scheme] - -After this has been set up, your app will be opened after you click the Adjust tracker URL with `deep_link` parameter which contains the scheme name which you have chosen. After app is opened, `openURL` method of your `AppDelegate` class will be triggered and the place where the content of the `deep_link` parameter from the tracker URL will be delivered. If you want to access the content of the deep link, override this method. - -```objc -#import "Adjust.h" -// or #import - -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - // url object contains your deep link content - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -With this setup, you have successfully set up deep linking handling for iOS devices with iOS 8 and earlier versions. - -### Deep linking on iOS 9 and later - -In order to set deep linking support for iOS 9 and later devices, you need to enable your app to handle Apple universal links. To find out more about universal links and how their setup looks like, you can check [here][universal-links]. - -Adjust is taking care of lots of things to do with universal links behind the scenes. But, in order to support universal links with the Adjust, you need to perform small setup for universal links in the Adjust dashboard. For more information on that should be done, please consult our official [docs][universal-links-guide]. - -Once you have successfully enabled the universal links feature in the dashboard, you need to do this in your app as well: - -After enabling `Associated Domains` for your app in Apple Developer Portal, you need to do the same thing in your app's Xcode project. After enabling `Assciated Domains`, add the universal link which was generated for you in the Adjust dashboard in the `Domains` section by prefixing it with `applinks:` and make sure that you also remove the `http(s)` part of the universal link. - -![][associated-domains-applinks] - -After this has been set up, your app will be opened after you click the Adjust tracker universal link. After app is opened, `continueUserActivity` method of your `AppDelegate` class will be triggered and the place where the content of the universal link URL will be delivered. If you want to access the content of the deep link, override this method. - -``` objc -#import "Adjust.h" -// or #import - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - // url object contains your universal link content - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -With this setup, you have successfully set up deep linking handling for iOS devices with iOS 9 and later versions. - -We provide a helper function that allows you to convert a universal link to an old style deep link URL, in case you had some custom logic in your code which was always expecting deep link info to arrive in old style custom URL scheme format. You can call this method with universal link and the custom URL scheme name which you would like to see your deep link prefixed with and we will generate the custom URL scheme deep link for you: - -``` objc -#import "Adjust.h" -// or #import - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### Deferred deep linking scenario - -You can register a callback to be notified before a deferred deep link is opened. You can configure the callback on the `AdjustConfig` instance: - -```js -adjustConfig.setDeferredDeeplinkCallback(function(deferredDeeplink) { - // ... -}); -``` -The callback function will be called after the SDK receives a deffered deep link from our server and before opening it. - -If this callback is not implemented, **the Adjust SDK will always try to open the deep link by default**. - -With another setting on the `AdjustConfig` instance, you have the possibility to decide whether the Adjust SDK will open this deeplink or not. You could, for example, not allow the SDK to open the deep link at the current moment, save it, and open it yourself later. You can do this by calling the `setOpenDeferredDeeplink` method: - -```js -// Default setting. The SDK will open the deeplink after the deferred deeplink callback -adjustConfig.setOpenDeferredDeeplink(true); - -// Or if you don't want our SDK to open the deeplink: -adjustConfig.setOpenDeferredDeeplink(false); -``` - -### Reattribution via deep links - -Adjust enables you to run re-engagement campaigns with usage of deep links. For more information on how to do that, please check our [official docs][reattribution-with-deeplinks]. - -If you are using this feature, in order for your user to be properly reattributed, you need to make one additional call to the Adjust SDK in your app. - -Once you have received deep link content information in your app, add a call to the `appWillOpenUrl` method. By making this call, the Adjust SDK will try to find if there is any new attribution info inside of the deep link and if any, it will be sent to the Adjust backend. If your user should be reattributed due to a click on the Adjust tracker URL with deep link content in it, you will see the [attribution callback](#attribution-callback) in your app being triggered with new attribution info for this user. - -The call to `appWillOpenUrl` should be done like this to support deep linking reattributions in all iOS versions: - -```objc -#import "Adjust.h" -// or #import - -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - // url object contains your deep link content - - [Adjust appWillOpenUrl:url]; - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -``` objc -#import "Adjust.h" -// or #import - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL url = [userActivity webpageURL]; - - [Adjust appWillOpenUrl:url]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -If you have access to the deeplink url in the web view, you can call the `appWillOpenUrl` method from the `Adjust` object from Javascript: - -```js -Adjust.appWillOpenUrl(deeplinkUrl); -``` - - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[releases]: https://github.com/adjust/ios_sdk/releases -[carthage]: https://github.com/Carthage/Carthage -[cocoapods]: http://cocoapods.org - -[wvjsb_readme]: https://github.com/marcuswestin/WebViewJavascriptBridge#usage -[ios_sdk_ulinks]: https://github.com/adjust/ios_sdk/#universal-links -[example-webview]: https://github.com/adjust/ios_sdk/tree/master/examples/AdjustExample-WebView -[callbacks-guide]: https://docs.adjust.com/en/callbacks -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[special-partners]: https://docs.adjust.com/en/special-partners -[basic_integration]: https://github.com/adjust/ios_sdk/#basic-integration -[web_view_js_bridge]: https://github.com/marcuswestin/WebViewJavascriptBridge -[currency-conversion]: https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies -[event-tracking-guide]: https://docs.adjust.com/en/event-tracking/#reference-tracking-purchases-and-revenues -[reattribution-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link - -[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png -[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png - -## License - -The Adjust SDK is licensed under the MIT License. - -Copyright (c) 2012-2018 Adjust GmbH, http://www.adjust.com - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/doc/japanese/README.md b/doc/japanese/README.md deleted file mode 100644 index 5b3ba366a..000000000 --- a/doc/japanese/README.md +++ /dev/null @@ -1,1361 +0,0 @@ -**このガイドはまもなく廃止されます。** - -このREADMEファイルはまもなく廃止されます。SDKのドキュメントはAdjustヘルプセンターに掲載されています。以下のリンクよりご覧ください。 - -* [English][en-helpcenter] -* [中文][zh-helpcenter] -* [日本語][ja-helpcenter] -* [한국어][ko-helpcenter] - -## 概要 - -これはネイティブAdjust™iOS SDKガイドです。Adjust™については[adjust.com]をご覧ください。 - -Web viewを使用するアプリで、JavaScriptコードから計測する場合は、[iOS Web view SDKガイド][ios-web-views-guide]をご覧ください。 - -Read this in other languages: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## 目次 - -* [サンプルアプリ](#example-apps) -* [基本的な導入方法](#basic-integration) - * [プロジェクトにSDKを追加](#sdk-add) - * [iOS frameworksを追加](#sdk-frameworks) - * [アプリにSDKを実装](#sdk-integrate) - * [基本設定](#basic-setup) - * [iMessage固有の設定](#basic-setup-imessage) - * [Adjustログ](#adjust-logging) - * [アプリのビルド](#build-the-app) -* [追加機能](#additional-features) - * [AppTrackingTransparency framework](#att-framework) - * [アプリトラッキング承認ラッパー](#ata-wrapper) - * [現在の承認ステータスを取得](#ata-getter) - * [SKAdNetwork frameworks](#skadn-framework) - * [SKAdNetworkのconversion valueを更新](#skadn-update-conversion-value) - * [Conversion value更新コールバック](#skadn-cv-updated-callback) - * [イベントトラッキング](#event-tracking) - * [収益のトラッキング](#revenue-tracking) - * [収益の重複排除](#revenue-deduplication) - * [アプリ内課金の検証](#iap-verification) - * [コールバックパラメーター](#callback-parameters) - * [パートナーパラメーター](#partner-parameters) - * [コールバックID](#callback-id) - * [セッションパラメーター](#session-parameters) - * [セッションコールバックパラメーター](#session-callback-parameters) - * [セッションパートナーパラメーター](#session-partner-parameters) - * [ディレイスタート](#delay-start) - * [アトリビューションコールバック](#attribution-callback) - * [広告収益のトラッキング](#ad-revenue) - * [サブスクリプショントラッキング](#subscriptions) - * [イベントとセッションのコールバック](#event-session-callbacks) - * [トラッキングの無効化](#disable-tracking) - * [オフラインモード](#offline-mode) - * [イベントバッファリング](#event-buffering) - * [GDPRの忘れられる権利](#gdpr-forget-me) - * [サードパーティーとの共有](#third-party-sharing) - * [サードパーティーとの共有を無効にする](#disable-third-party-sharing) - * [サードパーティーとの共有を有効にする](#enable-third-party-sharing) - * [ユーザー同意による計測](#measurement-consent) - * [SDKシグネチャー](#sdk-signature) - * [バックグラウンドでのトラッキング](#background-tracking) - * [デバイスID](#device-ids) - * [iOS広告ID](#di-idfa) - * [AdjustデバイスID](#di-adid) - * [ユーザーアトリビューション](#user-attribution) - * [Pushトークン](#push-token) - * [プリインストールトラッカー](#pre-installed-trackers) - * [ディープリンク](#deeplinking) - * [スタンダードディープリンク](#deeplinking-standard) - * [iOS 8以前でのディープリンク](#deeplinking-setup-old) - * [iOS 9およびそれ以降のバージョンでのディープリンク](#deeplinking-setup-old) - * [ディファードディープリンク](#deeplinking-deferred) - * [ディープリンクを介したリアトリビューション](#deeplinking-reattribution) - * [リンクのresolution](#link-resolution) - * [[ベータ版]データレジデンシー](#data-residency) -* [トラブルシューティング](#troubleshooting) - * [SDK初期化時の問題](#ts-delayed-init) - * ["Adjust requires ARC"というエラーが表示される](#ts-arc) - * ["\[UIDevice adjTrackingEnabled\]: unrecognized selector sent to instance”というエラーが表示される](#ts-categories) - * ["Session failed (Ignoring too frequent session.)"というエラーが表示される](#ts-session-failed) - * [ログに"Install tracked"が表示されない](#ts-install-tracked) - * ["Unattributable SDK click ignored"というメッセージが表示される](#ts-iad-sdk-click) - * [Adjustダッシュボード上に表示される収益データが間違っている](#ts-wrong-revenue-amount) -* [ライセンス](#license) - -## サンプルアプリ - -[`iOS (Objective-C)`][example-ios-objc]と [`iOS (Swift)`][example-ios-swift]、 [`tvOS`][example-tvos]、 [`iMessage`][example-imessage]、[`Apple Watch`][example-iwatch]のサンプルアプリが[`examples` directory][examples]ディレクトリーにあります。このXcodeプロジェクトを開けば、Adjust SDKの実装方法の実例をご確認いただけます。 - -## 基本的な導入方法 - -Adjust SDKをiOSプロジェクトに導入する手順を説明します。Xcodeの使用を想定した説明となります。 - -### SDKをプロジェクトに追加 - -[CocoaPods][cocoapods]を使用している場合は、Podfile`に下記のコードを追加し、[こちらの手順](#sdk-integrate)に進んでください。 - -```ruby -pod 'Adjust', '~> 4.31.0' -``` - -または - -```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.31.0' -``` - ---- - -[Carthage][carthage]をご利用の場合は、Cartfile`に下記のコードを追加して[こちらの手順](#sdk-frameworks)に進んでください。 - -```ruby -github "adjust/ios_sdk" -``` - ---- - -Swift Package Managerを使用している場合は、Xcodeで `File > Swift Packages > Add Package Dependency` に移動し、レポジトリアドレスを直接追加できます。その後、[この手順](#sdk-frameworks)から次に進みます。 - -``` -https://github.com/adjust/ios_sdk -``` - ---- - -Adjust SDKはフレームワークとしてプロジェクトに追加することもできます。[リリースページ][releases]には、次のアーカイブがあります。 - -* `AdjustSdkStatic.framework.zip` -* `AdjustSdkDynamic.framework.zip` -* `AdjustSdkTv.framework.zip` -* `AdjustSdkIm.framework.zip` - -iOS 8リリース以降、Appleはdynamic frameworks(embedded frameworks)を導入しています。iOS 8以降の端末をターゲットにしている場合は、Adjustの SDK dynamic frameworksを使用することができます。StaticかDynamic frameworksを選択し、プロジェクトに追加してください。 - -``tvOS` アプリの場合もAdjustSDKの利用が可能です。AdjustSdkTv.framework.zip` アーカイブからAdjustのtvOS frameworkを展開してください。 - -同様に`iMessage`アプリの場合もAdjustSDKの利用が可能です。`AdjustSdkIm.framework.zip` アーカイブからIM frameworkを展開してください。 - -### iOS frameworksを追加 - -iOS frameworksに対応したAdjust SDKの機能を利用する際は、以下のframeworkをXcodeに追加してください。 - -- `AdSupport.framework` - SDKがIDFA値および(iOS 14より前の)LAT(Limited Ad Tracking)情報を呼び出します。 -- `iAd.framework` - SDKが実行中のASAキャンペーンのアトリビューションを自動的に処理できるようにします。 -- `AdServices.framework` - iOS 14.3以降を実行するデバイスの場合、SDKがASAキャンペーンのアトリビューションを自動的に処理できるようになります。Apple Ads Attribution APIを利用する際に必要です。 -- `CoreTelephony.framework`- SDKが現在のRadio Access Technology(無線アクセス技術)を判別します。 -- `StoreKit.framework`- iOS 14またはそれ以降において、このframeworkは` SKAdNetwork` のframeworkにアクセスし、「SKAdNetwork」との通信をAdjust SDKで自動的に処理します。 -- `AppTrackingTransparency.framework` -iOS 14またはそれ以降において、このframeworkはSDKがトラッキングに対するユーザー同意を確認するダイアログをラップし、ユーザーの許諾状況を示す値にアクセスします。 - -### アプリにSDKを実装 - -PodリポジトリからAdjust SDKを追加した場合は、次のimport statement(インポートステートメント)のいずれかを使用します。 - -```objc -#import "Adjust.h" -``` - -または - -```objc -#import -``` - ---- - -Adjust SDKを静的/動的フレームワークとして追加した場合、またはCarthageを使う場合は、次のインポートステートメントを使用します: - -```objc -#import -``` - ---- - -tvOSアプリケーションでAdjust SDKを使用している場合は、次のインポートステートメントを使用します: - -```objc -#import -``` - ---- - -iMessageアプリケーションでAdjust SDKを使用している場合は、次のインポートステートメントを使用します: - -```objc -#import -``` - -次に、インストール計測に必要な基本設定を説明します。 - -### 基本設定 - -Project Navigator上で、アプリケーションデリゲートのソースファイルを開いてください。ファイルの先頭に`import` の記述を追加し、`didFinishLaunching`か`didFinishLaunchingWithOptions`のメソッド中に下記の`Adjust`コールを追加してください。 - -```objc -#import "Adjust.h" -// or #import -// or #import -// or #import -// or #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -![][delegate] - -**注意**:Adjust SDKの初期化は最も重要なプロセスです。問題が発生した際は[トラブルシューティングのセクション](#ts-delayed-init)をご確認ください。 - -`{YourAppToken}`をアプリトークンに差し替えてください。トークンは[管理画面]で確認できます。 - -テストと本番に合わせて2種類の`environment`をご利用いただけます: - -```objc -NSString *environment = ADJEnvironmentSandbox; -NSString *environment = ADJEnvironmentProduction; -``` - -**重要:** 開発段階のインストールテストでは`ADJEnvironmentSandbox`をご利用ください。アプリのリリース前に`ADJEnvironmentProduction`に変更してください。 - -Sandbox環境で計測された数値はSandboxレポートに表示されます。Production環境で計測された数値は本番レポートに表示されます。テスト数値と実際のトラフィックが混ざらないよう、環境設定の記述を切り替えてご利用ください。 - -### iMessage固有の設定 - -**ソースからSDKを追加する:Adjust SDKをiMessageアプリケーション**にソース**から追加する場合、プリプロセッサマクロ(pre-processor macro)**ADJUST_IM=1**がiMessageプロジェクトで設定されていることを確認してください。 - -**SDKをフレームワークとして追加する:** iMessageアプリケーションに`AdjustSdkIm.framework`を追加した後、`Build Phases`プロジェクト設定で`New Copy Files Phase`を追加します。AdjustSdkIm.framework`をFrameworks`フォルダにコピーするを選択してください。 - -**セッショントラッキング:** セッショントラッキングをiMessageアプリで正しく機能させるためには、追加の実装ステップを1回実行します。標準のiOSアプリでは、Adjust SDKはiOSシステム通知に自動的に登録され、アプリがいつ入力されたか、フォアグラウンドになったかを知ることができます。これはiMessageアプリの場合には該当しないため、iMessageアプリビューコントローラの`trackSubsessionStart`メソッドと`trackSubsessionEnd`メソッドへの明示的な呼び出しを追加する必要があります。これにより、アプリがフォアグラウンドあるかどうかをSDKに認識させることができます。 - -`didBecomeActiveWithConversation`のメソッド中に`trackSubsessionStart`を追加します。 - -```objc --(void)didBecomeActiveWithConversation:(MSConversation *)conversation { - // Called when the extension is about to move from the inactive to active state. - // This will happen when the extension is about to present UI. - // Use this method to configure the extension and restore previously stored state. - - [Adjust trackSubsessionStart]; -} -``` - -Add call to `trackSubsessionEnd` inside of `willResignActiveWithConversation:` method: - -```objc --(void)willResignActiveWithConversation:(MSConversation *)conversation { - // Called when the extension is about to move from the active to inactive state. - // This will happen when the user dissmises the extension, changes to a different - // conversation or quits Messages. - - // Use this method to release shared resources, save user data, invalidate timers, - // and store enough state information to restore your extension to its current state - // in case it is terminated later. - - [Adjust trackSubsessionEnd]; -} -``` - -このセットを使用すると、Adjust SDKはiMessageアプリ内でセッションのトラッキングを正常に行うことができます。 - -**注意:** 書き込んだiOSアプリとiMessageの拡張機能は、異なるメモリ空間で動作しており、バンドルIDも異なります。2つの場所で同じアプリトークンを使用してAdjust SDKを初期化すると、相互が認識しない2つの独立したインスタンスが生成され、ダッシュボードのデータが混在してしまうことがあります。これを避けるためには、iMessageアプリをAdjust管理画面に新規追加し、登録済みのiOSアプリと異なるアプリトークンを使ってSDKを初期化してください。 - -### Adjustログ - -`ADJConfig`インスタンスの`setLogLevel:に設定するパラメーターに合わせてXcodeに表示されるログのボリュームが変わります。 - -```objc -[adjustConfig setLogLevel:ADJLogLevelVerbose]; // enable all logging -[adjustConfig setLogLevel:ADJLogLevelDebug]; // enable more logging -[adjustConfig setLogLevel:ADJLogLevelInfo]; // the default -[adjustConfig setLogLevel:ADJLogLevelWarn]; // disable info logging -[adjustConfig setLogLevel:ADJLogLevelError]; // disable warnings as well -[adjustConfig setLogLevel:ADJLogLevelAssert]; // disable errors as well -[adjustConfig setLogLevel:ADJLogLevelSuppress]; // disable all logging -``` - -本番用アプリにAdjust SDKのログを表示しない場合は、ログレベルを`ADJLogLevelSuppress` に設定してください。加えて、suppress log level modeが有効化する別のコンストラクタでADJConfig`オブジェクトを下記のように初期化してください。 - -```objc -#import "Adjust.h" -// or #import -// or #import -// or #import -// or #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment - allowSuppressLogLevel:YES]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -### アプリのビルド - -アプリをビルドして起動してください。初回起動後、コンソールのSDKログに、`Install tracked`が表示されます。 - -![][run] - -## 追加機能 - -プロジェクトにAdjust SDKを実装すると、以下の機能をご利用できるようになります。 - -### AppTrackingTransparency framework - -各パッケージが送信されるたびに、Adjustのバックエンドは、ユーザーの許諾状況を表す4つの値のいずれかを受信します。 - -- Authorized(承認) -- Denied(拒否) -- Not Determined(未決定) -- Restricted(制限あり) - -デバイスがアプリ関連データへのアクセスに対するユーザーの許諾状況の承認リクエスト(ユーザーのデバイストラッキングに使用)を受信した後は、返されるステータスはAuthorizedあるいはDeniedになります。 - -デバイスがアプリ関連データへのアクセスの承認リクエスト(ユーザーあるいはデバイスのトラッキングに使用)を受信する前は、返されるステータスはNot Determinedになります。 - -アプリのトラッキングデータの使用が制限されている場合は、返されるステータスはRestrictedになります。 - -表示されるポップアップダイアログのカスタマイズを希望しない場合のために、Adjust SDKには、ユーザーがポップアップダイアログに応答した後に、更新ステータスを受信するメカニズムが組み込まれています。新しい許諾ステータスをバックエンドに簡単かつ効率的に伝達するために、Adjust SDKはアプリのトラッキング承認メソッドのラッパー(App-tracking authorisation wrapper)を提供しています。次の項目の説明をご覧ください。 - -### アプリトラッキング承認ラッパー(App-tracking authorisation wrapper) - -Adjust SDKは、アプリトラッキング承認ラッパーを使用して、アプリ関連データへのアクセスに対するユーザーの許諾状況をリクエストすることができます。Adjust SDKには、[requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc)メソッドに基づいて構築されたラッパーが用意されており、ユーザーの許諾情報を取得するコールバックメソッドを定義することもできます。また、このラッパーを使用することで、ユーザーがポップアップダイアログに応答すると、その内容がコールバックメソッドで直ちに伝達されます。SDKは、ユーザーの選択をバックエンドにも通知します。「NSUInteger」の値はコールバックメソッドによって伝達されます。値の意味は次のとおりです。 - -- 0: `ATTrackingManagerAuthorizationStatusNotDetermined`(承認ステータスは「未決定」) -- 1: `ATTrackingManagerAuthorizationStatusRestricted`(承認ステータスは「制限あり」) -- 2: `ATTrackingManagerAuthorizationStatusDenied`(承認ステータスは「拒否」) -- 3: `ATTrackingManagerAuthorizationStatusAuthorized`(承認ステータスは「承認」) - -このラッパーを使用するためには、次のように呼び出してください。 - -```objc -[Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) { - switch (status) { - case 0: - // ATTrackingManagerAuthorizationStatusNotDetermined case - break; - case 1: - // ATTrackingManagerAuthorizationStatusRestricted case - break; - case 2: - // ATTrackingManagerAuthorizationStatusDenied case - break; - case 3: - // ATTrackingManagerAuthorizationStatusAuthorized case - break; - } -}]; -``` - -### 現在の承認ステータスを取得 - -現在のアプリトラッキング承認ステータスを取得するには、`[Adjust appTrackingAuthorizationStatus]` を呼び出します。これは以下のいずれかを返します。 - -* `0`: ユーザーにまだリクエストをしていない場合 -* `1`: ユーザーのデバイスが制限されている場合 -* `2`: ユーザーがIDFAへのアクセスを拒否した場合 -* `3`: ユーザーがIDFAへのアクセスを承認した場合 -* `-1`: ステータスが不明な場合 - - -### SKAdNetwork frameworks - -Adjust iOS SDK v4.23.0以上を実装済みであり、アプリがiOS14で実行されている場合、SKAdNetworkとの通信はデフォルトでONに設定されますが、OFFに切り替えることもできます。ONに設定すると、SDKの初期化時にSKAdNetworkのアトリビューションがAdjustによって自動的に登録されます。conversion value(コンバージョン値)を受信するためにAdjust管理画面でイベントを設定する場合、conversaion valueのデータはAdjustバックエンドからSDKに送信されます。その後、SDKによってconversion valueが設定されます。SKAdNetworkコールバックデータをAdjustで受信した後、このデータが管理画面に表示されます。 - -Adjust SDKがSKAdNetworkと自動的に通信しないようOFFに切り替える場合は、configurationオブジェクトで次のメソッドを呼び出すことによって通信を無効化できます。 - -```objc -[adjustConfig deactivateSKAdNetworkHandling]; -``` - -### SKAdNetworkのconversion valueを更新 - -iOS SDK v4.26.0では、Adjust SDKラッパーメソッド`updateConversionValue:`を使ってSKAdNetworkのconversion valueを更新できます。 - -```objc -[Adjust updateConversionValue:6]; -``` - -### Conversion value更新コールバック - -コールバックを登録すると、Adjust SDKがユーザーのconversion valueを更新するたびに通知を受けることができます。`AdjustDelegate`プロトコルを実装し、オプションの`adjustConversionValueUpdated:`メソッドを実装する必要があります。 - -```objc -- (void)adjustConversionValueUpdated:(NSNumber *)conversionValue { - NSLog(@"Conversion value updated callback called!"); - NSLog(@"Conversion value: %@", conversionValue); -} -``` - -### イベントトラッキング - -Adjustではアプリ内イベントの計測も可能です。ここでは、特定のボタンに対するすべてのタップを計測する場合について説明します。[管理画面]で新しいイベントトークンを作成し、`abc123`というイベントトークンが発行されたとします。次に、ボタンの`buttonDown`メソッドで以下のコードを追加してタップを計測します。 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[Adjust trackEvent:event]; -``` - -ユーザーがボタンをタップすると、ログに`Event tracked`が表示されます。 - -イベントインスタンスは、計測前にイベントをさらに設定するのに使用できます。 - -### 収益(アプリ内課金)のトラッキング - -ユーザーによって発生したアプリ内課金の計測も可能です。例えば、1回のタップで1ユーロセントの課金が発生する場合、収益イベントを以下のように実装してください。 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setRevenue:0.01currency:@"EUR"]; - -[Adjust trackEvent:event]; -``` - -もちろん、これはコールバックパラメーターと紐付けることができます。 - -通貨コードを設定すると、Adjustは計測された課金金額を設定されたレポート通貨に自動換算します。[通貨換算についての詳細はこちら][currency-conversion]をご覧ください。 - -収益とイベントトラッキングの詳細については、[イベントトラッキングガイド](https://help.adjust.com/ja/article/app-events#tracking-purchases-and-revenues)をご覧ください。 - -### 収益の重複排除 - -収益の重複計測を防ぐため、オプションとしてトランザクションIDをでパスすることもできます。最新の10のトランザクションIDが記憶され、収益イベントに紐づけられたトランザクションIDが重複している場合、そのイベントを排除します。これは、アプリ内購入のトラッキングに特に有効です。以下の例をご参照ください。 - -アプリ内購入をトラッキングする際は、状態が`SKPaymentTransactionStatePurchased`に変わった場合にのみ`paymentQueue:updatedTransactions`で`finishTransaction`の後に`trackEvent`をコールするようにしてください。これにより、実際に発生しなかった収益イベントがトラッキングされるのを防ぐことができます。 - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState){ - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - ADJEvent *event = [ADJEvent eventWithEventToken:...]; - [event setRevenue:... currency:...]; - [event setTransactionId:transaction.transactionIdentifier];// avoid duplicates - [Adjust trackEvent:event]; - - break; - // more cases - } - } -} -``` - -### アプリ内購入認証 - -Adjustのサーバーサイドのレシート認証ツールである購入認証を使ってアプリ内で行われたアプリ内収益の有効性を調べる際は、iOS purchase SDKをご利用ください。詳細は[こちら][ios-purchase-verification] をご覧ください。 - -### コールバックパラメーター - -[管理画面]でイベントのコールバックURLを登録することができます。イベントが計測されると、設定したコールバックURLにGETリクエストを送信します。商品IDなど、お客様独自のカスタムID(コールバックパラメーター)を送信することが可能です。イベント計測前に`addCallbackParameter`をコールするよう実装してください。AdjustはコールバックパラメーターをコールバックURLに追加して送信します。 - -例えば、コールバックURL `https://www.mydomain.com/callback`に対して、カスタムID(Keyとfooの値)を送信する場合の実装方法は下記の通りです。 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -この場合、Adjustはkeyとfooの値を追加してGETリクエストを送信します。 - - https://www.mydomain.com/callback?key=value&foo=bar - -Adjustはさまざまなプレースホルダー(ローデータ送信)をサポートしています。例えば`{idfa}`はパラメーター値として利用できます。コールバック内で、プレースホルダー{idfa}は該当デバイスのIDFAに置き換えられます。またAdjustは、お客様独自のカスタムパラメーターを保存することはなく、コールバックのみに唯一利用します。イベント発生時にコールバックURLを設定していない場合、カスタムパラメーターが送信もされないことに注意してください。 - -使用可能なプレースホルダー(パラメーター)の一覧やコールバックの詳細は、[コールバックガイド][callbacks-guide]を参照してください。 - -### パートナーパラメーター - -Adjustでは、管理画面でパラメーターを追加して、連携を有効化したネットワークパートナー対してもカスタムパラメーター(お客様の独自IDなど)を送信可能です。 - -これは上記のコールバックパラメーターと同様に機能しますが、`ADJEvent`イベントインスタンスの`addPartnerParameter`メソッドをコールすることにより追加されます。 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addPartnerParameter:@"key" value:@"value"]; -[event addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -スペシャルパートナーとの連携方法の詳細については、[スペシャルパートナーガイド] [スペシャルパートナー]をご覧ください。 - -### コールバックID - -計測イベントにカスタムIDを追加できます。このIDはイベント計測成功(または計測失敗)後に通知され、どのイベントが正しく計測されたか知ることが可能です。`ADJEvent`インスタンスに`setCallbackId`メソッドをコールしてこのIDを設定してください: - - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setCallbackId:@"Your-Custom-Id"]; - -[Adjust trackEvent:event]; -``` - -### セッションパラメーター - -セッションパラメーターは、Adjust SDKが計測したすべてのイベントやセッション発生時に送信されます。セッションパラメーターはローカルに保存されるため、毎回追加する必要はありません。同じパラメーターを2回追加しても何も起こりません。 - -初回インストール発生時にセッションパラメーターを送信する場合は、Adjust SDKが`[Adjust appDidLaunch:]`で初期化される前にパラメーターをコールする必要があります。インストール時にパラメーターを送信したいものの、必要な値がアプリ起動後にしか取得できない場合は、Adjust SDKの初期化を[遅らせる](#delay-start)ことができます。 - -### セッションコールバックパラメーター - -[イベント](#callback-parameters)で設定された同じコールバックパラメーター(お客様のカスタムID)を、イベントまたはセッション発生時にに送信することもできます。 - -セッションコールバックパラメーターとイベントコールバックパラメーターの仕様は似ています。イベントにkeyとvalueを追加する代わりに、`Adjust`の`addSessionCallbackParameter:value:`をコールする際にパラメーターを追加してください。 - -```objc -[Adjust addSessionCallbackParameter:@"foo" value:@"bar"]; -``` - -セッションコールバックパラメーターは、イベント計測用のコールバックパラメーターとマージされます。イベントに追加されたコールバックパラメーターは、セッションコールバックパラメーターより優先されます。イベント用のコールバックパラメーターがセッション用のパラメーターと同じkeyを持っている場合、イベント用のコールバックパラメーターのvalueが優先されます。 - -`removeSessionCallbackParameter`メソッドに指定のkeyを渡すことで、特定のセッションパートナーパラメーターを削除することができます。 - -```objc -[Adjust removeSessionCallbackParameter:@"foo"]; -``` - -セッションコールバックパラメーターからすべてのキーと値を削除したい場合は、`resetSessionCallbackParameters`メソッドを使ってリセットすることができます。 - -```objc -[Adjust resetSessionCallbackParameters]; -``` - -### セッションパートナーパラメーター - -イベントやセッション発生時に送信される[セッションコールバックパラメーター](#session-callback-parameters)と同じように、セッションパートナーパラメーターも用意されています。 - -セッションパートナーパラメーターはAdjustのネットワークパートナーに送信され、Adjust[管理画面]のパートナー設定で有効化された連携に利用されます。 - -セッションパートナーパラメーターとイベントパートナーパラメーターの仕様は似ています。イベントにkeyとvalueを追加する代わりに、`Adjust`メソッドの`addSessionPartnerParameter:value:`のコール時に追加してください。 - -```objc -[Adjust addSessionPartnerParameter:@"foo" value:@"bar"]; -``` - -セッションパートナーパラメーターは、イベント計測用のパートナーパラメーターとマージされます。イベントに追加されたパートナーパラメーターは、セッションパートナーパラメーターより優先されます。イベントに追加されたパートナーパラメーターがセッションから追加されたパラメーターと同じkeyを持っている場合、イベントに追加されたパートナーパラメーターのvalueが優先されます。 - -`removeSessionPartnerParameter`メソッドに指定のkeyを渡すことで、特定のセッションパートナーパラメーターを削除することができます。 - -```objc -[Adjust removeSessionPartnerParameter:@"foo"]; -``` - -セッションパートナーパラメーターからすべてのkeyとvalueを削除したい場合は、`resetSessionPartnerParameters`メソッドを使ってリセットすることができます。 - -```objc -[Adjust resetSessionPartnerParameters]; -``` - -### ディレイスタート - -Adjust SDKのインストール計測を遅らせると、ユニークID(お客様の会員ID等)をセッションパラメーターとして取得して、インストール計測時に送信できるようになります。 - -`ADJConfig`インスタンスの`setDelayStart`メソッドで、遅らせる時間を秒単位で設定してください。 - -```objc -[adjustConfig setDelayStart:5.5]; -``` - -この場合、Adjust SDKは最初のインストールセッションやイベントを5.5秒間は送信しません。設定された時間が過ぎるまで、もしくは`[Adjust sendFirstPackages]`がコールされると、セッションパラメーターはディレイインストールセッションやイベントに追加され、Adjust SDKは通常通り計測を再開します。 - -**Adjust SDKのディレイスタートが指定できる時間は最大10秒です**。 - -### アトリビューションコールバック - -流入元のアトリビューションの更新通知をアプリが受けるために、デリゲートコールバックを登録することができます。アトリビューションには複数の流入元が紐づく可能性があるため、この情報は同時に送ることができません。App Delegateでオプションのデリゲートプロトコルを実装するには、以下の手順に従ってください。 - -Adjustの[該当するアトリビューションデータポリシー][attribution-data]を考慮するようにしてください。 - -1. `AppDelegate.h`を開き、importと`AdjustDelegate`宣言を追加します。 - - ```objc - @interface AppDelegate : UIResponder - ``` - -2. `AppDelegate.m`を開き、次のデリゲートコールバック関数をApp Delegateに追加します。 - - ```objc - - (void)adjustAttributionChanged:(ADJAttribution *)attribution { - } - ``` - -3. `ADJConfig`インスタンスでデリゲートを設定します。 - - ```objc - [adjustConfig setDelegate:self]; - ``` - -デリゲートコールバックは`ADJConfig`インスタンスを使用して設定されるため、`[Adjust appDidLaunch:adjustConfig]`をコールする前に`setDelegate`をコールする必要があります。 - -このデリゲート関数は、SDKが最後のアトリビューションデータを取得した後に作動します。デリゲート関数内で`attribution`パラメーターを確認することができます。プロパティの概要は次のとおりです。 - -- `NSString trackerToken` 最新アトリビューションのトラッカートークン -- `NSString trackerName` 最新アトリビューションのトラッカー名 -- `NSString network` 最新アトリビューションのネットワークのグループ階層 -- `NSString campaign` 最新アトリビューションのキャンペーンのグループ階層 -- `NSString adgroup` 最新アトリビューションのアドグループのグループ階層 -- `NSString creative` 最新アトリビューションのクリエイティブのグループ階層 -- `NSString clickLabel` 最新アトリビューションのクリックラベル -- `NSString adid` Adjustが提供するユニークデバイスID(adid) -- `NSString costType` コストタイプの文字列 -- `NSNumber costAmount` コストの金額 -- `NSString costCurrency` コスト通貨の文字列 - -値がない場合は、デフォルトで`nil`になります。 - -注:コストデータ - `costType`、`costAmount`および`costCurrency`は、`setNeedsCost:`メソッドを呼び出して`ADJConfig`で設定された場合にのみ利用可能です。設定されていない場合、あるいは設定されていてもアトリビューションの一部でない場合は、これらのフィールドは`nil`の値を持ちます。この機能はSDK v4.24.0以降のみ利用可能です。 - -### 広告収益のトラッキング - -**注**:この広告収益計測APIは、ネイティブのSDK v4.29.0以降のみ利用可能です。 - -Adjust SDKを利用して、以下のメソッドを呼び出し広告収益情報を計測することができます。 - -```objc -// initilise ADJAdRevenue instance with appropriate ad revenue source -ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source]; -// pass revenue and currency values -[adRevenue setRevenue:1.6currency:@"USD"]; -// pass optional parameters -[adRevenue setAdImpressionsCount:adImpressionsCount]; -[adRevenue setAdRevenueUnit:adRevenueUnit]; -[adRevenue setAdRevenuePlacement:adRevenuePlacement]; -[adRevenue setAdRevenueNetwork:adRevenueNetwork]; -// attach callback and/or partner parameter if needed -[adRevenue addCallbackParameter:key value:value]; -[adRevenue addPartnerParameter:key value:value]; - -// track ad revenue -[Adjust trackAdRevenue:source payload:payload]; -``` - -現在、Adjustは以下の`source`パラメーターの値のみ対応しています。 - -- `ADJAdRevenueSourceAppLovinMAX` - AppLovin MAXプラットフォームを示します。 -- `ADJAdRevenueSourceMopub` - MoPubプラットフォームを示します。 -- `ADJAdRevenueSourceAdMob` - AdMobプラットフォームを示します。 -- `ADJAdRevenueSourceIronSource` - IronSourceプラットフォームを示します。 - -**注**:サポートされているすべてのソースとの連携の詳細については、このREADME以外にも追加のドキュメントが用意されます。また、この機能を利用するには、Adjust管理画面でのアプリの追加設定が必要となりますので、利用する前に必ずサポートチームに連絡し、すべての設定が正しく行われていることを確認してください。 - -### サブスクリプショントラッキング - -**注**:この機能はネイティブのSDK v4.22.0以降のみ利用可能です。最低でもバージョン4.22.1を使用することを推奨します。 - -**重要**:以下の手順は、SDK内でサブスクリプション計測を行う場合に設定してください。設定を完了するには下記アプリ内へのコード実装の他、Adjustの内部システムにアプリ固有の情報を別途追加する必要があります。追加作業はAdjustの担当者によって行われるため、support@adjust.comまたは担当のアカウントマネージャーまでお問い合わせください。 - -App Storeのサブスクリプションを計測し、それぞれの有効性をAdjust SDKで確認できます。サブスクリプションの購入が完了したら、次のようにAdjust SDKを呼び出します。 - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -[Adjust trackSubscription:subscription]; -``` - -状態が`SKPaymentTransactionStatePurchased`または`SKPaymentTransactionStateRestored`に変わった時にのみこれを行ってください。次に、`paymentQueue:updatedTransactions`で`finishTransaction`をコールしてください。 - -Subscription tracking parameters: - -- [price](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc) -- currency([priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc)オブジェクトの[currencyCode](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc)を渡す必要がある) -- [transactionId](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc) -- [receipt](https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl) -- [transactionDate](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate?language=objc) -- salesRegion([priceLocale](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc)オブジェクトの[countryCode](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc)を渡す必要がある) - -イベント計測と同様に、コールバックパラメーターやパートナーパラメーターをサブスクリプションオブジェクトに付与できます。 - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -// add callback parameters -[subscription addCallbackParameter:@"key" value:@"value"]; -[subscription addCallbackParameter:@"foo" value:@"bar"]; - -// add partner parameters -[subscription addPartnerParameter:@"key" value:@"value"]; -[subscription addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackSubscription:subscription]; -``` - -### イベントとセッションのコールバック - -イベントとセッションの双方もしくはどちらかをトラッキングし、成功か失敗かの通知を受け取れるようデリゲートコールバックを登録できます。ここでも[アトリビューションコールバック](#attribution-callback)に使用されている`AdjustDelegate`プロトコルを任意で使うことができます。 - -同じ手順に従って、成功したイベントへのデリゲートコールバック関数を以下のように実装します。 - -```objc -- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData { -} -``` - -失敗したイベントへのデリゲートコールバック関数 - -```objc -- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData { -} -``` - -同様に、成功したセッション - -```objc -- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData { -} -``` - -失敗したセッション - -```objc -- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData { -} -``` - -デリゲート関数は、SDKがサーバーにパッケージ送信を試みた後でコールされます。デリゲートコールバック内でデリゲートコールバック用のレスポンスデータオブジェクトを確認することができます。レスポンスデータのプロパティの概要は以下のとおりです。 - -- `NSString message` サーバーからのメッセージまたはSDKのエラーログ -- `NSString timeStamp` サーバーからのタイムスタンプ -- `NSString adid` Adjustから提供するユニークデバイスID(adid) -- `NSDictionary jsonResponse` サーバーからのレスポンスのJSONオブジェクト - -どちらのイベントレスポンスデータオブジェクトも以下を含みます。 - -- `NSString eventToken` トラッキングしたパッケージがイベントだった場合、そのイベントトークン -- `NSString callbackId` イベントオブジェクトにカスタム設定されたコールバックID - -値がない場合は、デフォルトで`nil`になります。 - -失敗したイベントとセッションは以下を含みます。 - -- `BOOL willRetry` しばらく後に再送を試みる予定であるかどうかを示します。 - -### トラッキングの無効化 - -`setEnabled`にパラメーター`NO`を渡すことで、AdjustSDKが行うデバイスのアクティビティのトラッキングをすべて無効にすることができます。**この設定はセッション間で記憶されます**。 - -```objc -[Adjust setEnabled:NO]; -``` - -Adjust SDKが現在有効化されているかどうかは、`isEnabled`関数を呼び出すことで確認できます。また、`setEnabled`関数に`YES`を渡せば、Adjust SDKを有効化することができます。 - -### オフラインモード - -Adjustのサーバーへの送信を一時停止し、保持されているトラッキングデータを後から送信するためにAdjust SDKをオフラインモードにすることができます。オフラインモード中はすべての情報がファイルに保存されるため、イベントを多く発生させすぎないようにご注意ください。 - -`YES`パラメーターで`setOfflineMode` を呼び出すと、オフラインモードを有効にできます。 - -```objc -[Adjust setOfflineMode:YES]; -``` - -反対に、`NO`パラメーターで`setOfflineMode`を呼び出すと、オフラインモードを解除できます。Adjust SDKがオンラインモードに戻った時、保存されていた情報は計測時の正しいタイムスタンプでAdjustのサーバーに送られます。 - -トラッキングの無効化とは異なり、この設定はセッション間で**記憶されません**。オフラインモード時にアプリを終了しても、次に起動した時にはオンラインモードとしてアプリが起動します。 - -### イベントバッファリング - -イベントトラッキングを酷使している場合、HTTPリクエストを遅延させて1分ごとにまとめて送信したほうが良い場合があります。その場合は`ADJConfig`インスタンスでイベントバッファリングを有効にしてください。 - -```objc -[adjustConfig setEventBufferingEnabled:YES]; -``` - -何も設定されていない場合、イベントバッファリングは**デフォルトで無効になっています**。 - -### GDPRの忘れられる権利 - -EUの一般データ保護規制(GDPR)第17条に基づいて、ユーザーが「忘れられる権利(right to be forgotten)」を行使した場合は、Adjustに通知することができます。次のメソッドを呼び出して、ユーザーの申請をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - -```objc -[Adjust gdprForgetMe]; -``` - -この情報を受け取ると、Adjustは該当ユーザーのデータを消去し、Adjust SDKはユーザーのトラッキングを停止します。以降、そのデバイスからのリクエストはAdjustに送信されません。 - -## 特定のユーザーの計測データをサードパーティーとの共有 - -ユーザーがサードパーティーとのデータ共有を無効化、有効化、あるいは再有効化する情報をAdjustに送信することができます。 - -### 特定のユーザーについてのサードパーティーとの共有を無効にする - -次のメソッドを呼び出して、ユーザーの選択(データ共有を無効にする)をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@NO]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -この情報を受け取ると、Adjustは特定のユーザーに関してパートナーとのデータ共有をブロックします。Adjust SDKは通常通り機能します。 - -### 特定のユーザーについてのサードパーティーとの共有を無効にする - -次のメソッドを呼び出して、データ共有あるいはデータ共有の変更に関するユーザーの選択をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@YES]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -この情報を受け取ると、Adjustは特定のユーザーに関してパートナーとのデータ共有設定を変更します。Adjust SDKは通常通り機能します。 - -次のメソッドを呼び出して、詳細なオプションをAdjustバックエンドに送信するようAdjust SDKに指示してください。 - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:nil]; -[adjustThirdPartySharing addGranularOption:@"PartnerA" key:@"foo" value:@"bar"]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -### 特定のユーザーについての同意の計測 - -Adjust管理画面で同意有効期間とユーザーデータ保持期間を含むデータプライバシー設定を有効化あるいは無効化するには、以下のメソッドを実装してください。 - -次のメソッドを呼び出して、データプライバシー設定をAdjustバックエンドに伝えるようAdjust SDKに指示してください。 - -```objc -[Adjust trackMeasurementConsent:YES]; -``` - -この情報を受け取ると、Adjustは特定のユーザーに関してパートナーとのデータ共有設定を変更します。Adjust SDKは通常通り機能します。 - -### SDKシグネチャー - -Adjust SDKシグネチャーはアプリごとに有効化できます。この機能の利用をご希望の場合は、担当のテクニカルアカウントマネージャーまでお問い合わせください。 - -すでにアカウントでSDKシグネチャーが有効になっており、Adjust管理画面のアプリシークレット(App Secret)にアクセスできる場合は、以下の方法を使用してアプリにSDKシグネチャーを実装してください。 - -App Secretは、`AdjustConfig`インスタンスで`setAppSecret`をコールすることで設定されます。 - -```objc -[adjustConfig setAppSecret:secretId info1:info1 info2:info2 info3:info3 info4:info4]; -``` - -### バックグラウンドでのトラッキング - -Adjust SDKはデフォルトではアプリがバックグラウンドにある時はHTTPリクエストを停止します。この設定は`AdjustConfig`インスタンスで変更できます。 - -```objc -[adjustConfig setSendInBackground:YES]; -``` - -設定されていない場合、バックグラウンドでの送信は**デフォルトで無効になっています**。 - -### デバイスID - -Adjust SDKを使って、一部のデバイスIDを取得することができます。 - -### iOS広告ID - -Google Analyticsなどの一部のサービスでは、レポートの重複を防ぐためにデバイスIDとクライアントIDを連携させることが求められます。 - -デバイスID(IDFA)を取得するには、`idfa`関数をコールします。 - -```objc -NSString *idfa = [Adjust idfa]; -``` - -### AdjustデバイスID (adid) - -アプリがインストールされている各デバイスに対して、Adjust は、バックエンドでユニークな**Adujust デバイスID (**adid**)**を生成します。このIDを取得するためには、`Adjust`インスタンスで以下のメソッドをコールします。 - -```objc -NSString *adid = [Adjust adid]; -``` - -**注意**:**adid**は、Adjust SDKによるインストール計測が完了した後に初めて利用可能となります。その時点よりAdjust SDKはデバイスの**adid**に関する情報を保有するようになり、このメソッドを使ってその情報にアクセスできます。よって、SDKが初期化されインストール計測が完了しないと、**adid**にアクセスすることは**できません**。 - -### ユーザーアトリビューション - -[アトリビューションコールバック](#attribution-callback)で説明したとおり、アトリビューション情報に変更がある度に、このコールバックが起動されます。`Adjust`インスタンスの以下のメソッドをコールすることで、必要な時にいつでもユーザーのアトリビューション情報にアクセスすることができます。 - -```objc -ADJAttribution *attribution = [Adjust attribution]; -``` - -**注意**:最新のアトリビューション情報は、Adjustバックエンドによるインストール計測が完了し、アトリビューションコールバックがトリガーされた後にのみ利用が可能となります。その時点よりAdjust SDKはユーザーのアトリビューション情報を保有するようになり、このメソッドを使ってアクセス可能になります。SDKが初期化されアトリビューションコールバックが最初に起動されるまでは、ユーザーのアトリビューション値にアクセスできません。 - -### Pushトークン - -Pushトークン(device token)は、オーディエンスビルダーやコールバックに使用されます。また、アンインストールや再インストールのトラッキングにも必要です。 - -Push通知トークンをAdjustに送信するには、App Delegateの`didRegisterForRemoteNotificationsWithDeviceToken`で以下のコールを`Adjust`に追加してください。 - -```objc -- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [Adjust setDeviceToken:deviceToken]; -} -``` - -### プリインストールトラッカー - -Adjust SDKを使用して、出荷直後のスマートフォンにプリインストールされたアプリの初回起動を計測する場合は、以下の手順に従ってください。 - -1. [管理画面]で新しいトラッカーを作成してください。 -2. App Delegateを開き、`ADJConfig`のデフォルトトラッカーを追加します。 - - ```objc - ADJConfig*adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; - [adjustConfig setDefaultTracker:@"{TrackerToken}"]; - [Adjust appDidLaunch:adjustConfig]; - ``` - - `{TrackerToken}`にステップ2で作成したトラッカートークンを入れます。管理画面にはトラッカー - URL(`http://app.adjust.com/`など)が表示されます。ソースコード内には、このURL全体ではなく、6文字のトークンのみを - 入力してください。 - -3. アプリをビルドして実行します。XCodeに下記のような行が表示されるはずです。 - - ``` - Default tracker: 'abc123' - ``` - -### ディープリンク - -URLからアプリへのディープリンクオプションを使ったAdjustトラッカーURLをご利用の場合、ディープリンクURLとその内容の情報を得ることが可能です。アプリをすでにインストールしている状態でそのURLを訪れる(スタンダードディープリンク)ユーザーもいれば、またインストールしていないユーザーが開く(ディファードディープリンク)場合もあります。Adjust SDKはこれらを両方サポートしており、いずれの場合でも、トラッカーURLがクリックされアプリが起動された後にディープリンクURLが提供されます。アプリでこの機能を使用するには、適切な設定を行う必要があります。 - -### スタンダードディープリンク - -ユーザーがすでにアプリをインストールしているユーザーがディープリンク情報が付与されたトラッカーURLを開いた場合、アプリが起動されディープリンクの情報がアプリに送信されます。これを解析し、次に何をするかを決めることができます。iOS 9以降より、Apple社はディープリンクの扱い方を変更しています。どんな状況においてアプリにディープリンクを使用したいかによって(または多様なデバイスをサポートするために両方を使用したい場合)、以下のシナリオのいずれか、または両方に対応できるようにアプリを設定する必要があります。 - -### iOS 8以前でのディープリンク - -iOS 8以前のバージョンにおけるディープリンクは、カスタムURLスキーム設定によって行われます。アプリが開かれるためのカスタムURLスキーム名を付ける必要があります。このスキーム名は、`deep_link`パラメーターの一部としてAdjustトラッカーURLにも使用されます。これを設定するには、`Info.plist`ファイルを開き、新しい`URL types`を追加します。そこで、アプリのバンドルIDを`URL identifier`とし、`URL schemes`でアプリで使用したいスキーム名を追加します。以下に、`adjustExample`というスキーム名を使用したアプリの例を示します。 - -![][custom-url-scheme] - -この設定が完了した後、`deep_link`パラメーターを持つ、選択したスキーム名を含むAdjustトラッカーURLをクリックするとアプリが起動されます。アプリが起動されると、`AppDelegate`クラスの`openURL`メソッドがトリガーされ、トラッカーURLの`deep_link`パラメーターの内容の場所が提供されます。ディープリンクの内容にアクセスしたい場合は、このメソッドを上書きしてください。 - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url object contains your deep link content - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -iOS 8以前のバージョンのiOSデバイス向けのディープリンクの設定が完了しました。 - -### iOS 9以降のバージョンでのディープリンク - -iOS 9以降のデバイスにおけるディープリンクのサポートを設定するには、アプリでAppleのユニバーサルリンク機能を有効化する必要があります。ユニバーサルリンクの詳細と設定方法については、[こちら][universal-links]をご覧ください。 - -Adjustは、ユニバーサルリンクをサポートするために様々な対応をしています。Adjustでユニバーサルリンクを使うには、Adjust管理画面でユニバーサルリンクのための設定を行ってください。設定方法の詳細については、Adjustの公式[資料][universal-links-guide]をご覧ください。 - -管理画面にてユニバーサルリンク機能を有効化したら、以下の作業を行ってください。 - -Apple Developerポータルでアプリの`Associated Domains`を有効化し、アプリのXcodeプロジェクトでもこれを行います。`Assciated Domains`を有効化したら、`Domains`セクションで`applinks:`を使ってプレフィックスを指定し、Adjust管理画面で生成されたユニバーサルリンクを追加します。ユニバーサルリンクの`http(s)`の部分を忘れずに削除するようにしてください。 - -![][associated-domains-applinks] - -設定完了後、Adjustトラッカーのユニバーサルリンクをクリックするとアプリが起動します。アプリが起動すると、`AppDelegate`クラスの`continueUserActivity`メソッドがトリガーし、ユニバーサルリンクURLの内容の場所が提供されます。ディープリンクの内容にアクセスしたい場合は、このメソッドを上書きしてください。 - -```objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - // url object contains your universal link content - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -これで、iOS 9以降のバージョンのiOSデバイス向けのディープリンク設定が完了しました。 - -Adjustは、ユニバーサルリンクを従来のディープリンクURLに変換するヘルパー機能を提供しています。これは、コード内に、従来のカスタムURLスキームフォーマットにするためにディープリンクの情報を常に必要とするカスタムロジックがある場合にご利用いただけます。ユニバーサルリンクとディープリンクのプレフィックスに使用したいカスタムURLスキーム名と共に、このメソッドをコールすることができます。そうすると、AdjustはカスタムURLスキームディープリンクを生成します。 - -```objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### ディファードディープリンク - -ディファードディープリンクが開かれる前に通知を受け取るデリゲートコールバックを登録し、Adjust SDKがそれを開くかどうかを決定することができます。また、[アトリビューションコールバック](#attribution-callback)や[イベントとセッションのコールバック](#event-session-callbacks)に使われる`AdjustDelegate`プロトコルをここでも使用できます。 - -同じ手順に従って、ディファードディープリンクの以下のデリゲートコールバック関数を実装します。 - -```objc -- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink { - // deeplink object contains information about deferred deep link content - - // Apply your logic to determine whether the Adjust SDK should try to open the deep link - return YES; - // or - // return NO; -} -``` - -SDKがAdjustのサーバーからディファードディープリンクを受信した後、ディープリンクを開く前にコールバック関数がコールされます。コールバック関数内で、ディープリンクにアクセスできます。返されるブーリアン値は、SDKがディープリンクを起動するかどうかを決定します。例えば、ディープリンクをすぐには開かないようにした場合、それを保存し後から任意のタイミングで開くように設定できます。 - -このコールバックが実装されていない場合は、**Adjust SDKはデフォルトで常にディープリンクを開きます**。 - -### ディープリンクを介したリアトリビューション - -Adjustはディープリンクを使ったリエンゲージメントキャンペーンをサポートしています。詳しくは[公式資料][reattribution-with-deeplinks]をご覧ください。 - -ディープリンクを使用する場合、ユーザーのリアトリビューションを正確に計測するためには、下記のコードを追加してください。 - -アプリでディープリンクの内容データを受信したら、`appWillOpenUrl`メソッドへのコールを追加してください。このコールによって、Adjust SDKはディープリンクの中に新たなアトリビューション情報が存在するかを調べ、アトリビューションが見つかった場合はAdjustバックエンドに送信します。ディープリンクのついたAdjustトラッカーURLのクリックによってユーザーがリアトリビュートされる場合、アプリで[アトリビューションコールバック](#attribution-callback)がこのユーザーの新しいアトリビューションデータでトリガーされます。 - -すべてのiOSバージョンでディープリンクリアトリビューションをサポートするための`appWillOpenUrl`へのコールは、以下のようになります。 - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url object contains your deep link content - - [Adjust appWillOpenUrl:url]; - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -```objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL url = [userActivity webpageURL]; - - [Adjust appWillOpenUrl:url]; - } - - // Apply your logic to determine the return value of this method - return YES; - // or - // return NO; -} -``` - -### リンクのresolution (解析と変換) - -Emailサービスプロバイダー(ESP)独自のカスタムトラッキングリンク経由でディープリンクを使用したり、クリックを計測する必要がある場合は、`ADJLinkResolution`クラスの`resolveLinkWithUrl`メソッドを使用してリンクをresolve(解析し、変換すること)します。これにより、アプリでディープリンクが開かれた時に、メール計測キャンペーンとのインタラクションを記録できます。 - -`resolveLinkWithUrl`メソッドでは、以下のパラメーターが使用できます。 - -- `url` - アプリを起動したディープリンク -- `resolveUrlSuffixArray` - リンクの解析が必要な、設定済みキャンペーンのカスタムドメイン -- `callback` - 最終的なURLを含むコールバック - -受信したリンクが`resolveUrlSuffixArray`で指定されたドメインのいずれにも属さない場合、コールバックはディープリンクURLをそのまま転送します。リンクが指定されたドメインのいずれかを含む場合、SDKはリンクの解析を試み、`callback`パラメーターにディープリンクを返します。返されたディープリンクは、`[Adjust appWillOpenUrl:]`メソッドを使ってAdjust SDKでリアトリビュートすることも可能です。 - -> **注**: URLの解析と変換が行われると、SDKは自動的に最大3つのリダイレクトをフォローします。さらに、SDKはフォローした最新のURLを`callback` URLとして返します。つまり、フォローするリダイレクトが3つを超える場合は**3つ目のリダイレクトURL**が返されます。 - -**例** - -```objc -[ADJLinkResolution - resolveLinkWithUrl:url - resolveUrlSuffixArray:@[@"example.com"] - callback:^(NSURL * _Nullable resolvedLink) - { - [Adjust appWillOpenUrl:resolvedLink]; - }]; -``` - -### [ベータ版]データレジデンシー - -データ所在地機能を有効にするには、`ADJConfig`インスタンスの`setUrlStrategy:`メソッドに、以下のいずれかの定数を指定して呼び出します: - -```objc -[adjustConfig setUrlStrategy:ADJDataResidencyEU]; // for EU data residency region -[adjustConfig setUrlStrategy:ADJDataResidencyTR]; // for Turkey data residency region -``` - -**注:** 現在、この機能はベータテスト段階です。この機能の利用をご希望の場合は、担当のアカウントマネージャーもしくはsupport@adjust.comまでお問い合わせください。この設定を有効にすると、SDKのトラフィックが遮断されるため、この機能がアプリで有効になっていることをサポートチームに確認する前に、この設定を有効にしないでください。 - -## よくある質問 - -### SDK初期化時の問題 - -[基本設定手順](#basic-setup)に記載の通り、Appデリゲートの`didFinishLaunching`または`didFinishLaunchingWithOptions`内でAdjust SDKを初期化することを強くおすすめします。Adjust SDKの全機能を使用するには、SDKをできる限り早く初期化することが重要です。 - -Adjust SDKを初期化しないと、アプリでのトラッキングにあらゆる影響が及ぼされます。**トラッキングを正しく行うために、Adjust SDKは*必ず*初期化してください。** - -`SDKの初期化前では以下の機能は実行されません`。 - -* [イベントトラッキング](#event-tracking) -* [ディープリンクを介したリアトリビューション](#deeplinking-reattribution) -* [トラッキングの無効化](#disable-tracking) -* [オフラインモード](#offline-mode) - -  - -SDKを初期化する前にこれらのアクションを計測するためには、アプリ内で`custom actions queueing mechanism`を構築する必要があります。つまり、SDKで利用したいすべてのアクションをキューイングメカニズムに入れ、SDKの初期化が完了したら動作するようにしてください。 - -オフラインモードの状態とトラッキングの有効/無効状態は変わらず、ディープリンクリアトリビューションは発生しません。また、計測されたあらゆるイベントは`失われます`。 - -その他にSDKの初期化の影響を受ける可能性があるのは、セッション計測です。Adjust SDKは、初期化が完了するまでアプリ滞在時間に関する情報の収集を開始できません。これが管理画面のDAUデータに影響を与え、正しく計測が行われない可能性があります。 - -例として、次のシナリオを考えてみましょう。スプラッシュ画面や最初に表示される画面ではない、別の特定のビューまたはビューコントローラーが読み込まれた時にAdjust SDKが初期化されるように実装した場合、実際にユーザーがアプリをインストールして初回起動しても、ホーム画面でSDKが初期化されないためインストールを計測できません。さらに、ユーザーがアプリを気に入らず、ホーム画面が表示された直後にアンインストールした場合も、SDKが初期化されていないため、すべての情報はAdjust SDKに計測されることはなく、レポート画面にも表示されません。 - -#### イベントトラッキング - -計測対象のイベントに関しては、SDKの初期化完了後に内部的なキューイングメカニズムを使ってこれらを待機させて計測します。SDKの初期化前にイベントを計測すると、イベントが`除外されたり` 、`恒久的に失われる`ため、SDKの[`初期化が完了`]し、トラッキングが[`有効化された`](#is-enabled)後にイベントを計測するように実装してください。 - -#### オフラインモードとトラッキングの有効化/無効化 - -オフラインモードは、SDKの初期化の間で維持される機能ではないため、デフォルトで`false`に設定されています。SDKの初期化前にオフラインモードを有効化しようとする場合、SDKを初期化する際も`false`のままになります。 - -トラッキングの有効化/無効化は、SDKの初期化を行う中で維持される機能です。SDKの初期化前にこの値をトグルし設定を変更ようとする場合、それは無視されます。初期化が完了すると、SDKは設定変更前と同じ状態(有効または無効)になります。 - -#### ディープリンクを介したリアトリビューション - -[上記](#deeplinking-reattribution)の通りディープリンクリアトリビューションを使用する場合、使用しているディープリンクメカニズム(従来のディープリンクまたはユニバーサルリンク)によりますが、以下のコールをした後に`NSURL`オブジェクトが得られます。 - -```objc -[Adjust appWillOpenUrl:url] -``` - -SDKの初期化前にこのコールを行う場合、ディープリンクURLからのアトリビューション情報は恒久的に失われます。Adjust SDKで正しくリアトリビュートするには、SDKの初期化が完了したらこの`NSURL`オブジェクトのデータをキューし、`appWillOpenUrl`メソッドが呼ばれるようにしてください。 - -#### セッショントラッキング - -セッショントラッキングはAdjust SDKが自動で行うものであり、アプリ開発者はこれをコントロールできません。適切にセッショントラッキングを行うには、このREADMEで推奨されている通りAdjust SDKを初期化することが不可欠です。初期化を行わないと、セッショントラッキングや管理画面に表示されるDAUの数値に予測不能な影響が出る可能性があります。 - -例: -* ユーザーがアプリを起動したもののSDKが初期化される前にアプリを削除した場合、インストールとセッションは計測されず、レポート画面にも表示されません。 -* ユーザーがアプリをダウンロードして午前0時前に初回起動し、Adjust SDKが午前0時を過ぎた後に初期化された場合、初期化されるまで待機していたすべてのインストールとセッションのデータは間違った日付(午前0時過ぎ)でレポートされます。 -* ユーザーがアプリを数日利用せず、午前0時前にアプリを起動し、SDKが午前0時過ぎに初期化された場合、DAUはアプリの起動日の翌日付でレポートされます。 - -これらの現象を避けるため、アプリデリゲートの`didFinishLaunching`または`didFinishLaunchingWithOptions`でAdjust SDKを初期化してください。 - -### "Adjust requires ARC"というエラーが表示される - -`Adjust requires ARC`というエラーが表示され、ビルドに失敗した場合、プロジェクトが[ARC][arc]を使用していない可能性があります。その場合、Adjustは[プロジェクトを移行][transition]してARCを使用することを推奨します。ARCを使用しない場合は、ターゲットのBuild Phaseにて、Adjustのすべてのソースファイルに対してARCを有効化する必要があります。 - -`Compile Sources`グループを表示し、すべてのAdjustファイルを選択し`Compiler Flags`を`-fobjc-arc`に変更します(一括で変更するには、すべて選択し`Return`キーを押します)。 - -### "[UIDevice adjTrackingEnabled]: unrecognized selector sent to instance"というエラーが表示される - -このエラーは、Adjust SDKフレームワークをアプリに追加する際に発生する可能性があります。Adjust SDKはソースファイル内の`カテゴリー`を含んでおり、そのため、このSDK実装アプローチを選んだ場合、Xcodeのプロジェクト設定で`-ObjC`フラグを`Other Linker Flags`に追加する必要があります。このフラグを追加することでこのエラーを解決できます。 - -### "Session failed (Ignoring too frequent session.)"というエラーが表示される - -このエラーはインストールのテストの際に起こりえます。アンインストール後に再インストールするだけでは新規インストールが発生しません。SDKがローカルで統計したセッションデータを失ったとサーバーは判断してエラーメッセージを無視し、その端末に関する有効なデータのみが与えられます。 - -この仕様はテスト中には厄介かもしれませんが、サンドボックスと本番(Production)の挙動をできる限り近づけるために必要です。 - -デバイスのセッションデータはAdjustのサーバーでリセットできます。ログのエラーメッセージを確認してください。 - -``` -Session failed (Ignoring too frequent session.Last session: YYYY-MM-DDTHH:mm:ss, this session: YYYY-MM-DDTHH:mm:ss, interval: XXs, min interval: 20m) (app_token: {yourAppToken}, adid: {adidValue}) -``` - -`{yourAppToken}`と以下の`{adidValue}`または`{idfaValue}`値を使用して、以下のリンクのいずれかを開きます。 - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&adid={adidValue} -``` - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&idfa={idfaValue} -``` - -デバイスに関する記録が消去されると、リンクは`Forgot device`のみを返します。もしそのデバイスの記録がすでに消去されていたり、値が不正だった場合は、そのリンクは`Device not found`と返します。 - -### ログに"Install tracked"が表示されない - -テスト用デバイスでインストールをシミュレーションする場合は、Xcodeからアプリのビルドを再実行するだけでは十分ではありません。Xcodeからアプリを再実行するだけではSDKが計測したアプリデータは消去されず、アプリ内に内部データが保存されたままです。AdjustのSDKはそれらのファイルを確認し、アプリはインスール済み(SDK初期化済み)と認識します。初回起動ではなく再び起動されたものだと判断します。 - -アプリのインストールをシミュレーションするには、以下を行う必要があります。 - -* デバイスからアプリをアンインストールする(完全に消去する) -* [上記](#forget-device)で説明している通りに、Adjustバックエンドから計測済みのデバイスIDを消去する -* テスト用デバイスでXcodeからアプリを実行し、"Install tracked"というメッセージログを確認する。 - -### "Unattributable SDK click ignored"というメッセージが表示される - -`サンドボックス`環境でアプリをテストする際にこのメッセージが表示される可能性があります。これは、Appleが`iAd.framework`バージョン3で導入した変更点に関連しています。この変更により、ユーザーがiAdバナーをクリックするとアプリに移動するようになり、その結果Adjust SDKは、クリックされたURLの内容に関するデータとともに`sdk_click`パッケージをAdjustのバックエンドに送信します。いくつかの理由により、Apple社は、iAdバナーをクリックせずにアプリが起動された場合、ランダムな値を使ってiAdバナーURLのクリックを人工的に生成することに決定しました。AdjustのSDKは、iAdバナーのクリックが本物か人工的に生成されたものかを識別できず、どちらの場合でも`sdk_click`パッケージをAdjustバックエンドに送信します。ログレベルが`verbose`に設定されている場合、この`sdk_click`パッケージは以下のようになります。 - -``` -[Adjust]d: Added package 1 (click) -[Adjust]v: Path: /sdk_click -[Adjust]v: ClientSdk: ios4.10.1 -[Adjust]v: Parameters: -[Adjust]v: app_token {YourAppToken} -[Adjust]v: created_at 2016-04-15T14:25:51.676Z+0200 -[Adjust]v: details {"Version3.1":{"iad-lineitem-id":"1234567890","iad-org-name":"OrgName","iad-creative-name":"CreativeName","iad-click-date":"2016-04-15T12:25:51Z","iad-campaign-id":"1234567890","iad-attribution":"true","iad-lineitem-name":"LineName","iad-creative-id":"1234567890","iad-campaign-name":"CampaignName","iad-conversion-date":"2016-04-15T12:25:51Z"}} -[Adjust]v: environment sandbox -[Adjust]v: idfa XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -[Adjust]v: idfv YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY -[Adjust]v: needs_response_details 1 -[Adjust]v: source iad3 -``` - -もし何らかの理由で`sdk_click`が受理された場合、他のキャンペーンURLをクリックすることでアプリを起動、あるいはオーガニックユーザーとしてアプリを起動したユーザーは、この存在しないiAdソースにアトリビュートされることになります。このため、Adjustサーバーはこれを無視し、以下のメッセージを表示します。 - -``` -[Adjust]v: Response: {"message":"Unattributable SDK click ignored."} -[Adjust]i: Unattributable SDK click ignored. -``` - -このメッセージはSDK実装に関する問題を示すものではなく、ユーザーが間違ってアトリビューション/リアトリビューションされる可能性のある、この人工的に生成された`sdk_click`をAdjustが無視したことを通知するためのものです。 - -### Adjust管理画面に表示される収益データが間違っている - -Adjust SDKは、実装された通りにイベントを計測します。収益イベントを実装した場合、金額として代入された数値がAdjustバックエンドに送信され、レポート画面に表示されます。Adjust SDKとAdjustのバックエンドが金額の値を操作することはありません。よって、計測された金額が間違っているのは、SDKが原因ではありません。 - -通常、収益イベントを計測するコードの実装事例は以下の通りです。 - -```objc -// ... - -- (double)someLogicForGettingRevenueAmount { - // This method somehow handles how user determines - // what's the revenue value which should be tracked. - - // It is maybe making some calculations to determine it. - - // Or maybe extracting the info from In-App purchase which - // was successfully finished. - - // Or maybe returns some predefined double value. - - double amount; // double amount = some double value - - return amount; -} - -// ... - -- (void)someRandomMethodInTheApp { - double amount = [self someLogicForGettingRevenueAmount]; - - ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - [event setRevenue:amount currency:@"EUR"]; - [Adjust trackEvent:event]; -} - -``` - -計測されるべきでない値がレポート画面に表示されている場合は、**金額の値を決定するロジックを確認してください**。 - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[en-readme]: ../../README.md -[zh-readme]: ../chinese/README.md -[ja-readme]: ../japanese/README.md -[ko-readme]: ../korean/README.md - -[sdk2sdk-mopub]: ../japanese/sdk-to-sdk/mopub.md - -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[examples]: http://github.com/adjust/ios_sdk/tree/master/examples -[carthage]: https://github.com/Carthage/Carthage -[releases]: https://github.com/adjust/ios_sdk/releases -[cocoapods]: http://cocoapods.org -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html - -[example-tvos]: ../../examples/AdjustExample-tvOS -[example-iwatch]: ../../examples/AdjustExample-iWatch -[example-imessage]: ../../examples/AdjustExample-iMessage -[example-ios-objc]: ../../examples/AdjustExample-ObjC -[example-ios-swift]: ../../examples/AdjustExample-Swift - -[AEPriceMatrix]: https://github.com/adjust/AEPriceMatrix -[event-tracking]: https://docs.adjust.com/en/event-tracking -[callbacks-guide]: https://docs.adjust.com/ja/callbacks -[universal-links]: https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html - -[special-partners]: https://docs.adjust.com/en/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[ios-web-views-guide]: https://github.com/adjust/ios_sdk/blob/master/doc/japanese/web_views.md -[currency-conversion]: https://docs.adjust.com/ja/event-tracking/#tracking-purchases-in-different-currencies - -[universal-links-guide]: https://docs.adjust.com/ja/universal-links/ -[adjust-universal-links]: https://docs.adjust.com/en/universal-links/#redirecting-to-universal-links-directly -[universal-links-testing]: https://docs.adjust.com/en/universal-links/#testing-universal-link-implementations -[reattribution-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link -[ios-purchase-verification]: https://github.com/adjust/ios_purchase_sdk - -[reattribution-with-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link - -[run]: https://raw.github.com/adjust/sdks/master/Resources/ios/run5.png -[add]: https://raw.github.com/adjust/sdks/master/Resources/ios/add5.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag5.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate5.png -[framework]: https://raw.github.com/adjust/sdks/master/Resources/ios/framework5.png - -[adc-ios-team-id]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-ios-team-id5.png -[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png -[adc-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-associated-domains5.png -[xcode-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/xcode-associated-domains5.png -[universal-links-dashboard]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard5.png - -[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png -[universal-links-dashboard-values]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard-values5.png -[tracking-purchases-and-revenues]: https://help.adjust.com/ja/article/app-events#tracking-purchases-and-revenues - -[en-helpcenter]: https://help.adjust.com/en/developer/ios-sdk-documentation -[zh-helpcenter]: https://help.adjust.com/zh/developer/ios-sdk-documentation -[ja-helpcenter]: https://help.adjust.com/ja/developer/ios-sdk-documentation -[ko-helpcenter]: https://help.adjust.com/ko/developer/ios-sdk-documentation - -## ライセンス - -adjust SDKはMITライセンスを適用しています。 - -Copyright (c) 2012-2019 Adjust GmbH, http://www.adjust.com - -以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル(以下「ソフトウェア」)の複製を取得するすべての人に対し、 -ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの複製を使用、複写、変更、結合、掲載、頒布、サブライセンス、 -および/または販売する権利、およびソフトウェアを提供する相手に同じことを許可する権利も無制限に含まれます。 - -上記の著作権表示および本許諾表示を、ソフトウェアのすべての複製または重要な部分に記載するものとします。 - -ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。 -ここでいう保証とは、商品性、特定の目的への適合性、および権利非侵害についての保証も含みますが、それに限定されるものではありません。 -作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、 -あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。 diff --git a/doc/japanese/fb_pixel.md b/doc/japanese/fb_pixel.md deleted file mode 100644 index de155554b..000000000 --- a/doc/japanese/fb_pixel.md +++ /dev/null @@ -1,139 +0,0 @@ -## Facebook Pixelの統合 - - -[Facebook Pixel](https://www.facebook.com/business/help/952192354843755) はFacebookが提供するウェブサイト専用の分析ツールです。以前は、アプリ内のweb viewでPixelイベントをトラッキングするのにFacebook SDKを利用できませんでした。[FB SDK](https://developers.facebook.com/docs/analytics) v4.34のリリース以降はトラッキングが可能になり、[Hybrid Mobile App Events](https://developers.facebook.com/docs/app-events/hybrid-app-events) を使用して、Facebook PixelイベントをFacebook アプリイベントに変換します。 - -また、FB SDKを統合しなくても、Adjust SDKを使用してアプリ内のweb viewでFacebook Pixelを利用できるようになりました。 - -## Facebookの統合 - -### アプリサンプル - -[`example-fbpixel` ディレクトリ][example-fbpixel]にあるアプリサンプルを見ると、Adjustのweb view SDKを使用してどのようにFacebook Pixelイベントをトラッキングできるかがわかります。 - -### FacebookアプリID - -FB SDKを統合する必要はありませんが、Adjust SDKがFacebook Pixelを統合するために、一部FB SDKと同じ統合手順に従う必要があります。 - -まず[FB SDK iOS SDKガイド](https://developers.facebook.com/docs/ios/getting-started/#xcode) に記載の通り、対象のFacebookアプリIDをアプリに追加する必要があります。 -統合手順は上記リンクに記載がありますが、以下にも転載致します。 - -- Xcodeで、プロジェクトの`Info.plist`ファイルを右クリックして、[Open As] -> [Source Code]を選択します。 -- 以下のXMLスニペットをファイルのボディ部の最後の`` 要素の直前に挿入します。 - - - ```xml - - ... - FacebookAppID - {your-app-id} - ... - - ``` - -- `{{your-app-id}}`を対象アプリのアプリID(*Facebook App Dashboard*に表示される)に置き換えます。 - -### Facebook Pixelの設定 - -Facebook Pixelの統合方法については、Facebookのガイドに従ってください。 - -```js - - -... - -``` - -この後、[Hybrid Mobile App Eventsガイド](https://developers.facebook.com/docs/app-events/hybrid-app-events) の`Update Your Pixel`セクションに記載の通り、Facebook Pixelのコードを以下のように変更するだけです。 - - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**注意**:はじめに`'init'`メソッドを呼び出し、その直後に`'set'`メソッドを呼び出すことが**非常に重要**です。HTMLのウェブページに貼り付ける、Facebook提供の(上記のような)スクリプトスニペットは、`'init'`メソッドの呼び出しのすぐ後にページビューイベントの`'track'`メソッドが含まれています。このページビューイベントを正しくトラッキングするために、必ずこれらの間に`'set'`メソッドを呼び出してください。 - -## Adjustの統合 - -### Web viewの拡大 - -[iOS web view](web_views.md) アプリの統合ガイドに従ってください。こちらはWeb view bridgeをロードするセクションです。(以下を参照) - - -```objc -- (void)viewWillAppear:(BOOL)animated { - ... - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - // or with WKWebView: - // WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - self.adjustBridge = [[AdjustBridge alloc] init]; - [self.adjustBridge loadUIWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadUIWebViewBridge:webView webViewDelegate:(UIWebViewDelegate*)self]; - - // or with WKWebView: - // [self.adjustBridge loadWKWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; - ... -``` - - -どのweb viewをAdjust bridgeに選択するかに関わらず、手順に従って下記のラインを追加してください。 - -```objc -[self.adjustBridge augmentHybridWebView]; -``` - -### Event名の設定 - -Adjust web bridge SDKは、Facebook PixelイベントをAdjustイベントに変換します。 - -このため、Facebook Pixel設定の`fbq('track', 'PageView');`をコピーペーストで追加し、Adjust SDKを開始してFacebook Pixelイベントをトラッキングする**前**に、Facebook Pixelsを特定のAdjustイベントにマッピングするか、デフォルトのAdjustイベントトークンを設定する必要があります。 - -Facebook PixelイベントをAdjustイベントにマッピングするには、Adjust SDKを初期化する前に`adjustConfig`インスタンスの`addFbPixelMapping(fbEventNameKey, adjEventTokenValue)`を呼び出します。マッピングの例は以下の通りです。 - - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -注意:これは、以下のFacebook Pixelイベントをトラッキングする際の`fbq('track', 'Search', ...);`および`fbq('track', 'Purchase', ...);`にそれぞれ対応します。残念ながら、Javascriptでトラッキングされるイベント名とFB SDKで使用されるイベント名との間のすべてのマッピングスキームにはアクセスできません。 - -参考として、以下はAdjustがこれまで確認したイベント名の情報になります。 - -| Pixelイベント名 | 対応するFacebookアプリのイベント名 -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - - -これは完全なリストではない可能性があります。また、Facebookが現在のリストに追加や更新を加える可能性もあります。テスト中は、Adjustログで以下のような警告を確認してください。 - -``` -There is not a default event token configured or a mapping found for event named: 'fb_mobile_search'. It won't be tracked as an adjust event -``` - -``` -イベント名'fb_mobile_search'について、設定されたデフォルトイベントトークンが存在しないか、マッピングが見つかりません。Adjustイベントとしてトラッキングできません。 -``` - -また、マッピングを設定しない場合でもデフォルトのAdjustイベントの使用は可能です。Adjust SDKを初期化する前に、`adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);`を呼び出してください。 - - -[example-fbpixel]: ../../examples/AdjustExample-FbPixel diff --git a/doc/japanese/idfa.md b/doc/japanese/idfa.md deleted file mode 100644 index 98223ac2a..000000000 --- a/doc/japanese/idfa.md +++ /dev/null @@ -1,36 +0,0 @@ -## IDFAサポートの解除 - -アプリが広告IDを使っているためにAppleからリジェクトされた場合は、この資料をご確認ください。 - -1. [support@adjust.com](mailto:support@adjust.com)までご連絡ください。 - IDFA廃止の影響についてどの程度理解されているか確認しましょう。 - -2. adjustチームとの確認後、もしくはお急ぎの場合には、以下の手順に従ってIDFAサポートを外してください。 - -### AdSupportフレームワークの解除 - -- プロジェクトナビゲータからプロジェクトを選択してください。 - ターゲットが右ウィンドウの左上の角に選択されていることをご確認ください。 - -- `Build Phases`タブを選択し、`Link Binary with Libraries`グループを開いてください。 - -- `AdSupport.framework`を選び、`-`ボタンをクリックしてこれを解除してください。 - -- プロジェクトナビゲータで、`Frameworks`グループを開いてください。 - -- そこに`AdSupport.framework`があった場合は、右クリックして`Delete`をクリック、`Remove Reference`を選択してください。 - -### コンパイラフラグ`ADJUST_NO_IDFA`の追加 - -- プロジェクトナビゲータからプロジェクトを選択してください。 - ターゲットが右ウィンドウの左上の角に選択されていることをご確認ください。 - -- `Build Phases`タブを選択し、検索フィールドから`Other C Flags`を探してください。 - -- `Other C Flags`の右側をダブルクリックし、編集できるようにしてください。 - -- オーバーレイ部分の`+`ボタンをクリックし、以下の記述をコピー&ペーストしてください。 - - ``` - -DADJUST_NO_IDFA - ``` diff --git a/doc/japanese/migrate.md b/doc/japanese/migrate.md deleted file mode 100644 index f828663f4..000000000 --- a/doc/japanese/migrate.md +++ /dev/null @@ -1,203 +0,0 @@ -## iOS用adjust SDKのv3.4.0からv4.15.0への移行 - -### 初期設定 - -adjust SDKの設定方法が変わりました。初期設定はすべて新しいconfigオブジェクトで行わるようになります。 -加えてadjustのprefixも`AI`から`ADJ`に変わりました。 -移行の前後で`AppDelegate.m`の設定がどのように行われるか例を示します。 - -##### 移行前 - -```objc -[Adjust appDidLaunch:@"{YourAppToken}"]; -[Adjust setEnvironment:AIEnvironmentSandbox]; -[Adjust setLogLevel:AILogLevelInfo]; -[Adjust setDelegate:self]; - -- (void)adjustFinishedTrackingWithResponse:(AIResponseData *)responseData { -} -``` - -##### 移行後 - -```objc -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; -[adjustConfig setLogLevel:ADJLogLevelInfo]; -[adjustConfig setDelegate:self]; -[Adjust appDidLaunch:adjustConfig]; - -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { -} -``` - -### イベントトラッキング - -トラッキングされる前に設定することのできるイベントオブジェクトも導入しました。 -導入前後で設定がどのように行われるか例を示します。 - -##### 導入前 - -```objc -NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; -[parameters setObject:@"value" forKey:@"key"]; -[parameters setObject:@"bar" forKey:@"foo"]; -[Adjust trackEvent:@"abc123" withParameters:parameters]; -``` - -##### 導入後 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; -[Adjust trackEvent:event]; -``` - -### 収益トラッキング - -収益は通常のイベントとして扱えるようになりました。報酬と通過をトラッキングするよう設定するだけです。 -イベントトークンなしでは収益のトラッキングはできなくなりましたので、ご注意ください。 -ダッシュボードでイベントトークンを追加作成する必要がある場合があります。 -任意のトランザクションIDがイベントインスタンスのプロパティとなります。 - -*注意* 金額のフォーマットがセント単位から通過単位に変わりました。 -現在の収益トラッキングの金額は通過単位に調整されているはずです。(100で割った値になります) - -##### 変更前 - -```objc -[Adjust trackRevenue:1.0 transactionId:transaction.transactionIdentifier forEvent:@"xyz987"]; -``` - -##### 変更後 - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"xyz987"]; -[event setRevenue:0.01 currency:@"EUR"]; // You have to include the currency -[event setTransactionId:transaction.transactionIdentifier]; -[Adjust trackEvent:event]; -``` - -## v3.0.0から移行する場合の追加手順 - -`trackRevenue`に、任意で使用できる`transactionId`というパラメータを追加しました。 -アプリ内課金をトラッキングする場合、Appleから提供されるトランザクションIDを渡すと、重複を防ぐのに役立つでしょう。 -下記のような形でご利用いただけます。 - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState) { - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - [Adjust trackRevenue:... - transactionId:transaction.transactionIdentifier // avoid duplicates - forEvent:... - withParameters:...]; - - break; - // more cases - } - } -} -``` - -## v2.1.x or 2.2.xから移行する場合の追加手順 - -メインクラスの名称を`AdjustIo`から`Adjust`に変更しました。 -すべてのadjust SDKのコールを更新するには、次のステップに進んでください。 - -1. 旧`AdjustIo`ソースフォルダを右クリックし、`Delete`を選択、`Move to Trash`をクリックしてください。 - -2. Xcodeメニューから`Find → Find and Replace in Project...`を選び、検索と置換の機能に進んでください。 - 検索フィールドに`AdjustIo`を、置換フィールドに`Adjust`を入れてEnterを押してください。 - 置換したくないものがあれば、プレビューを押してマッチした結果から選択解除してください。 - Replaceをクリックして、`Adjust`インポートとコールを置換してください。 - - ![][rename] - -3. バージョン v3.4.0をダウンロードし、`Adjust`フォルダをXcodeプロジェクトナビゲータにドラッグしてください。 - - ![][drag] - -4. プロジェクトをビルドし、問題なく差し替えられたことを確認してください。 - -adjust SDK v3.4.0はデリゲートコールバックを追加しました。 -詳細は[README]をご確認ください。 - -## v2.0.xから移行する場合の追加手順 - -プロジェクトナビゲータからアプリケーションデリゲートのソースファイルを開いてください。 -ファイルの先頭に下記の`import`の記述を加えてください。 -`didFinishLaunching`か`didFinishLaunchingWithOptions`のいずれかのメソッドに、 -下記の`Adjust`のコールを追加してください。 - -```objc -#import "Adjust.h" -// ... -[Adjust appDidLaunch:@"{YourAppToken}"]; -[Adjust setLogLevel:AILogLevelInfo]; -[Adjust setEnvironment:AIEnvironmentSandbox]; -``` -![][delegate] - -`{YourAppToken}`にアプリのトークンを入力してください。これは[dashboard]でご確認いただけます。 - -You can increase or decrease the amount of logs you see by calling -`setLogLevel:` with one of the following parameters: -`setLogLevel:`をコールするパラメータを変更すると、記録するログのレベルを調整できます。 -パラメータには以下の種類があります。 - -```objc -[Adjust setLogLevel:AILogLevelVerbose]; // すべてのログを有効にする -[Adjust setLogLevel:AILogLevelDebug]; // より詳細なログを記録する -[Adjust setLogLevel:AILogLevelInfo]; // デフォルト -[Adjust setLogLevel:AILogLevelWarn]; // infoのログを無効にする -[Adjust setLogLevel:AILogLevelError]; // warningも無効にする -[Adjust setLogLevel:AILogLevelAssert]; // errorも無効にする -``` - -テスト用か本番用かによって、`setEnvironment:`のパラメータは以下のいずれかに設定する必要があります。 - -```objc -[Adjust setEnvironment:AIEnvironmentSandbox]; -[Adjust setEnvironment:AIEnvironmentProduction]; -``` - -**重要** この値はテスト中のみ`AIEnvironmentSandbox`に設定してください。 -アプリを提出する前に`AIEnvironmentProduction`になっていることを必ず確認してください。 -再度開発やテストをする際は`AIEnvironmentSandbox`に戻してください。 - -この変数は実際のトラフィックとテスト端末からのテストのトラフィックを区別するために利用されます。 -正しく計測するために、この値の設定には常に注意してください。収益のトラッキングの際には特に重要です。 - -## v1.xから移行する場合の追加手順 - -1. `appDidLaunch`メソッドはアプリIDの代わりにアプリトークンを使用します。 - アプリトークンは[dashboard]でご確認いただけます。 - -2. iOS用adjust SDKバージョン3.4.0は[ARC][arc]を使用しています。もしまだ実装していなければ、 - プロジェクトを[ARC使用へ移行][transition]することをお薦めします。 - ARCをご利用になりたくない場合は、adjust SDKのすべてのファイルでARCを有効化する必要があります。 - 詳細は[README]をご確認ください。 - -3. すべての`[+Adjust setLoggingEnabled:]`のコールを削除してください。 - ログはデフォルトで有効になっており、レベルは`[Adjust setLogLevel:]`メソッドで調整可能です。 - 詳細は[README]をご確認ください。 - -4. すべての`[+Adjust userGeneratedRevenue:...]`コールを - `[+Adjust trackRevenue:...]`に変更してください。 - 一貫性を持たせるために名称を変更しました。金額パラメータの型は`double`です。 - 数字から接尾の`f`を除いてください (`12.3f`は`12.3`になります)。 - -[README]: ../README.md -[rename]: https://raw.github.com/adjust/sdks/master/Resources/ios/rename.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag3.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate3.png -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html -[dashboard]: http://adjust.com diff --git a/doc/japanese/mixpanel.md b/doc/japanese/mixpanel.md deleted file mode 100644 index e833a1a82..000000000 --- a/doc/japanese/mixpanel.md +++ /dev/null @@ -1,27 +0,0 @@ -##adjustとMixpanel SDKの統合 - -Mixpanel APIは共通のプロパティを`super properties`としてすべてのアクティビティで送信できるよう登録できます。詳しくは[Mixpanel page][mixpanel_ios]でご確認いただけます。Mixpanelのトラッキングされるすべてのイベントとadjustを統合するには、アトリビューションデータを受け取った後に`super properties`を設定する必要があります。adjustのiOS SDKガイド[デリゲートコールバック][response_callbacks]章に従って実装してください。 -Mixpanel APIを使用するための関数は以下のように設定できます。 - -```objc -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { - Mixpanel *mixpanel = [Mixpanel sharedInstance]; - - // The adjust properties will be sent - // with all future track calls. - if (attribution.network != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Network": attribution.network}]; - if (attribution.campaign != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Campaign": attribution.campaign}]; - if (attribution.adgroup != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Adgroup": attribution.adgroup}]; - if (attribution.creative != nil) - [mixpanel registerSuperProperties:@{@"[Adjust]Creative": attribution.creative}]; -} -``` - -このインターフェイスを実装する前に、[データの取り扱いの状態][attribution_data]についてご確認ください。 - -[mixpanel_ios]: https://mixpanel.com/help/reference/ios#super-properties -[attribution_data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[response_callbacks]: https://github.com/adjust/ios_sdk#9-receive-delegate-callbacks diff --git a/doc/japanese/sdk-to-sdk/admob.md b/doc/japanese/sdk-to-sdk/admob.md deleted file mode 100644 index 6a7a72f60..000000000 --- a/doc/japanese/sdk-to-sdk/admob.md +++ /dev/null @@ -1,29 +0,0 @@ -# AdMobの広告収益をAdjust SDKで計測 - -[Adjust iOS SDK README][ios-readme] - -この機能に必須のSDKバージョン: - -- **Adjust SDK v4.29.0** - -Admob SDKで広告収益を計測する場合は、AdjustのSDK間連携の機能を使用することで、この情報をAdjustバックエンドに渡すことができます。これを行うには、記録する情報を含むAdjust広告収益オブジェクトを作成し、そのオブジェクトを`trackAdRevenue`メソッドに渡す必要があります。 - -> 注:Admobによる広告収益計測についてご質問がありましたら、担当のアカウントマネージャー、または[support@adjust.com](mailto:support@adjust.com)までお問い合わせください。 - -### サンプル - -```objc -- (void)requestRewardedAd { - self.rewardedAd = [[GADRewardedAd alloc] initWithAdUnitID:@"ad unit ID"]; - ViewController *strongSelf = weakSelf; - self.rewardedAd.paidEventHandler = ^void(GADAdValue *_Nonnull value) { - // ... - // send ad revenue info to Adjust - ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAdMob]; - [adRevenue setRevenue:value.value currency:value.currencyCode]; - [Adjust trackAdRevenue:adRevenue]; - } -}; -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/japanese/README.md diff --git a/doc/japanese/sdk-to-sdk/applovin-max.md b/doc/japanese/sdk-to-sdk/applovin-max.md deleted file mode 100644 index 34b4a685f..000000000 --- a/doc/japanese/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,28 +0,0 @@ -# AppLovin MAXの広告収益をAdjust SDKで計測 - -[Adjust iOS SDK README][ios-readme] - -この機能に必須のSDKバージョン: - -- **Adjust SDK v4.29.0** - -AppLovin MAX SDKで広告収益を計測する場合は、AdjustのSDK間連携の機能を使用することで、この情報をAdjustバックエンドに渡すことができます。これを行うには、記録する情報を含むAdjust広告収益オブジェクトを作成し、そのオブジェクトを`trackAdRevenue`メソッドに渡す必要があります。 - -> 注:AppLovin MAXによる広告収益計測についてご質問がありましたら、担当のアカウントマネージャー、または[support@adjust.com](mailto:support@adjust.com)までお問い合わせください。 - -### サンプル - -```objc -- (void)didPayRevenueForAd:(MAAd *)ad { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAppLovinMAX]; - - adjustAdRevenue.setRevenue(ad.revenue,"USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.networkName); - adjustAdRevenue.setAdRevenueUnit(ad.adUnitIdentifier); - adjustAdRevenue.setAdRevenuePlacement(ad.placement); - - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/japanese/README.md diff --git a/doc/japanese/sdk-to-sdk/ironsource.md b/doc/japanese/sdk-to-sdk/ironsource.md deleted file mode 100644 index db03c9559..000000000 --- a/doc/japanese/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# ironSourceの広告収益をAdjust SDKで計測 - -[Adjust iOS SDK README][ios-readme] - -この機能に必須のSDKバージョン: - -- **Adjust SDK v4.29.0** - -ironSource SDKで広告収益を計測する場合は、AdjustのSDK間連携の機能を使用することで、この情報をAdjustバックエンドに渡すことができます。 これを行うには、記録する情報を含むAdjust広告収益オブジェクトを作成し、そのオブジェクトを`trackAdRevenue`メソッドに渡す必要があります。 - -> 注:ironSourceによる広告収益計測についてご質問がありましたら、担当のアカウントマネージャー、または[support@adjust.com](mailto:support@adjust.com)までお問い合わせください。 - -### サンプル - -```objc -- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceIronSource]; - [adjustAdRevenue setRevenue:impressionData.revenue currency:@"USD"]; - // optional fields - [adjustAdRevenue setAdRevenueNetwork:impressionData.ad_network]; - [adjustAdRevenue setAdRevenueUnit:impressionData.ad_unit]; - [adjustAdRevenue setAdRevenuePlacement:impressionData.placement]; - // track Adjust ad revenue - [Adjust trackAdRevenue:adjustAdRevenue]; -} -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/japanese/README.md diff --git a/doc/japanese/sdk-to-sdk/mopub.md b/doc/japanese/sdk-to-sdk/mopub.md deleted file mode 100644 index 14aa72162..000000000 --- a/doc/japanese/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,34 +0,0 @@ -## MoPubの広告収益をAdjust SDKで計測 - -[Adjust iOS SDK README][ios-readme] - -[MoPub iOS documentation][mopub-docs] - -本機能には以下のSDKバージョンとそれ以降のバージョンが必須となります: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -**動画リワード広告**を表示している場合: MoPub SDKの`didTrackImpressionWithAdUnitID:impressionData:`コールバックメソッドの実装内で、以下のようにAdjust SDKの`trackAdRevenue:payload:`メソッドを呼び出す必要があります。 - -```objc -- (void)didTrackImpressionWithAdUnitID:(NSString *)adUnitID - impressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -**他の広告フォーマット**を表示している場合: MoPub SDKの`mopubAd:didTrackImpressionWithImpressionData:` コールバックメソッドの実装内で、以下のようにAdjust SDKの`trackAdRevenue:payload:` メソッドを呼び出す必要があります。 - -```objc -- (void)mopubAd:(id)ad didTrackImpressionWithImpressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -MoPub連携による広告収益計測についてご質問がございましたら、担当のアカウントマネージャーもしくはsupport@adjust.comまでお問い合わせください。 - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[ios-readme]: ../../japanese/README.md diff --git a/doc/japanese/sociomantic_plugin.md b/doc/japanese/sociomantic_plugin.md deleted file mode 100644 index 260c84cb2..000000000 --- a/doc/japanese/sociomantic_plugin.md +++ /dev/null @@ -1,446 +0,0 @@ -## Sociomanticプラグイン - -以下のいずれかの方法でadjustとSociomanticの統合が可能です。 - -### CocoaPods - -[CocoaPods](http://cocoapods.org/)をご利用の場合、Podfileに以下の記述を加えることができます。 - -```ruby -pod 'Adjust/Sociomantic' -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage)をご利用の場合、Cartfileに以下の記述を加えることができます。 - -```ruby -github "adjust/ios_sdk" "sociomantic" -``` - -### ソースファイル - -以下の手順でadjustとSociomanticのイベントを統合することもできます。 - -1. `plugin/Sociomantic`フォルダを[releases page](https://github.com/adjust/ios_sdk/releases)からダウンロードアーカイブに置いてください。 - -2. プロジェクトの`Adjust`フォルダに`ADJSociomantic.h`と`ADJSociomantic.m`ファイルをドラッグしてください。 - -3. `Choose options for adding these files`のダイアログが出たら、`Copy items if needed`にチェックを入れ、`Create groups`を選択してください。 - -### Sociomanticイベント - -以下の手順でadjustとSociomanticを統合することができます。 - -1. Sociomanticイベントのメソッドを利用でき、ディクショナリのプロパティ名として使う以下の変数も使えるようになります。 - - ```objc - NSString *const SCMCategory; - NSString *const SCMProductName; - NSString *const SCMSalePrice; - NSString *const SCMAmount; - NSString *const SCMCurrency; - NSString *const SCMProductURL; - NSString *const SCMProductImageURL; - NSString *const SCMBrand; - NSString *const SCMDescription; - NSString *const SCMTimestamp; - NSString *const SCMValidityTimestamp; - NSString *const SCMQuantity; - NSString *const SCMScore; - NSString *const SCMProductID; - NSString *const SCMAmount; - NSString *const SCMCurrency; - NSString *const SCMQuantity; - NSString *const SCMAmount; - NSString *const SCMCurrency; - NSString *const SCMActionConfirmed; - NSString *const SCMActionConfirmed; - NSString *const SCMCustomerAgeGroup; - NSString *const SCMCustomerEducation; - NSString *const SCMCustomerGender; - NSString *const SCMCustomerID; - NSString *const SCMCustomerMHash; - NSString *const SCMCustomerSegment; - NSString *const SCMCustomerTargeting; - ``` - -2. Sociomanticのイベントを送信する前に、以下のようにパートナーIDを設定する必要があります。 - - ```objc - #import "ADJSociomantic.h" - - [ADJSociomantic injectPartnerIdIntoSociomanticEvents:@"{sociomanticPartnerId}"]; - ``` - -3. これでSociomanticのイベントをそれぞれ統合できるようになりました。以下に例を示します。 - -#### カスタマーイベント - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:ANY_TOKEN]; -NSDictionary *customerData = @{ - SCMCustomerID: @"123456" -}; - -[ADJSociomantic injectCustomerDataIntoEvent:event withData:customerData]; -[Adjust trackEvent:event]; -``` - -#### View Home Page - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:HOMEPAGE_TOKEN]; - -[ADJSociomantic injectHomePageIntoEvent:event]; -[Adjust trackEvent:event]; -``` - -#### リスティング - -```objc -#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]; -``` - -#### プロダクト - -```objc -#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]; -``` -*Product Viewに使用できるプロダクトパラメータ一覧* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
パラメータ名条件説明備考
SCMCategory必須*プロダクトカテゴリ(entire category path)リスティングページまたはカテゴリのトラッキングコードから提供されるカテゴリ情報は、フィードまたはプロダクトページのトラッキングコードから提供されるカテゴリ情報と一致する必要があります。
SCMProductName必須*プロダクト名記号はエンコードできませんが、UTF-8で使用できます。HTMLマークアップは使用できません。
SCMSalePrice必須*セール価格 (小数 e.g. 2.99)小数点はドットを使ってください。カンマは使えません。
SCMAmount必須*通常価格 (小数 e.g. 3.99)小数点はドットを使ってください。カンマは使えません。
SCMCurrency必須*通貨コード(ISO 4217フォーマット e.g. EUR)決められた通貨コードが入ります。トラッキングコードサンプルでご確認いただけます。
SCMProductURL>必須*プロダクトURL (ディープリンク)有効なディープリンクを設定してください。Googleアナリティクス、Hurra、Eulerian等のクリックトラッキングパラメータを含まないディープリンクが理想的です。ディープリンクは http:// で始まるようにしてください。
SCMProductImageURL必須*プロダクト画像URL画像サイズにご注意ください。広告中に任意でつけられる画像は最小で 200x200 px で、同じアスペクト比である必要があります。
SCMBrand必須*プロダクトブランド記号はエンコードできませんが、UTF-8で使用できます(上記SCMProductNameと同様です)。HTMLマークアップは使用できません。
SCMDescription任意短い商品説明記号はエンコードできませんが、UTF-8で使用できます(上記SCMProductNameと同様です)。HTMLマークアップは使用できません。
SCMTimestamp任意プロダクト公開までのタイムスタンプ(GMT)訪問者が検索した日付を入力してください。NSNumberクラスでラップされたNSTimeInterval形式にしてください(例をご確認ください)。
SCMValidityTimestamp任意プロダクト公開までのタイムスタンプ(GMT)プロダクトが利用可能になるまでの時間をUnixタイムスタンプで入力してください。常に利用できるプロダクトには 0 を入力してください。NSNumberクラスでラップされたNSTimeInterval形式にしてください(SCMTimestampと同様です)。
SCMQuantity任意プロダクトの在庫数このフィールドはSociomanticの担当者にご相談いただいた上でご使用ください。
SCMScore任意プロダクトのプライオリティスコア(0 から 10.0 まで)このフィールドはSociomanticの担当者にご相談いただいた上でご使用ください。
- -\*フィードで設定されている場合は任意 - -どの設定を使うべきか不明瞭な場合は、Sociomanticのテクニカルアカウント担当にご相談ください。 - -#### カート - -```objc -#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]; -``` - -*Cart Viewに利用できるカートパラメータ一覧* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
パラメータ名条件説明備考
SCMProductID必須プロダクトIDカラーやサイズなどのサブIDを除いたプロダクトIDを入力してください。
SCMAmount任意価格(小数 e.g. 2.99)小数点はドットを使ってください。カンマは使えません。数量が1より大きい場合でも、プロダクト1つあたりの価格を入力してください。
SCMCurrency任意通貨コード(ISO 4217フォーマット e.g. EUR)決められた通貨コードが入ります。トラッキングコードサンプルでご確認いただけます。
SCMQuantity任意選択されたプロダクトの数量整数で入力してください。
- -#### 未確認のトランザクション - -```objc -#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]; -``` - -もしくは、以下のようにパラメータをつけることもできます。 - -```objc -#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]; -``` - -#### 確認済みトランザクション - -```objc -#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]; -``` - -もしくは、以下のようにパラメータをつけることもできます。 - -```objc -#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]; -``` - -*Transaction Viewに使用できるカートパラメータの一覧* - -カートパラメータを見る - -*Transaction Viewに使用できるトランザクションパラメータの一覧* - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
パラメータ名必須説明備考
SCMAmount任意価格(小数 e.g. 2.99)小数点はドットを使ってください。カンマは使えません。数量が1より大きい場合でも、プロダクト1つあたりの価格を入力してください。
SCMCurrency任意通貨コード(ISO 4217フォーマット e.g. EUR)決められた通貨コードが入ります。トラッキングコードサンプルでご確認いただけます。
SCMQuantity任意選択されたプロダクトの数量整数で入力してください。
- -#### リードイベント - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:LEAD_TOKEN]; - -[ADJSociomantic injectLeadIntoEvent:event leadID:@"123456789"]; -[Adjust trackEvent:event]; -``` - -確認済みリードには以下のように記述できます。 - -```objc -#import "ADJSociomantic.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:LEAD_TOKEN]; - -[ADJSociomantic injectLeadIntoEvent:event leadID:@"123456789" andConfirmed:YES]; -[Adjust trackEvent:event]; -``` diff --git a/doc/japanese/trademob_plugin.md b/doc/japanese/trademob_plugin.md deleted file mode 100644 index 7fa2d98ef..000000000 --- a/doc/japanese/trademob_plugin.md +++ /dev/null @@ -1,101 +0,0 @@ -## Trademobプラグイン - -以下のいずれかの方法でadjustとTrademobの統合が可能です。 - -### CocoaPods - -[CocoaPods](http://cocoapods.org/)をご利用の場合、Podfileに以下の記述を加えることができます。 - -```ruby -pod 'Adjust/Trademob' -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage)をご利用の場合、Cartfileに以下の記述を加えることができます。 - -```ruby -github "adjust/ios_sdk" "trademob" -``` - -### ソースファイル - -以下の手順でadjustとTrademobを統合することもできます。 - -2. `plugin/Trademob`フォルダを[releases page](https://github.com/adjust/ios_sdk/releases)からダウンロードアーカイブに置いてください。 - -2. プロジェクトの`Adjust`フォルダに`ADJTrademob.h`と`ADJTrademob.m`ファイルをドラッグしてください。 - -3. `Choose options for adding these files`のダイアログが出たら、`Copy items if needed`にチェックを入れ、`Create groups`を選択してください。 - -このプラグインについてご質問があれば、`eugenio.warglien@trademob.com`へご相談ください。 - -### Trademobイベント - -次の方法でTrademobのイベントを使うことができます。 - -#### リスティング - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"]; - -NSArray *itemIds = @[@"itemId1", @"itemId2", @"itemId3"]; - -NSDictionary *metadata = @{@"info1":@"value1", @"info2":@"value2"}; - -[ADJTrademob injectViewListingIntoEvent:event itemIds:itemIds metadata:metadata]; - -[Adjust trackEvent:event]; -``` - -#### アイテム - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewItemEventToken}"]; - -NSDictionary *metadata = @{@"info1":@"value1", @"info2":@"value2"}; - -[ADJTrademob injectViewItemIntoEvent:event itemId:@"itemId" metadata:metadata]; - -[Adjust trackEvent:event]; -``` - -#### バスケットに追加 - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{addToBasketEventToken}"]; - -ADJTrademobItem *item1 = [[ADJTrademobItem alloc] initWithId:@"itemId1" price:120.4 quantity:1]; -ADJTrademobItem *item2 = [[ADJTrademobItem alloc] initWithId:@"itemId2" price:20.1 quantity:4]; - -NSArray *items = @[item1, item2]; - -[ADJTrademob injectAddToBasketIntoEvent:event items:items metadata:nil]; - -[Adjust trackEvent:event]; -``` - -#### チェックアウト - -```objc -#import "ADJTrademob.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{checkoutEventToken}"]; - -ADJTrademobItem *item1 = [[ADJTrademobItem alloc] initWithId:@"itemId1" price:120.4 quantity:1]; -ADJTrademobItem *item2 = [[ADJTrademobItem alloc] initWithId:@"itemId2" price:20.1 quantity:4]; - -NSArray *items = @[item1, item2]; - -NSDictionary *metadata = @{@"info1":@"value1", @"info2":@"value2"}; - -[ADJTrademob injectCheckoutIntoEvent:event items:items metadata:metadata]; - -[Adjust trackEvent:event]; -``` diff --git a/doc/japanese/web_views.md b/doc/japanese/web_views.md deleted file mode 100644 index 562ccc707..000000000 --- a/doc/japanese/web_views.md +++ /dev/null @@ -1,524 +0,0 @@ -## 概要 - -これはWeb viewを使うiOSアプリのためのadjust.com™のiOS SDKガイドです。 -adjust.com™について詳しくは[adjust.com]をご覧ください。 - -[WebViewJavascriptBridge][web_view_js_bridge]プラグインを使って -JavascriptからネイティブObjective-Cのコールへのブリッジ(その逆も同様です)を提供します。 -このプラグインは`MITライセンス`が適用されています。 - -## 目次 - -* [基本的な統合](#basic-integration) - * [ネイティブadjust iOS SDKの追加](#native-add) - * [プロジェクトへのAdjustBridgeの追加](#bridge-add) - * [アプリへのAdjustBridgeの統合](#bridge-integrate-app) - * [Web viewへのAdjustBridgeの統合](#bridge-integrate-web) - * [基本設定](#basic-setup) - * [AdjustBridgeログ](#bridge-logging) - * [アプリのビルド](#build-the-app) -* [追加機能](#additional-features) - * [イベントトラッキング](#event-tracking) - * [収益トラッキング](#revenue-tracking) - * [コールバックパラメータ](#callback-parameters) - * [パートナーパラメータ](#partner-parameters) - * [アトリビューションコールバック](#attribution-callback) - * [イベントとセッションのコールバック](#event-session-callbacks) - * [イベントバッファリング](#event-buffering) - * [トラッキングの無効化](#disable-tracking) - * [オフラインモード](#offline-mode) - * [バックグラウンドでのトラッキング](#background-tracking) - * [デバイスID](#device-ids) - * [ディープリンキング](#deeplinking) - * [ディファート・ディープリンクのコールバック](#deferred-deeplinking-callback) -* [ライセンス](#license) - -## 基本的な統合 - -### ネイティブadjust iOS SDKの追加 - -Web viewでadjust SDKを使うには、アプリにadjustのネイティブiOS SDKを追加する必要があります。adjustのネイティブiOS SDKをインストールするには、[iOS SDK README][basic_integration]の「基本的な統合」をご参照ください。 - -### プロジェクトへのAdjustBridgeの追加 - -Xcodeのプロジェクトナビゲータから`Supporting Files`グループを探してください。もしくは他のグループでも構いません。Finderからそのグループに`AdjustBridge`のディレクトリをドラッグしてください。 - -![][bridge_drag] - -`Choose options for adding these files`のダイアログが出てきたら、必ず`Copy items into destination group's folder`にチェックを入れ、上のラジオボタン`Create groups for any added folders`を選択してください。 - -![][bridge_add] - -### 3. アプリへのAdjustBridgeの統合 - -プロジェクトナビゲータからView Controllerのソースファイルを開いてください。ファイル最上部に`import`の記述を追加してください。Web Viewデリゲートの`viewDidLoad`か`viewWillAppear`のメソッドで次の`AdjustBridge`のコールを追加してください。 - -```objc -#import "AdjustBridge.h" -// or #import - -- (void)viewWillAppear:(BOOL)animated { - WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - [self.adjustBridge loadWKWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; -} - -// ... -``` - -![][bridge_init_objc] - -### Web viewへのAdjustBridgeの統合 - -Web viewでJavascriptのブリッジを使うには、`WebViewJavascriptBridge`プラグインのように設定する必要があります。 -[README][wvjsb_readme]のセクション4で紹介されています。以下のJavascriptコードを追加して、adjustのiOS web bridgeを初期化してください。 - -```js -function setupWebViewJavascriptBridge(callback) { - if (window.WebViewJavascriptBridge) { - return callback(WebViewJavascriptBridge); - } - - if (window.WVJBCallbacks) { - return window.WVJBCallbacks.push(callback); - } - - window.WVJBCallbacks = [callback]; - - var WVJBIframe = document.createElement('iframe'); - WVJBIframe.style.display = 'none'; - WVJBIframe.src = 'wvjbscheme://__BRIDGE_LOADED__'; - document.documentElement.appendChild(WVJBIframe); - - setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0) -} - -setupWebViewJavascriptBridge(function(bridge) { - // AdjustBridge initialisation will be added in this method. -}) -``` - -![][bridge_init_js] - -### 基本設定 - -同じHTMLファイルから、`setupWebViewJavascriptBridge`コールバック内でAdjust SDKを初期化してください。 - -```js -setupWebViewJavascriptBridge(function(bridge) { - // ... - - var yourAppToken = yourAppToken; - var environment = AdjustConfig.EnvironmentSandbox; - var adjustConfig = new AdjustConfig(yourAppToken, environment); - - Adjust.appDidLaunch(adjustConfig); - - // ... -}); -``` - -**注**: Adjust SDKをこの手順に沿って初期化することが非常に重要です。この方法をとらない場合、問題が発生するおそれがありますのでご注意ください。 - -`yourAppToken` にアプリトークンを入れてください。これはAdjust管理画面で確認することができます。 - -テスト用かあるいは本番用かによって、environmentを以下のいずれかの値に設定してください。 - -```js -var environment = AdjustConfig.EnvironmentSandbox; -var environment = AdjustConfig.EnvironmentProduction; -``` - -**重要**: この値はアプリをテストしている時に限り`AdjustConfig.EnvironmentSandbox` に設定する必要があります。 アプリを提出する前に、`AdjustConfig.EnvironmentProduction` になっていることを確認 -してください。 再び開発しテストをする時に`AdjustConfig.EnvironmentSandbox`に戻してください。 - -Adjustはこのenvironmentを使って実際のトラフィックとテストのトラフィックを判別しています。 この値は常に正しく設定することが重要です。収益データをトラッキングする際は特にご留意ください。 - -### AdjustBridgeログ - -`AdjustConfig`インスタンスの`setLogLevel:`に設定するパラメータを変更することによって記録するログのレベルを調節できます。 -パラメータは以下の種類があります。 - -```objc -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose) // すべてのログを有効にする -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug) // より詳細なログを記録する -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo) // デフォルト -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn) // infoのログを無効にする -adjustConfig.setLogLevel(AdjustConfig.LogLevelError) // warningも無効にする -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert) // errorも無効にする -``` - -### アプリのビルド - -アプリをビルドしてRunしてください。成功したら、コンソールに出力されるSDKのログをよく見てみてください。アプリが初めて立ち上がった後、infoログ`Install tracked`が出力されているはずです。 - -![][bridge_install_tracked] - -## 追加機能 - -プロジェクトにadjust SDKを統合すると、次の機能を利用できるようになります。 - -### イベントトラッキング - -adjustを使ってイベントトラッキングができます。ここではあるボタンのタップを毎回トラックしたい場合について説明します。 -[dashboard]にてイベントトークンを作成し、そのイベントトークンは仮に`abc123`というイベントトークンと関連しているとします。 -タップをトラックするため、ボタンの`onclick`メソッドに以下のような記述を追加します。 - -```js -var adjustEvent = new AdjustEvent('abc123') -Adjust.trackEvent(adjustEvent) -``` - -こうすると、ボタンがタップされた時にログに`Event tracked`と出力されるようになります。 - -このイベントインスタンスはトラッキング前のイベントを設定するためにも使えます。 - -#### 収益のトラッキング - -広告をタップした時やアプリ内課金をした時などにユーザーが報酬を得る仕組みであれば、そういったイベントもトラッキングできます。 -1回のタップで1ユーロセントの報酬と仮定すると、報酬イベントは以下のようになります。 - -```js -var adjustEvent = new AdjustEvent('abc123') -adjustEvent.setRevenue(0.01, 'EUR') - -Adjust.trackEvent(adjustEvent) -``` - -もちろんこれはコールバックパラメータと紐付けることができます。 - -通貨トークンを設定する場合、adjustは自動的に収益を任意の報酬に変換します。 -更に詳しくは[通貨の変換][currency-conversion]をご覧ください。 - -収益とイベントトラッキングについては[イベントトラッキングガイド]もご参照ください。 - -#### コールバックパラメータ - -[dashboard]でイベントにコールバックURLを登録することができます。イベントがトラッキングされるたびにそのURLにGETリクエストが送信されます。 -トラッキングする前にイベントで`addCallbackParameter`をコールすることによって、イベントにコールバックパラメータを追加できます。 -そうして追加されたパラメータはコールバックURLに送られます。 - -例えば、コールバックURLに`http://www.adjust.com/callback`を登録した場合、イベントトラッキングは以下のようになります。 - -```js -var adjustEvent = new AdjustEvent('abc123') -adjustEvent.addCallbackParameter('key', 'value') -adjustEvent.addCallbackParameter('foo', 'bar') - -Adjust.trackEvent(adjustEvent) -``` - -この場合、adjustはイベントをトラックし以下にリクエストを送信します。 - - http://www.adjust.com/callback?key=value&foo=bar - -adjustは様々なプレースホルダーをサポートしています。例えば`{idfa}`はパラメータの値として使うことができます。 -コールバックではこのプレースホルダーは広告主向けの端末のIDで置き換えられることになります。 -カスタムパラメータは格納しませんが、コールバックに付け加えます。 -イベントにコールバックを登録していない場合は、パラメータは使用されません。 - -URLコールバックについて、使用可能な値の一覧など詳しくは[コールバックガイド][callbacks-guide]をご参照ください。 - -#### パートナーパラメータ - -adjustのダッシュボード上で有効化されている統合のために、ネットワークパートナーに送信するパラメータを設定することができます。 - -これは上記のコールバックパラメータと同様に機能しますが、 -`AdjustEvent`インスタンスの`addPartnerParameter`メソッドをコールすることにより追加されます。 - -```js -var adjustEvent = new AdjustEvent('abc123') -adjustEvent.addPartnerParameter('key', 'value') -adjustEvent.addPartnerParameter('foo', 'bar') - -Adjust.trackEvent(adjustEvent) -``` - -スペシャルパートナーとその統合について詳しくは[guide to special partners][special-partners]をご覧ください。 - -### アトリビューションコールバック - -アトリビューションが変更された時に通知を受け取れるよう、コールバックを登録することができます。 -アトリビューションはいくつかのソースがあり得るため、変更の発生と同時に通知を受けることはできません。 - -[アトリビューションデータに関する方針][attribution-data]を必ずご確認ください。 - -コールバックメソッドは`AdjustConfig`インスタンスを使って設定されますので、`Adjust.appDidLaunch(adjustConfig)` -をコールする前に`setAttributionCallback`をコールしてください。 - -```js -adjustConfig.setAttributionCallback(function(attribution) { - // In this example, we're just displaying alert with attribution content. - alert('Tracker token = ' + attribution.trackerToken + '\n' + - 'Tracker name = ' + attribution.trackerName + '\n' + - 'Network = ' + attribution.network + '\n' + - 'Campaign = ' + attribution.campaign + '\n' + - 'Adgroup = ' + attribution.adgroup + '\n' + - 'Creative = ' + attribution.creative + '\n' + - 'Click label = ' + attribution.clickLabel) -}) -``` - -コールバックメソッドはSDKが最終のアトリビューションデータを受け取ったときに呼び出されます。 -コールバック内で`attribution`パラメータへのアクセスができます。以下にプロパティを簡単に紹介します。 - -- `var trackerToken` 最新インストールのトラッカートークン -- `var trackerName` 最新インストールのトラッカー名 -- `var network` 最新インストールのネットワークのグループ階層 -- `var campaign` 最新インストールのキャンペーンのグループ階層 -- `var adgroup` 最新インストールのアドグループのグループ階層 -- `var creative` 最新インストールのクリエイティブのグループ階層 -- `var clickLabel` 最新インストールのクリックラベル - -### イベントとセッションのコールバック - -イベントやセッションがトラッキングされた際に通知を受け取れるよう、リスナを登録することができます。 -リスナには4種類あり、成功したイベント、失敗したイベント、成功したセッション、失敗したセッションをそれぞれトラッキングします。 - -成功したイベントへのコールバックメソッドを以下のように実装してください。 - -```js -adjustConfig.setEventSuccessCallback(function(eventSuccess) { - // ... -}) -``` - -失敗したイベントへは以下のように実装してください。 - -```js -adjustConfig.setEventFailureCallback(function(eventFailure) { - // ... -}) -``` - -同様に、成功したセッション - -```js -adjustConfig.setSessionSuccessCallback(function(sessionSuccess) { - // ... -}) -``` - -失敗したセッション - -```js -adjustConfig.setSessionFailureCallback(function(sessionFailure) { - // ... -}) -``` - -コールバックメソッドはSDKがサーバーにデータ送信を試みた後で呼ばれます。 -コールバック内で該当のコールバックのレスポンスのデータオブジェクトにアクセスができます。 -レスポンスデータのプロパティを以下に簡単に紹介します。 - -- `var message` サーバーからのメッセージまたはSDKのエラーログ -- `var timeStamp` サーバーからのタイムスタンプ -- `var adid` adjustから提供されるユニークデバイスID -- `var jsonResponse` サーバーからのレスポンスのJSONオブジェクト - -どちらのイベントレスポンスのオブジェクトも以下を含みます。 - -- `var eventToken` イベントトークン。イベントがトラッキングされた場合 - -イベントとセッション両方の失敗した場合のオブジェクトは以下を含みます。 - -- `var willRetry` しばらく後に再送を試みる予定であるかどうかを示します。 - -### イベントバッファリング - -イベントトラッキングを多用する場合は、HTTPリクエストを遅らせて1分毎にまとめて送信したほうがいい場合があります。 -その場合は、`AdjustConfig`インスタンスでイベントバッファリングを有効にしてください。 - -```js -adjustConfig.setEventBufferingEnabled(true) -``` - -### トラッキングの無効化 - -`setEnabled`にパラメータ`false`を渡すことで、adjust SDKが行うデバイスのアクティビティのトラッキングをすべて無効にすることができます。 -**この設定はセッション間で記憶されます** 最初のセッションの後でしか有効化できません。 - -```js -Adjust.setEnabled(false) -``` - -adjust SDKが現在有効かどうか、`isEnabled`関数を呼び出せば確認できます。 -また、`setEnabled`関数に`true`を渡せば、adjust SDKを有効にすることができます。 - -```js -Adjust.isEnabled(function(isEnabled) { - if (isEnabled) { - // SDK is enabled. - } else { - // SDK is disabled. - } -}) -``` - -### オフラインモード - -adjustのサーバーへの送信を一時停止し、保持されているトラッキングデータを後から送信するために -adjust SDKをオフラインモードにすることができます。 -オフラインモード中はすべての情報がファイルに保存されるので、イベントをたくさん発生させすぎないようにご注意ください。 - -`true`パラメータで`setOfflineMode`を呼び出すとオフラインモードを有効にできます。 - -```js -Adjust.setOfflineMode(true) -``` - -反対に、`false`パラメータで`setOfflineMode`を呼び出せばオフラインモードを解除できます。 -adjust SDKがオンラインモードに戻った時、保存されていた情報は正しいタイムスタンプでadjustのサーバーに送られます。 - -トラッキングの無効化とは異なり、この設定はセッション間で*記憶されません*。 -オフラインモード時にアプリを終了しても、次に起動した時にはオンラインモードとしてアプリが起動します。 - -### バックグラウンドでのトラッキング - -adjust SDKはデフォルドではアプリがバックグラウンドにある時はHTTPリクエストを停止します。 -この設定は`AdjustConfig`インスタンスで変更できます。 - -```js -adjustConfig.setSendInBackground(true) -``` - -### デバイスID - -Google Analyticsなどの一部のサービスでは、レポートの重複を防ぐためにデバイスIDとクライアントIDを連携させることが求められます。 - -デバイスID IDFAを取得するには、`getIdfa`関数をコールしてください。 - -```js -Adjust.getIdfa(function(idfa) { - // ... -}); -``` - -### ディープリンキング - -カスタムURLスキームからアプリを開けるよう、adjust SDKでディープリンクを設定することができます。 - -ディープリンクを使ったリターゲティングやリエンゲージメントを想定している場合、 -ディープリンクにadjustキャンペーンの特定のパラメータを置く必要があります。 -ディープリンクを使ったリターゲティングやリエンゲージメントについて詳しくは[公式資料][reattribution-deeplinks]をご覧ください。 - -プロジェクトナビゲータからApplication Delegateのソースファイルを開いてください。 -`openURL`と`application:continueUserActivity:restorationHandler:`があればそこに、なければこれらを追加し、 -`AdjustBridge`への参照を追加してください。この参照はWeb viewを表示するView Controllerにあるはずです。 - -```objc -#import "Adjust.h" -// Or #import -// (depends on the way you have chosen to add our native iOS SDK) -// ... - -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - // This is how AdjustBridge is accessed in our example app. - // Of course, you can choose on your own how to access it. - [self.uiWebViewExampleController.adjustBridge sendDeeplinkToWebView:url]; - - // Your logic whether URL should be opened or not. - BOOL shouldOpen = [self yourLogic:url]; - - return shouldOpen; -} - -// ... - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - [self.uiWebViewExampleController.adjustBridge sendDeeplinkToWebView:[userActivity webpageURL]]; - } - - // Your logic whether URL should be opened or not. - BOOL shouldOpen = [self yourLogic:url]; - - return shouldOpen; -} -``` - -両方のメソッドにこのコールを追加すると、iOS 8以下(旧カスタムURLスキームを使用しているバージョン)とiOS 9以降(`ユニバーサルリンク`を使用)の両方に対応します。 - -**重要** ユニバーサルリンクを有効化するために、ネイティブiOS SDK READMEより[ユニバーサルリンクガイド][ios_sdk_ulinks]をご確認ください。 - -ディープリンクURLをWeb viewに返送するには、`deeplink`ブリッジにメソッドを登録してください。 -このメソッドは、ディープリンク情報のついたトラッカーURLをクリックした後にアプリが開かれると、adjust SDKによって呼ばれます。 - -```js -setupWebViewJavascriptBridge(function(bridge) { - bridge.registerHandler('deeplink', function(data, responseCallback) { - // In this example, we're just displaying alert with deeplink URL content. - alert('Deeplink:\n' + data) - }) -}) -``` - -#### ディファート・ディープリンクのコールバック - -Deferredディープリンクが開く前に通知を受けるデリゲートコールバックを登録し、adjust SDKがそれを開くかどうか決めることができます。 - -このコールバックは`AdjustConfig`でも設定されます。 - -```js -adjustConfig.setDeferredDeeplinkCallback(function(deferredDeeplink) { - // In this example, we're just displaying alert with deferred deeplink URL content. - alert('Deferred deeplink:\n' + deferredDeeplink) -}) -``` - -このコールバック関数は、SDKがサーバーからディファード・ディープリンクを受け取った後、SDKがそれを開く前に呼ばれます。 - -`AdjustConfig`インスタンスでは他にも、adjust SDKにこのリンクを開くかどうか指示できる設定があります。 -これは`setOpenDeferredDeeplink`メソッドを呼び出して設定できます。 - -```js -adjustConfig.setOpenDeferredDeeplink(true) -// Or if you don't want our SDK to open the link: -adjustConfig.setOpenDeferredDeeplink(false) -``` - -これを指定しなければ、デフォルトではadjust SDKはリンクを開こうとします。 - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[wvjsb_readme]: https://github.com/marcuswestin/WebViewJavascriptBridge#usage -[ios_sdk_ulinks]: https://github.com/adjust/ios_sdk/#universal-links -[callbacks-guide]: https://docs.adjust.com/en/callbacks -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[special-partners]: https://docs.adjust.com/en/special-partners -[basic_integration]: https://github.com/adjust/ios_sdk/#basic-integration -[web_view_js_bridge]: https://github.com/marcuswestin/WebViewJavascriptBridge -[currency-conversion]: https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies -[event-tracking-guide]: https://docs.adjust.com/en/event-tracking/#reference-tracking-purchases-and-revenues -[reattribution-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link - -[bridge_add]: https://raw.githubusercontent.com/adjust/sdks/master/Resources/ios/bridge/bridge_add.png -[bridge_drag]: https://raw.githubusercontent.com/adjust/sdks/master/Resources/ios/bridge/bridge_drag.png -[bridge_init_js]: https://raw.githubusercontent.com/adjust/sdks/master/Resources/ios/bridge/bridge_init_js.png -[bridge_init_objc]: https://raw.githubusercontent.com/adjust/sdks/master/Resources/ios/bridge/bridge_init_objc.png -[bridge_init_js_xcode]: https://raw.githubusercontent.com/adjust/sdks/master/Resources/ios/bridge/bridge_init_js_xcode.png -[bridge_install_tracked]: https://raw.githubusercontent.com/adjust/sdks/master/Resources/ios/bridge/bridge_install_tracked.png - -## ライセンス - -adjust SDKはMITライセンスを適用しています。 - -Copyright (c) 2012-2016 adjust GmbH, -http://www.adjust.com - -以下に定める条件に従い、本ソフトウェアおよび関連文書のファイル(以下「ソフトウェア」)の複製を取得するすべての人に対し、 -ソフトウェアを無制限に扱うことを無償で許可します。これには、ソフトウェアの複製を使用、複写、変更、結合、掲載、頒布、サブライセンス、 -および/または販売する権利、およびソフトウェアを提供する相手に同じことを許可する権利も無制限に含まれます。 - -上記の著作権表示および本許諾表示を、ソフトウェアのすべての複製または重要な部分に記載するものとします。 - -ソフトウェアは「現状のまま」で、明示であるか暗黙であるかを問わず、何らの保証もなく提供されます。 -ここでいう保証とは、商品性、特定の目的への適合性、および権利非侵害についての保証も含みますが、それに限定されるものではありません。 -作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、 -あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。 diff --git a/doc/korean/README.md b/doc/korean/README.md deleted file mode 100644 index b72824159..000000000 --- a/doc/korean/README.md +++ /dev/null @@ -1,1357 +0,0 @@ -**본 가이드는 만료되었습니다.** - -본 README 파일은 얼마 후 만료될 예정입니다. 당사 헬프 센터에서 SDK 문서를 열람하실 수 있습니다. - -* [English][en-helpcenter] -* [中文][zh-helpcenter] -* [日本語][ja-helpcenter] -* [한국어][ko-helpcenter] - -## 요약 - -Adjust™의 iOS SDK에 관한 문서입니다. [adjust.com]에서 Adjust™에 대한 정보를 더 자세히 알아보세요. - -앱이 Web view 를 사용하며, 자바스크립트 코드를 통해 Adjust 추적을 사용하려는 경우, [iOS 웹 보기 SDK 가이드][ios-web-views-guide]를 참조하세요. - -다른 언어로 읽기: [English][en-readme], [中文][zh-readme], [日本語][ja-readme], [한국어][ko-readme]. - -## 목차 - -* [앱 예시](#example-apps) -* [기본 연동](#basic-integration) - * [프로젝트에 SDK 추가](#sdk-add) - * [iOS 프레임워크 추가](#sdk-frameworks) - * [앱에 SDK 연동](#sdk-integrate) - * [기본 설정](#basic-setup) - * [iMessage용 설정](#basic-setup-imessage) - * [Adjust 로](#adjust-logging) - * [앱 빌드하기](#build-the-app) -* [부가 기능](#additional-feature) - * [AppTrackingTransparency framework](#att-framework) - * [App-tracking authorisation wrapper](#ata-wrapper) - * [현재 승인 상태 확인](#ata-getter) - * [SKAdNetwork framework](#skadn-framework) - * [SKAdNetwork 전환값 업데이트](#skadn-update-conversion-value) - * [전환값 업데이트 콜백](#skadn-cv-updated-callback) - * [이벤트 추적](#event-tracking) - * [매출 추적](#revenue-tracking) - * [매출 중복 제거](#revenue-deduplication) - * [인앱 결제 검증](#iap-verification) - * [콜백 파라미터](#callback-parameters) - * [파트너 파라미터](#partner-parameters) - * [콜백 ID](#callback-id) - * [세션 파라미터](#session-parameters) - * [세션 콜백 파라미터](#session-callback-parameters) - * [세션 파트너 파라미터](#session-partner-parameters) - * [지연 시작](#delay-start) - * [어트리뷰션 콜백](#attribution-callback) - * [광고 매출 트래킹](#ad-revenue) - * [구독 트래킹](#subscriptions) - * [이벤트 및 세션 콜백](#event-session-callbacks) - * [추적 비활성화](#disable-tracking) - * [오프라인 모드](#offline-mode) - * [이벤트 버퍼링](#event-buffering) - * [GDPR 잊혀질 권리(Right to be Forgotten)](#gdpr-forget-me) - * [서드파티 공유](#third-party-sharing) - * [타사 공유 비활성화](#disable-third-party-sharing) - * [서드 파티 공유 활성화](#enable-third-party-sharing) - * [동의 측정](#measurement-consent) - * [SDK 서명](#sdk-signature) - * [백그라운드 추적](#background-tracking) - * [기기 ID](#device-ids) - * [iOS 광고 식별자](#di-idfa) - * [Adjust 기기 식별자](#af-adid) - * [사용자 어트리뷰션](#user-attribution) - * [푸시 토큰](#push-token) - * [사전 설치 트래커](#pre-installed-trackers) - * [딥링크](#deeplinking) - * [표준 딥링크 시나리오](#deeplinking-standard) - * [iOS 8 이전 버전에서의 딥링크](#deeplinking-setup-old) - * [iOS 9 이후 버전에서의 딥링크](#deeplinking-setup-new) - * [지연 딥링크(deferred deeplink) 시나리오](#deeplinking-deferred) - * [딥링크를 통한 리어트리뷰션( reattribution)](#deeplinking-reattribution) - * [Link resolution](#link-resolution) - * [베타 Data residency](#data-residency) -* [문제 해결](#troubleshooting) - * [지연 SDK 초기화 관련 문제](#ts-delayed-init) - * ["Adjust의 ARC 요구" 오류가 발생한 경우](#ts-arc) - * ["\[UIDevice adjTrackingEnabled\]: 인스턴스에 미식별 선택자 전송" 오류가 발생한 경우](#ts-categories) - * ["세션 실패(너무 빈번한 세션 거부 )" 오류가 발생한 경우](#ts-session-failed) - * [로그에 "설치 추적"이 기록되지 않은 경우](#ts-install-tracked) - * ["부정확한 출처의 SDK 클릭 무시" 메시지가 나타난 경우](#ts-iad-sdk-click) - * [Adjust 대시보드에서 부정확한 매출 데이터를 발견한 경우](#ts-wrong-revenue-amount) -* [라이선스](#license) - -## 예시 앱 - -[`iOS(Objective-C)`][example-ios-objc], [`iOS(Swift)`][example-ios-swift], [`tvOS`][example-tvos], [`iMessage`][example-imessage] 및 [`Apple Watch`][example-iwatch]에 대한 [`예시` 디렉토리][examples]에서 앱 예시를 확인할 수 있습니다. Xcode 프로젝트를 실행하여 Adjust SDK의 연동 과정에 대한 사례를 살펴보세요. - -## 기본 연동 - -iOS 개발용 Xcode를 사용한다는 가정하에 iOS 프로젝트에 Adjust SDK를 연동하는 방법을 설명합니다. - -### 프로젝트에 SDK 추가 - -[CocoaPods][cocoapods]를 사용하는 경우, 다음 내용을 `Podfile`에 추가한 후 [해당 단계](#sdk-integrate)를 완료하세요. - -```ruby -pod `Adjust`, `~> 4.31.0` -``` - -또는: - -```ruby -pod 'Adjust', :git => 'https://github.com/adjust/ios_sdk.git', :tag => 'v4.31.0' -``` - ---- - -[Carthage][carthage]를 사용하는 경우, 다음 내용을 `Cartfile`에 추가한 후 [해당 단계](#sdk-frameworks)를 완료하세요. - -```ruby -github "adjust/ios_sdk" -``` - ---- - -Swift Package Manager를 사용한다면 리포지토리 주소를 직접 Xcode에 추가(File > Swift Packages > Add Package Dependency)하고 [이 단계](#sdk-frameworks)로 넘어갈 수 있습니다: - -``` -https://github.com/adjust/ios_sdk -``` - ---- - -프로젝트에 Adjust SDK를 프레임워크로 추가하여 연동할 수도 있습니다. [릴리스 페이지][releases]에서 다음 항목을 확인해 보세요. - -* `AdjustSdkStatic.framework.zip` -* `AdjustSdkDynamic.framework.zip` -* `AdjustSdkTv.framework.zip` -* `AdjustSdkIm.framework.zip` - -Apple은 iOS 8을 출시한 후, 임베디드 프레임워크로도 잘 알려진 동적 프레임워크(dynamic frameworks)를 도입했습니다. 앱이 iOS 8 이상 버전을 타겟팅하는 경우에는 Adjust SDK 동적 프레임워크를 사용할 수 있습니다. 필요에 따라 정적(static) 또는 동적(dynamic) 프레임워크를 선택하여 프로젝트에 추가하세요. - -`tvOS`앱의 경우, `AdjustSdkTv.framework.zip` 자료에서 추출 가능한 tvOS 프레임워크와 함께 Adjust SDK를 활용할 수 있습니다. - -`iMessage`앱의 경우, `AdjustSdkIm.framework.zip` 아카이브에서 추출 가능한 IM 프레임워크와 함께 Adjust SDK를 활용할 수 있습니다. - -### iOS 프레임워크 추가 - -추가 iOS 프레임워크를 앱에 연결할 경우 애드저스트 SDK가 추가 정보를 얻을 수 있습니다. 애드저스트 SDK 기능을 활성화하려는 경우 앱의 SDK 기능 유무에 따라 다음의 프레임워크를 추가하고 이를 선택으로 설정하시기 바랍니다. - -- `AdSupport.framework` - SDK가 IDFA 값 및 (iOS 14 이전 버전) LAT 정보에 액세스하려면 이 프레임워크가 필요합니다. -- `iAd.framework` - SDK가 실행 중인 ASA 캠페인에 대한 속성을 자동으로 처리하려면 이 프레임워크가 필요합니다. -- `AdServices.framework` - iOS 14.3 및 이상을 사용하는 기기에서 이 프레임워크는 SDK가 자동으로 ASA 캠페인에 대한 어트리뷰션을 처리하도록 허용합니다. Apple Ads Attribution API를 사용하는 경우 필요합니다. -- `CoreTelephony.framework` - SDK가 현재의 무선 액세스 기술을 결정하려면 이 프레임워크가 필요합니다. -- `StoreKit.framework` - `SKAdNetwork` 프레임워크에 액세스하고 Adjust SDK가 iOS 14 및 이후 버전에서 통신을 자동으로 처리하려면 이 프레임워크가 필요합니다. -- `AppTrackingTransparency.framework` - iOS 14 및 이후 버전에서 SDK가 사용자의 추적 동의 다이얼로그를 래핑하고, 추적 여부에 대한 사용자의 동의 값에 대한 액세스를 위해 이 프레임워크가 필요합니다. - -### 앱에 SDK 연동하기 - -Pod 리포지토리를 통해 Adjust SDK를 추가했다면, 다음 import 명령어 중 하나를 실행해야 합니다. - -```objc -#"Adjust.h"가져오기 -``` - -또는 - -```objc -#import -``` - ---- - -Adjust SDK를 static/dynamic 프레임워크로 추가했거나 Carthage를 통해 등록했다면, 다음 import 명령어 중 하나를 실행해야 합니다. - -```objc -#import -``` - ---- - -tvOS 앱에서 Adjust SDK를 사용하는 경우, 다음 import 명령어 중 하나를 실행해야 합니다. - -```objc -#import -``` - ---- - -iMessage 앱에서 Adjust SDK를 사용하는 경우, 다음 가져오기 명령어 중 하나를 실행해야 합니다. - -```objc -#import -``` - -다음으로는 기본 세션 추적을 설정하겠습니다. - -### 기본 설정 - -Project Navigator에서 애플리케이션 delegate 의 소스 파일을 실행합니다. `import` 명령어를 파일 상단에 추가한 후, 다음 콜을 앱 delegate 의 `didFinishLaunching` 또는 `didFinishLaunchingWithOptions` 메서드 내 `Adjust`에 추가합니다. - -```objc -#"Adjust.h"가져오기 -// 또는 #import -// 또는 #import -// 또는 #import -// 또는 #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -![][delegate] - -**참고**: Adjust SDK 초기화는 `아주 중요한` 단계입니다. 제대로 완료하지 않으면 [문제 해결 섹션](#ts-delayed-init)에서 설명하는 다양한 문제가 발생할 수 있습니다. - -`{YourAppToken}`을 사용 중인 앱 토큰으로 교체한 다음, [Dashboard]에서 결과를 확인해 보세요. - -테스트 또는 배포 등 어떤 목적으로 앱을 빌드하는에 따라 다음 두 값 중 하나의 `Environment(환경)`으로 설정해야 합니다. - -```objc -NSString *environment = ADJEnvironmentSandbox; -NSString *environment = ADJEnvironmentProduction; -``` - -**중요:** 앱을 테스트해야 하는 경우, 해당 값을 `ADJEnvironmentSandbox`로 설정해야 합니다. 앱을 퍼블리시할 준비가 완료되면 환경 설정을 `ADJEnvironmentProduction`으로 변경하고, 앱 개발 및 테스트를 새로 시작한다면 `ADJEnvironmentSandbox`로 다시 설정하세요. - -테스트 기기로 인해 발생하는 테스트 트래픽과 실제 트래픽을 구분하기 위해 다른 환경을 사용하고 있으니, 상황에 알맞은 설정을 적용하시기 바랍니다. 이는 매출을 추적하는 경우에 특히 중요합니다. - -### iMessage 전용 설정 - -**소스에서 SDK 추가:** **소스에서** Adjust SDK를 iMessage 앱에 추가하기로 선택한 경우, iMessage 프로젝트 설정에 프리 프로세서 매크로 **ADJUST_IM=1**이 설정되어 있는지 확인하세요. - -**Framework(프레임워크)로 SDK 추가:** iMessage 앱에 `AdjustSdkIm.framework`를 추가했다면, `Build Phases` 프로젝트 설정에 `New Copy Files Phase`를 추가하고 `AdjustSdkIm.framework`가 `Frameworks` 폴더로 복사되도록 선택했는지 확인하세요. - -**세션 추적:** iMessage 에서 세션 추적을 원활하게 실행하고 싶다면, 추가적인 연동 과정을 거쳐야 합니다. 표준 iOS 앱의 경우 Adjust SDK에서 iOS 시스템 알림을 자동으로 수신하기 때문에 Adjust가 앱의 세션 정보를 파악할 수 있으나, iMessage 앱의 경우에는 그렇지 않습니다. 따라서 explicit call(명시적인 콜)을 iMessage 앱 뷰 컨트롤러 내부의 `trackSubsessionStart`와 `trackSubsessionEnd` method(매서드)에 추가해야 Adjust SDK에서 앱이foreground에 있는지 여부를 추적할 수 있습니다. - -`didBecomeActiveWithConversation:` 메서드 내부의 `trackSubsessionStart`에 콜을 추가합니다. - -```objc --(void)didBecomeActiveWithConversation:(MSConversation *)conversation { - // 확장이 비활성에서 활성 상태로 이동하면 호출됨. - // 확장이 UI를 표시하려고 할 때 발생함. - // 확장을 구성하고 이전에 저장된 상태를 복구하려면 이 메서드를 사용하시기 바랍니다. - - [Adjust trackSubsessionStart]; -} -``` - -`willResignActiveWithConversation:` 메서드 내부의 `trackSubsessionEnd`에 콜을 추가합니다. - -```objc --(void)willResignActiveWithConversation:(MSConversation *)conversation { - // 확장판이 활성에서 비활성 상태로 이동하면 호출됨. - // 유저가 확장을 거부 또는 다른 대화로 변경하거나, - // 메시지를 종료할 때 발생함. - - // 공유된 리소스를 내보내고, 유저 데이터를 저장하고, 타이머를 무효화하고, - // 확장이 이후 종료된 경우 현재 상태로 복구하기 위해 충분한 상태 정보를 저장하기 위해 - // 이 메서드를 사용하시기 바랍니다. - - [Adjust trackSubsessionEnd]; -} -``` - -이렇게 설정을 완료하면, Adjust SDK를 통해 iMessage 앱 내부에서 세션을 추적할 수 있습니다. - -**참고:** 빌드한 iOS 앱 및 iMessage 확장자가 서로 다른 메모리 공간에서 운영되며, 상이한 번들 식별자를 사용하고 있는지 확인해야 합니다. 두 공간에서 같은 앱 토큰으로 Adjust SDK를 초기화하면 두 개의 독립 인스턴스가 생성되며, 두 인스턴스가 각자 서로의 존재를 모르는 채로 추적하여 대시보드 데이터에서 적합하지 않은 데이터 혼합이 발생할 수 있습니다. 따라서 iMessage 앱용 Adjust 대시보드에서 별도의 앱을 생하여 다른 앱 토큰으로 SDK를 초기화하는 것이 좋습니다. - -### Adjust 로그 - -다음 파라미터 중 하나를 통해 `ADJConfig` 인스턴스에서 `setLogLevel:`을 호출하여 테스트하는 동안 조회할 로그의 양을 늘리거나 줄일 수 있습니다. - -```objc -[adjustConfig setLogLevel:ADJLogLevelVerbose]; // 모든 로그 활성화 -[adjustConfig setLogLevel:ADJLogLevelDebug]; // 추가 로그 활성화 -[adjustConfig setLogLevel:ADJLogLevelInfo]; // 기본값 -[adjustConfig setLogLevel:ADJLogLevelWarn]; / /정보 로그 비활성화 -[adjustConfig setLogLevel:ADJLogLevelError]; // 경고도 비활성화 -[adjustConfig setLogLevel:ADJLogLevelAssert]; // 에러도 비활성화 -[adjustConfig setLogLevel:ADJLogLevelSuppress]; // 모든 로그 비활성화 -``` - -개발 중인 앱에 Adjust SDK가 기록하는 로그를 표시하지 않으려면, `ADJLogLevelSuppress`를 선택한 후 로그 수준 모드를 조절할 수 있는 생성자에서 `ADJConfig` 객체를 초기화해야 합니다. - -```objc -#"Adjust.h"가져오기 -// 또는 #import -// 또는 #import -// 또는 #import -// 또는 #import - -// ... - -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment - allowSuppressLogLevel:YES]; - -[Adjust appDidLaunch:adjustConfig]; -``` - -### 앱 빌드하기 - -앱을 빌드하고 실행합니다. 빌드를 성공적으로 완료했다면, 콘솔에서 SDK 로그를 꼼꼼하게 살펴보시기 바랍니다. 앱을 처음으로 출시한 경우, `설치 추적` 로그 정보를 반드시 확인하세요. - -![][run] - -## 추가 기능 - -Adjust SDK를 프로젝트에 연동하면 다음 기능을 활용할 수 있습니다. - -### AppTrackingTransparency 프레임워크 - -전송된 각 패키지에 대해 Adjust 백엔드는 사용자 또는 기기를 추적하는 데 사용할 수 있는 앱 관련 데이터에 대한 액세스 동의를 다음 네 가지 상태 중 하나로 수신합니다. - -- Authorized -- Denied -- Not Determined -- Restricted - -기기가 사용자 기기 추적에 사용되는 앱 관련 데이터에 대한 액세스를 승인하는 인증 요청을 수신한 후에는 Authorized 또는 Denied 상태가 반환됩니다. - -기기가 사용자 또는 기기를 추적하는 데 사용되는 앱 관련 데이터에 대한 액세스 인증 요청을 수신하기 전에는 Not Determined 상태가 반환됩니다. - -앱 추적 데이터 인증 권한이 제한되면 Restricted 상태가 반환됩니다. - -사용자에게 표시되는 대화 상자 팝업을 맞춤 설정하지 않으려는 경우, SDK에는 사용자가 대화 상자 팝업에 응답하면 업데이트된 상태를 수신하는 자체 메커니즘이 있습니다. 새로운 동의 상태를 백엔드에 편리하고 효율적으로 전달하기 위해 Adjust SDK는 다음 챕터 `앱 트래킹 인증 래퍼`에 설명된 앱 트래킹 인 메서드와 관련한 래퍼를 제공합니다. - -### App-tracking 인증 래퍼(wrapper) - -Adjust SDK를 사용하면 앱 관련 데이터에 액세스하는 데 대한 사용자 인증을 요청할 수 있습니다. Adjust SDK에는 [requestTrackingAuthorizationWithCompletionHandler:](https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorizationwith?language=objc) 상에 빌드된 래퍼가 있습니다. 여기서 콜백 메서드를 정의하여 사용자의 선택에 대한 정보를 얻을 수도 있습니다. 또한 이 래퍼를 사용하면 사용자가 팝업 대화 상자에 응답하는 즉시 콜백 메서드를 사용하여 다시 전달됩니다. 또한 SDK는 사용자의 선택 정보를 백엔드에 알립니다. `NSUInteger` 값은 다음과 같은 의미로 콜백 메서드를 통해 전달됩니다. - -- 0: `ATTrackingManagerAuthorizationStatusNotDetermined` -- 1: `ATTrackingManagerAuthorizationStatusRestricted` -- 2: `ATTrackingManagerAuthorizationStatusDenied` -- 3: `ATTrackingManagerAuthorizationStatusAuthorized` - -이 래퍼를 사용하려면 다음과 같이 호출하면 됩니다: - -```objc -[Adjust requestTrackingAuthorizationWithCompletionHandler:^(NSUInteger status) { - switch (status) { - case 0: - // ATTrackingManagerAuthorizationStatusNotDetermined case - break; - case 1: - // ATTrackingManagerAuthorizationStatusRestricted case - break; - case 2: - // ATTrackingManagerAuthorizationStatusDenied case - break; - case 3: - // ATTrackingManagerAuthorizationStatusAuthorized case - break; - } -}]; -``` - -### 현재 승인 상태 확인 - -현재 앱의 트래킹 승인 상태를 확인하려면 `[Adjust appTrackingAuthorizationStatus]`를 호출할 수 있으며, 이때 다음의 값이 반환될 수 있습니다. - -* `0`: 유저가 아직 승인 요청을 받지 않음 -* `1`: 유저 기기가 제한됨 -* `2`: 유저가 IDFA 액세스를 거부함 -* `3`: 유저가 IDFA 액세스를 승인함 -* `-1`: 상태 확인이 불가함 - - -### SKAdNetwork 프레임워크 - -Adjust iOS SDK v4.23.0 이상을 설치했으며 iOS 14에서 앱을 실행하는 경우, SKAdNetwork와의 통신이 기본적으로 활성화되며 비활성화하도록 설정할 수 있습니다. 활성화하면 SDK가 실행될때 SKAdNetwork 어트리뷰션에 대해 Adjust가 자동으로 등록합니다. 이벤트가 Adjust 대시보드에서 전환 값을 수신하도록 설정된 경우, Adjust 백엔드가 전환 값 데이터를 SDK로 전송합니다. 그런 다음 SDK가 전환 값을 설정합니다. Adjust가 SKAdNetwork 콜백 데이터를 수신한 후에는 해당 정보가 대시보드에 표시됩니다. - -Adjust SDK가 SKAdNetwork와 자동으로 통신하지 않도록 하려면 구성 객체에 대해 다음 메서드를 호출하여 해당 메서드를 사용하지 않도록 설정할 수 있습니다: - -```objc -[adjustConfig deactivateSKAdNetworkHandling]; -``` - -### SKAdNetwork 전환값 업데이트 - -iOS SDK v4.26.0의 경우 Adjust 래퍼(wrapper) 메서드인 `updateConversionValue:`를 사용하여 유저에 대한 SkAdNetwork 전환값을 업데이트할 수 있습니다. - -```objc -[Adjust updateConversionValue:6]; -``` - -### 전환값 업데이트 콜백 - -콜백을 등록하여 Adjust SDK가 유저의 전환값을 업데이트할 때마다 알림을 받을 수 있습니다. `AdjustDelegate` 프로토콜을 실행해야 하며, 추가로 `adjustConversionValueUpdated:` 메서드를 실행할 수 있습니다. - -```objc -- (void)adjustConversionValueUpdated:(NSNumber *)conversionValue { - NSLog(@"Conversion value updated callback called!"); - NSLog(@"Conversion value: %@", conversionValue); -} -``` - -### 이벤트 트래킹 - -Adjust를 사용하여 이벤트를 트래킹할 수 있습니다. 특정 버튼에 대한 모든 탭을 트래킹하려는 경우를 가정해 보겠습니다. Adjust [대시보드]에서 이벤트 토큰을 생성합니다. 이는 `abc123`와 같은 형태입니다. 버튼의 `buttonDown`메서드에서 탭을 트래킹하기 위해 다음을 추가합니다: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[Adjust trackEvent:event]; -``` - -버튼을 탭하면 이제 로그에 `Event tracked`가 표시됩니다. - -이벤트 인스턴스를 사용하여 이벤트를 트래킹하기 전에 해당 이벤트를 구성할 수 있습니다. - -### 매출 트래킹 - -사용자가 광고를 탭하거나 인앱 구매를 통해 매출을 창출 할 수있는 경우 이벤트를 통해 해당 매출을 트래킹할 수 있습니다. 광고를 한번 누르는 행위에 €0.01의 매출 금액이 발생한다고 가정해 보겠습니다. 그 경우 매출 이벤트를 다음과 같이 트래킹할 수 있습니다.: - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setRevenue:0.01 currency:@"EUR"]; - -[Adjust trackEvent:event]; -``` - -이것은 물론 콜백 파라미터와 함께 쓸 수 있습니다. - -사용자가 통화 토큰을 설정하면 Adjust는 사용자가 대시보드에 설정한 통화 세팅에 따라 전송되는 매출을 reporting 매출로 자동 전환합니다. 지원하는 통화 리스트는 여기에서 확인하세요. [currency conversion here.][currency-conversion] - -[이벤트 트래킹 가이드](https://help.adjust.com/ko/article/app-events#tracking-purchases-and-revenues)에서 매출과 이벤트 트래킹에 대한 자세한 내용을 확인하실 수 있습니다. - -### 매출 중복 제거 - -중복되는 매출을 트래킹하는 것을 방지하기 위해 전환 ID를 선택적으로 추가할 수 있습니다. 마지막 10개의 트랜잭션 ID가 보관되며, 중복되는 전환 ID가 있는 매출 이벤트는 건너뛰게 됩니다. 이러한 방식은 인앱 결제 트래킹에 활용할 수 있습니다. 예시는 다음과 같습니다. - -인앱 구매를 트래킹하려면, 상태가 `SKPaymentTransactionStatePurchased`로 변경된 이후에만 `paymentQueue:updatedTransactions`에서 `finishTransaction` 다음에 `trackEvent`를 호출합니다. 이렇게 하면 실제로 발생하지 않은 매출을 추적하는 것을 방지할 수 있습니다. - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState) { - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - ADJEvent *event = [ADJEvent eventWithEventToken:...]; - [event setRevenue:... currency:...]; - [event setTransactionId:transaction.transactionIdentifier]; // avoid duplicates - [Adjust trackEvent:event]; - - break; - // more cases - } - } -} -``` - -### 인앱 구매 검증 - -Adjust의 서버 측 결제 수신 정보 검증 툴인 Purchase Verification 제품을 사용하여 인앱 결제를 검증하고 싶다면, Adjust의 iOS 구매 SDK를 확인하고 [여기][ios-purchase-verification]에서 자세한 내용을 확인하시기 바랍니다. - -### 콜백 파라미터 - -[대시보드]에서 이벤트를 위한 콜백 URL을 등록할 수 있습니다. Adjust는 이벤트가 트래킹 될 때마다 해당 URL에 GET 요청을 보냅니다. 이벤트를 트래킹하기 전에 이벤트에 `addCallbackParameter`를 호출하여 해당 이벤트에 콜백 파라미터를 추가 할 수 있습니다. 이후 Adjust는 해당 파라미터를 사용자의 콜백 URL에 추가합니다. - -예를 들어, 사용자가 http://www.mydomain.com/callback URL을 등록했으며 다음과 같은 이벤트를 트래킹한다고 가정해 보겠습니다. - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -이 경우, Adjust가 이벤트를 추적하여 다음으로 요청을 전송합니다. - - http://www.mydomain.com/callback?key=value&foo=bar - -Adjust는 {idfa} 등 파라미터 값으로 사용될 수 있는 다양한 placeholder를 지원합니다. 콜백을 통해 이 placeholder는 현재 기기의 특정 ID로 대체될 수 있습니다. Adjust는 커스텀 파라미터를 보관하지 않으며 콜백에 추가하기만 하기 때문에 콜백 없이는 커스텀 파라미터가 저장되거나 사용자에게 전송되지 않습니다. - -Adjust [callbacks guide][callbacks-guide]에서 사용 가능한 값의 전체 리스트를 비롯하여 URL 콜백을 사용하는 방법을 자세히 알아보실 수 있습니다. - -### 파트너 파라미터 - -Adjust 대시보드에서 활성화된 네트워크 파트너로 전송될 파라미터를 추가할 수도 있습니다. - -이는 상기 콜백 파라미터와 유사한 방식으로 이루어지지만, `ADJEvent` 인스턴스에 `addPartnerParameter` 메서드를 호출하여 추가할 수 있습니다. - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event addPartnerParameter:@"key" value:@"value"]; -[event addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackEvent:event]; -``` - -[특별 파트너 가이드][special-partners]에서 특별 파트너와 연동 방법에 대한 자세한 내용을 알아보실 수 있습니다. - -### 콜백 ID - -트래킹하고자 하는 개별 이벤트에 맞춤 문자열 ID를 추가할 수도 있습니다. 이 ID는 이후에 이벤트 성공 및/또는 이벤트 실패 콜백에서 보고되며, 이를 통해 성공적으로 트래킹 된 이벤트와 그렇지 않은 이벤트를 확인할 수 있습니다. `ADJEvent` 인스턴스에 `setCallbackId` 메서드를 호출하여 이 ID를 설정할 수 있습니다. - - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - -[event setCallbackId:@"Your-Custom-Id"]; - -[Adjust trackEvent:event]; -``` - -### 세션 파라미터 - -일부 파라미터는 저장되어 Adjust SDK의 모든 이벤트 및 세션에 전송됩니다. 이러한 파라미터를 한 번 추가하면 로컬로 저장되기 때문에 매번 추가할 필요가 없습니다. 동일한 파라미터를 다시 추가해도 아무 일도 일어나지 않습니다. - -초기 설치 이벤트와 함께 세션 파라미터를 보내려면 `[Adjust appDidLaunch:]`를 통해 Adjust SDK를 시작하기 전에 반드시 호출해야 합니다. 설치 시에 파라미터를 전송해야 하지만 필요한 값을 실행 이후에만 확보할 수 있는 경우, 이러한 동작이 가능하게 하려면 Adjust SDK의 첫 실행을 지연시키면 됩니다. - -### 세션 콜백 파라미터 - -Adjust SDK의 모든 이벤트 또는 세션에서 전송될 [events](#callback-parameters)를 위해 등록된 동일한 콜백 파라미터를 저장할 수 있습니다. - -세션 콜백 파라미터는 이벤트 콜백 파라미터와 유사한 인터페이스를 가집니다. 이벤트에 키와 값을 추가하는 대신에, `Adjust`에 `addSessionCallbackParameter:value:` 메서드 호출을 통해 추가됩니다. - -```objc -[Adjust addSessionCallbackParameter:@"foo" value:@"bar"]; -``` - -세션 콜백 파라미터는 콜백 파라미터와 병합되며 이벤트에 추가됩니다. 이벤트에 추가된 콜백 파라미터는 세션 콜백 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 콜백 파라미터를 이벤트에 추가하면 이벤트에 추가된 콜백 파라미터의 값이 우선시됩니다. - -원하는 키를`removeSessionCallbackParameter` 메소드에 전달하여 특정 세션 콜백 파라미터를 제거 할 수 있습니다. - -```objc -[Adjust removeSessionCallbackParameter:@"foo"]; -``` - -세션 콜백 파라미터에서 모든 키와 값을 삭제하려면 `resetSessionCallbackParameters` 메서드를 사용하여 재설정 할 수 있습니다. - -```objc -[Adjust resetSessionCallbackParameters]; -``` - -### 세션 파트너 파라미터 - -Adjust SDK의 이벤트 또는 세션에 [session callback parameters](#session-callback-parameters)가 전송되는 것처럼 세션 파트너 파라미터도 있습니다. - -이러한 파라미터는 사용자의 Adjust 대시보드에서 활성화된 네트워크 파트너 연동에 전송됩니다. - -세션 파트너 파라미터는 이벤트 파트너 파라미터와 유사한 인터페이스를 가집니다. 키와 값을 이벤트에 추가하는 대신, Adjust 메서드의 `addSessionPartnerParameter:value:`: 로의 호출을 통해 추가합니다. - -```objc -[Adjust addSessionPartnerParameter:@"foo" value:@"bar"]; -``` - -세션 파트너 파라미터는 이벤트에 추가된 파트너 파라미터와 병합됩니다. 이벤트에 추가된 파트너 파라미터는 세션 파트너 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 파트너 파라미터를 이벤트에 추가하면 이벤트에 추가된 파트너 파라미터의 값이 우선시됩니다. - -원하는 키를`removeSessionPartnerParameter` 메서드에 전달하여 특정 세션 파트너 파라미터를 삭제할 수 있습니다. - -```objc -[Adjust removeSessionPartnerParameter:@"foo"]; -``` - -세션 파트너 파라미터에서 모든 키와 값을 제거하려면`resetSessionPartnerParameters` 메소드를 사용하여 재설정할 수 있습니다. - -```objc -[Adjust resetSessionPartnerParameters]; -``` - -### 시작 지연 - -Adjust SDK의 시작을 지연시키면 앱이 내부 유저 ID와 같은 세션 파라미터를 획득할 시간이 확보되므로, 세션 파라미터를 설치 시에 전송할 수 있게 됩니다. - -`ADJConfig` 인스턴스에서 `setDelayStart` 메서드로 초기 지연 시간을 초 단위로 설정하시기 바랍니다. - -```objc -[adjustConfig setDelayStart:5.5]; -``` - -이렇게 설정하면 Adjust SDK가 초기 설치 세션과 5.5초 이내로 생성된 이벤트를 전송하지 않습니다. 이 시간이 만료되거나 그동안 `[Adjust sendFirstPackages]`를 호출하는 경우, 모든 세션 파라미터가 지연된 설치 세션 및 이벤트에 추가되며 Adjust SDK가 평소대로 재개됩니다. - -**Adjust SDK의 최대 시작 지연 시간은 10초입니다.** - -### 어트리뷰션 콜백 - -델리게이트 콜백을 등록하여 트래커 어트리뷰션의 변경 사항에 대한 알림을 받을 수 있습니다. 어트리뷰션에는 다양한 소스가 관련되어 있기 때문에 이 정보는 동기적으로 제공될 수 없습니다. 아래의 단계를 수행하여 앱 델리게이트에서 추가적인 델리게이트 프로토콜을 실행합니다. - -Adjust의 [관련 어트리뷰션 데이터 정책][attribution-data]을 반드시 고려하시기 바랍니다. - -1. `AppDelegate.h`를 열고 임포트와 `AdjustDelegate` 선언을 추가합니다. - - ```objc - @interface AppDelegate : UIResponder - ``` - -2. `AppDelegate.m`을 열고 다음의 델리게이트 콜백 기능을 앱 델리게이트 실행에 추가합니다. - - ```objc - - (void)adjustAttributionChanged:(ADJAttribution *)attribution { - } - ``` - -3. `ADJConfig` 인스턴스와 델리게이트를 설정합니다. - - ```objc - [adjustConfig setDelegate:self]; - ``` - -델리게이트 콜백이 `ADJConfig` 인스턴스를 사용하여 구성되므로, `[Adjust appDidLaunch:adjustConfig]`를 호출하기 전에 `setDelegate`를 호출해야 합니다. - -델리게이트 기능은 SDK가 최종 어트리뷰션 데이터를 수신한 이후에 호출됩니다. 델리게이트 함수 내에서 `attribution` 파라미터에 액세스할 수 있습니다. 그 속성에 대한 요약 정보는 다음과 같습니다. - -- `NSString trackerToken` 현재 어트리뷰션의 트래커 토큰. -- `NSString trackerName` 현재 어트리뷰션의 트래커 이름. -- `NSString network` 현재 어트리뷰션의 네트워크 그룹화 수준. -- `NSString campaign`현재 어트리뷰션의 캠페인 그룹화 수준. -- `NSString adgroup`현재 어트리뷰션의 광고 그룹 그룹화 수준. -- `NSString creative` 현재 어트리뷰션의 크리에이티브 그룹화 수준. -- `NSString clickLabel` 현재 어트리뷰션의 클릭 레이블. -- `NSString adid` 어트리뷰션이 제공한 고유 기기 식별자. -- `NSString costType` 비용 유형 문자열. -- `NSNumber costAmount` 비용 금액. -- `NSString costCurrency` 비용 통화 문자열. - -값을 사용할 수 없는 경우, 기본값인 `nil`이 나타납니다. - -참고: 비용 데이터인 `costType`과 `costAmount`, `costCurrency`는 `setNeedsCost:` 메서드를 호출하여 `ADJConfig`에서 설정된 경우에만 이용 가능합니다. 설정이 되지 않았거나, 또는 설정이 되었으나 어트리뷰션의 일부가 아닌 경우에는 필드의 값이 `nil`로 나타납니다. 본 기능은 SDK v4.24.0 이상 버전에서만 이용 가능합니다. - -### 광고 매출 트래킹 - -**참고**: 이 광고 매출 트래킹 API는 네이티브 SDK v4.29.0 이상에서만 이용가능합니다. - -다음 메서드를 호출하여 Adjust SDK로 광고 매출 정보를 트래킹할 수 있습니다. - -```objc -// 적절한 광고 매출 소스와 함께 ADJAdRevenue 인스턴스 초기화 -ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:source]; -// 매출과 통화값 전송 -[adRevenue setRevenue:1.6 currency:@"USD"]; -// 선택 파라미터 전송 -[adRevenue setAdImpressionsCount:adImpressionsCount]; -[adRevenue setAdRevenueUnit:adRevenueUnit]; -[adRevenue setAdRevenuePlacement:adRevenuePlacement]; -[adRevenue setAdRevenueNetwork:adRevenueNetwork]; -// 필요한 경우 콜백 및/또는 파트너 파라미터 추가 -[adRevenue addCallbackParameter:key value:value]; -[adRevenue addPartnerParameter:key value:value]; - -// track ad revenue -[Adjust trackAdRevenue:source payload:payload]; -``` - -애드저스트는 현재 다음의 `source` 파라미터 값을 지원합니다. - -- `ADJAdRevenueSourceAppLovinMAX` - AppLovin MAX 플랫폼. -- `ADJAdRevenueSourceMopub` - MoPub 플랫폼. -- `ADJAdRevenueSourceAdMob` - AdMob 플랫폼. -- `ADJAdRevenueSourceIronSource` - IronSource 플랫폼. - -**참고**: 지원되는 소스와의 연동에 대한 자세한 내용을 설명하는 추가 문서는 이 README 외에 별도로 제공됩니다. 또한, 이 기능을 사용하기 위해서는 Adjust 대시보드에서 앱에 대한 추가적인 설정이 필요합니다. 따라서, 이 기능을 사용하기 전에 모든 설정이 올바르게 이루어지도록 하기 위해 Adjust 지원팀에 먼저 연락하시기 바랍니다. - -### 구독 트래킹 - -**참고**: 이 기능은 SDK 4.22.0 버전 이상에서만 사용할 수 있습니다. Adjust는 최소 4.22.1 버전을 사용하기를 권고합니다. - -**중요**: 다음의 단계는 SDK 내에서의 구독 트래킹만 설정합니다. 설정을 완료하려면 특정 앱 정보가 반드시 Adjust의 내부 인터페이스에 추가되어야 합니다. 이는 Adjust의 직원이 수행해야 합니다. support@adjust.com이나 담당 테크니컬 어카운트 매니저에게 연락하시기 바랍니다. - -Adjust SDK에서 App Store 구독을 트래킹하고 유효성을 검증할 수 있습니다. 구독이 성공적으로 구매되면, 다음의 콜을 Adjust SDK에 호출합니다. - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -[Adjust trackSubscription:subscription]; -``` - -이는 상태가 `SKPaymentTransactionStatePurchased`나 `SKPaymentTransactionStateRestored`로 변경된 경우에만 사용하시기 바랍니다. 이후 `paymentQueue:updatedTransactions`에서 `finishTransaction`에 호출합니다. - -구독 트래킹 파라미터: - -- [가격](https://developer.apple.com/documentation/storekit/skproduct/1506094-price?language=objc) -- 통화([현지 가격](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) 객체의 [통화 코드](https://developer.apple.com/documentation/foundation/nslocale/1642836-currencycode?language=objc)를 전달해야 함) -- [거래 ID](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411288-transactionidentifier?language=objc) -- [영수증](https://developer.apple.com/documentation/foundation/nsbundle/1407276-appstorereceipturl) -- [거래 일자](https://developer.apple.com/documentation/storekit/skpaymenttransaction/1411273-transactiondate?language=objc) -- 판매 지역([현지 가격](https://developer.apple.com/documentation/storekit/skproduct/1506145-pricelocale?language=objc) 객체의 [국가 코드](https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc)를 전달해야 함) - -이벤트 추적과 마찬가지로 콜백 및 파트너 파라미터를 구독 객체에 연결할 수 있습니다. - -```objc -ADJSubscription *subscription = [[ADJSubscription alloc] initWithPrice:price - currency:currency - transactionId:transactionId - andReceipt:receipt]; -[subscription setTransactionDate:transactionDate]; -[subscription setSalesRegion:salesRegion]; - -// add callback parameters -[subscription addCallbackParameter:@"key" value:@"value"]; -[subscription addCallbackParameter:@"foo" value:@"bar"]; - -// add partner parameters -[subscription addPartnerParameter:@"key" value:@"value"]; -[subscription addPartnerParameter:@"foo" value:@"bar"]; - -[Adjust trackSubscription:subscription]; -``` - -### 이벤트와 세션 콜백 - -델리게이트 콜백을 등록하여 트래킹이 성공 또는 실패한 이벤트 및/또는 세션에 대한 알림을 받을 수 있습니다. [어트리뷰션 콜백](#attribution-callback)에 사용되는 동일한 선택 프로토콜인 `AdjustDelegate`가 사용됩니다. - -동일한 단계를 수행한 뒤 성공적으로 트래킹된 이벤트에 다음의 델리게이트 콜백 함수를 사용하시기 바랍니다. - -```objc -- (void)adjustEventTrackingSucceeded:(ADJEventSuccess *)eventSuccessResponseData { -} -``` - -트래킹이 실패한 이벤트에는 다음의 델리게이트 콜백 함수를 사용합니다. - -```objc -- (void)adjustEventTrackingFailed:(ADJEventFailure *)eventFailureResponseData { -} -``` - -성공적으로 트래킹된 세션의 경우: - -```objc -- (void)adjustSessionTrackingSucceeded:(ADJSessionSuccess *)sessionSuccessResponseData { -} -``` - -추적에 실패한 세션의 경우: - -```objc -- (void)adjustSessionTrackingFailed:(ADJSessionFailure *)sessionFailureResponseData { -} -``` - -SDK가 패키지를 서버로 전송하려고 시도한 후에 델리게이트 콜백 함수가 호출됩니다. 델리게이트 콜백 내에서 델리게이트 콜백에 대한 응답 데이터 객체에 액세스할 수 있습니다. 세션 응답 데이터 속성에 대한 요약 정보는 다음과 같습니다. - -- `NSString message` 서버로부터의 메시지 또는 SDK에 의해 로깅된 오류. -- `NSString timeStamp` 서버로부터의 타임스탬프. --`NSString adid` Adjust에서 제공하는 고유 기기 식별자. -- `NSDictionary jsonResponse` 서버로부터의 응답을 포함하는 JSON 객체. - -두 이벤트 응답 데이터 개체는 다음을 포함합니다. - -- `NSString eventToken` 트래킹된 패키지가 이벤트인 경우 해당 이벤트 토큰. -- `NSString callbackId` 이벤트 객체에 설정된 맞춤 정의 콜백 ID - -값을 사용할 수 없는 경우, 기본값인 `nil`이 나타납니다. - -두 이벤트 및 세션 실패 개체는 다음을 포함합니다. - -- `BOOL willRetry`는 이후 패키지 재전송 시도가 있음을 알립니다. - -### 트래킹 비활성화 - -`NO` 파라미터와 함께 `setEnabled`를 호출하여, Adjust SDK가 현재 기기의 모든 활동을 트래킹하는 것을 비활성화 할 수 있습니다. **이 설정은 세션 간에 유지됩니다**. - -```objc -[Adjust setEnabled:NO]; -``` - - `isEnabled` 함수를 호출하여 Adjust SDK가 현재 활성화 상태인지 확인할 수 있습니다. 활성화된 파라미터를 `YES`로 설정하여 `setEnabled` 를 호출하고, 언제든지 Adjust SDK를 활성화할 수 있습니다. - -### 오프라인 모드 - -Adjust 서버에 대한 전송을 연기하고 트래킹된 데이터가 이후에 전송되도록 유지함으로써 Adjust SDK를 오프라인 모드로 설정할 수 있습니다. 오프라인 모드에서는 모든 정보가 파일에 저장되기 때문에 너무 많은 이벤트를 발생시키지 않도록 주의해야 합니다. - -오프라인 모드를 활성화하려면 `setOfflineMode`를 호출하고 파라미터를 `YES`로 설정합니다. - -```objc -[Adjust setOfflineMode:YES]; -``` - -반대로 `setOfflineMode`를 `NO`와 호출하여 오프라인 모드를 취소할 수 있습니다. Adjust SDK가 다시 온라인 모드가 되면 저장된 모든 정보가 정확한 시간 정보와 함께 Adjust 서버로 전송됩니다. - -트래킹 비활성화와는 다르게, 이 설정은 **세션 간에 유지되지 않습니다.** 즉, 앱이 오프라인 모드에서 종료되었더라도 Adjust SDK는 항상 온라인 모드로 시작됩니다. - -### 이벤트 버퍼링 - -앱이 이벤트 트래킹을 많이 사용하는 경우, 일부 HTTP 요청을 연기하여 HTTP 요청을 1분에 한 번씩 일괄로 보내고자 할 수 있습니다. `ADJConfig` 인스턴스를 통해 이벤트 버퍼링을 활성화할 수 있습니다. - -```objc -[adjustConfig setEventBufferingEnabled:YES]; -``` - -아무것도 설정되지 않은 경우 이벤트 버퍼링의 **기본값은 비활성화**입니다. - -### GDPR 잊혀질 권리 - -EU의 개인정보보호법(GDPR) 제 17조에 따라, 사용자는 잊혀질 권리(Right to be Forgotten)를 행사했음을 Adjust에 알릴 수 있습니다. 다음 메서드를 호출하면 Adjust SDK가 잊혀질 권리에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다. - -```objc -[Adjust gdprForgetMe]; -``` - -이 정보를 수신한 후 Adjust는 해당 사용자의 데이터를 삭제하며 Adjust SDK는 해당 사용자에 대한 추적을 중지합니다. 이 기기로부터의 요청은 향후 Adjust에 전송되지 않습니다. - -## 특정 유저에 대한 서드파티 공유 - -유저가 서드파티 파트너와의 데이터 공유를 비활성화, 활성화 및 재활성화할 때 Adjust에 이를 고지할 수 있습니다. - -### 특정 유저에 대한 서드파티 공유 비활성화 - -다음 메서드를 호출하여 Adjust SDK가 데이터 공유 비활성화에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다: - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@NO]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -이 정보를 수신하면 Adjust는 특정 사용자의 데이터를 파트너와 공유하는 것을 차단하고 Adjust SDK는 계속 정상적으로 작동합니다. - -### 특정 유저에 대한 서드파티 공유 활성화 및 비활성화 - -다음 메서드를 호출하여 Adjust SDK가 데이터 공유에 대한 유저의 선택과 변경 내용을 Adjust 백엔드에 보내도록 하시기 바랍니다. - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:@YES]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -Adjust는 정보 수신 후 해당 유저에 대한 파트너와의 데이터 공유 상태를 변경합니다. Adjust SDK는 계속해서 정상적으로 작동합니다. - -Adjust SDK가 Adjust 백엔드로 상세한 옵션을 전송하도록 하려면 다음의 메서드를 호출합니다. - -```objc -ADJThirdPartySharing *adjustThirdPartySharing = [[ADJThirdPartySharing alloc] initWithIsEnabledNumberBool:nil]; -[adjustThirdPartySharing addGranularOption:@"PartnerA" key:@"foo" value:@"bar"]; -[Adjust trackThirdPartySharing:adjustThirdPartySharing]; -``` - -### 특정 유저에 대한 동의 측정 - -Adjust 대시보드에서 데이터 프라이버시 설정을 활성화 또는 비활성화하려면(동의 만료 기간 및 유저 데이터 보유 기간 포함) 다음의 메서드를 도입해야 합니다. - -다음의 메서드를 호출하여 Adjust SDK가 데이터 프라이버시 설정을 Adjust 백엔드로 보내도록 하시기 바랍니다. - -```objc -[Adjust trackMeasurementConsent:YES]; -``` - -Adjust는 정보 수신 후 해당 유저에 대한 파트너와의 데이터 공유 상태를 변경합니다. Adjust SDK는 계속해서 정상적으로 작동합니다. - -### SDK 서명 - -Adjust SDK 서명은 클라이언트별로 활성화됩니다. 이 기능을 사용하기 위해서는 담당 매니저에게 문의하십시오. - -SDK 서명이 이미 계정에서 활성화되어 있으며 Adjust 대시보드의 App Secret에 액세스할 수 있는 경우, 아래 방법을 사용하여 SDK 서명을 앱에 연동하세요. - -`AdjustConfig`인스턴스에서`setAppSecret`을 호출하여 앱 시크릿을 설정합니다. - -```objc -[adjustConfig setAppSecret:secretId info1:info1 info2:info2 info3:info3 info4:info4]; -``` - -### 백그라운드 트래킹 - -Adjust SDK는 기본값에 따라 앱이 백그라운드에서 작동하는 동안 HTTP 요청 전송을 일시 중지하도록 설정되어 있습니다. 이 설정은 `AdjustConfig` 인스턴스에서 변경할 수 있습니다. - -```objc -[adjustConfig setSendInBackground:YES]; -``` - -아무 것도 설정되지 않으면 백그라운드 전송이 **기본적으로 비활성화됩니다**. - -### 기기 ID - -Adjust SDK를 사용하면 일부 기기 식별자를 얻을 수 있습니다. - -### iOS 광고 ID - -특정 서비스(예: Google Analytics)는 중복 보고를 방지하기 위해 기기 및 클라이언트 ID 통합을 요청합니다. - -기기 ID IDFA를 얻으려면 `idfa` 함수를 호출합니다. - -```objc -NSString *idfa = [Adjust idfa]; -``` - -### Adjust 기기 ID - -사용자의 앱이 설치된 각 기기에 대해 Adjust 백앤드는 고유한 **Adjust 기기 식별자**(**adid**)를 생성합니다. 이 식별자를 얻기 위해`Adjust` 인스턴스에서 다음 메서드를 호출 할 수 있습니다. - -```objc -NSString *adid = [Adjust adid]; -``` - -**참고** : **adid** 에 대한 정보는 Adjust 백앤드에서 앱 설치를 트래킹한 후에 사용할 수 있습니다. 그 다음부터는 Adjust SDK가 기기 **adid** 정보를 보유하게 되며, 이 메서드를 사용하여 해당 정보에 액세스할 수 있습니다. 따라서 SDK가 초기화되고 앱 설치가 추적되기 전까지는 **adid**에 액세스할 수 **없습니다**. - -### 유저 어트리뷰션 - -어트리뷰션 콜백은 [어트리뷰션 콜백 섹션](#attribution-callback)에 설명된 대로 실행되며, 변경될 때마다 새 어트리뷰션에 대한 정보를 제공합니다. 유저의 현재 어트리뷰션에 대한 정보에 액세스하려면 `Adjust` 인스턴스에서 다음의 메서드를 호출합니다. - -```objc -ADJAttribution *attribution = [Adjust attribution]; -``` - -**참고**: 현재 어트리뷰션에 대한 정보는 Adjust 백엔드가 앱의 설치를 추적하고 어트리뷰션 콜백이 처음으로 실행된 다음에만 사용할 수 있습니다. 그 다음부터는 Adjust SDK가 사용자의 어트리뷰션 상태에 대한 정보를 보유하게 되며, 이 메서드를 사용하여 해당 정보에 액세스할 수 있습니다. 따라서 SDK가 초기화되고 어트리뷰션 콜백이 실행되기 전까지는 사용자의 어트리뷰션 값에 액세스할 수 **없습니다**. - -### 푸시 토큰 - -푸시 토큰은 오디언스 빌더(Audience Builder) 및 클라이언트 콜백에 사용되며 삭제 및 재설치 트래킹 기능에 필요합니다. - -Adjust에 푸시 알림 토큰을 전송하려면 앱 델리게이트(app delegate)의 `didRegisterForRemoteNotificationsWithDeviceToken` 에 Adjust으로의 호출을 추가하세요. - -```objc -- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [Adjust setDeviceToken:deviceToken]; -} -``` - -### 사전 설치 트래커 - -Adjust SDK를 사용하여 본인의 앱을 발견하고 기기에 사전 설치한 사용자를 식별하려면 다음 단계를 따르세요. - -1. [대시보드]에서 새 트래커를 생성합니다. -2. 앱 델리게이트를 열고 `ADJConfig`의 기본값 트래커를 설정합니다. - - ```objc - ADJConfig*adjustConfig = [ADJConfig configWithAppToken:yourAppToken environment:environment]; - [adjustConfig setDefaultTracker:@"{TrackerToken}"]; - [Adjust appDidLaunch:adjustConfig]; - ``` - - `{TrackerToken}`을 2단계에서 만든 트래커 토큰으로 교체합니다. 대시보드에 트래커가 표시됩니다. - URL (including `http://app.adjust.com/`). 소스 코드에서 전체 URL이 아닌 - 6글자의 토큰만 지정해야 합니다. - -3. 앱을 빌드하고 실행합니다. XCode에서 다음과 같은 라인이 나타나야 합니다. - - ``` - Default tracker: 'abc123' - ``` - -### 딥링크 - -Adjust 트래커 URL을 사용하며 URL로부터 앱으로 딥링킹하는 옵션을 설정한 경우, 딥링크 및 그 콘텐츠에 대한 정보를 얻을 수 있습니다. 사용자가 앱을 이미 설치한 경우(표준 딥링크 시나리오) 또는 기기에 앲이 없는 경우(지연 딥링크 시나리오)에 URL 조회가 발생할 수 있습니다. 이 두 시나리오는 Adjust SDK에서 지원되며 두 경우 모두 트래커 URL에 도달 한 후 앱이 시작된 후 딥 링크 URL이 제공됩니다. 앱에서이 기능을 사용하려면 올바르게 설정해야합니다. - -### 표준 딥링크 시나리오 - -만일 사용자가 이미 앱을 설치하였고 딥링크 정보가 담긴 트래커 URL에 도달하였다면 애플리케이션이 열리고 딥링크의 내용이 앱으로 전송되어 파싱 및 다음 작업을 결정할 수 있습니다. iOS 9이 나오면서 Apple은 앱에서 딥링크를 처리하는 방식을 변경했습니다. 앱에 사용하려는 시나리오 (또는 다양한 기기를 지원하기 위해 둘 다 사용하려는 경우)에 따라 다음 시나리오 중 하나 또는 둘 다를 처리하도록 앱을 설정해야합니다. - -### iOS 8 이하 기기에서의 딥링크 - -iOS 8 및 이전 기기에서 딥링크는 커스텀 URL 스킴 설정을 사용하여 수행됩니다. 앱을 여는 데 사용할 커스텀 URL 스킴 이름을 선택해야합니다. 이 스킴 이름은`deep_link` 파라미터의 일부로 Adjust 트래커 URL에서도 사용됩니다. 앱에서 이를 설정하려면`Info.plist`를 엽니다. 파일에 새로운 `URL 유형`행을 추가합니다. 거기에 `URL 식별자`로 앱의 번들 ID를 작성하고 `URL 스킴`아래에서 앱이 처리 할 스킴 이름을 추가합니다. 아래 예제에서는 앱이`adjustExample` 스킴 이름을 처리하도록 선택했습니다. - -![][custom-url-scheme] - -이것이 설정되면 선택한 스킴 이름이 포함된`deep_link` 파라미터로 Adjust 트래커 URL를 클릭하면 앱이 열립니다. 앱이 열리면 `AppDelegate`클래스의`openURL` 메소드가 실행되고 트래커 URL의`deep_link` 파라미터의 내용이 전달됩니다. 딥링크의 컨텐츠에 액세스하려면이 이 매서드를 오버라이드합니다. - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url 객체에 딥링크 콘텐츠가 있습니다 - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -이 셋업을 사용하여 iOS 8 및 이전 버전의 iOS 기기에 대한 딥링크 처리를 성공적으로 설정했습니다. - -### iOS 9 이상 기기에서의 딥링크 - -iOS 9 이후 기기에 대한 딥링크 지원을 설정하려면 앱이 Apple 유니버셜 링크를 처리할 수 있도록 설정해야 합니다. 유니버셜 링크 및 해당 설정에 대해 자세히 알아 보려면 [here] [universal-links]를 확인하십시오. - -Adjust는 개별적으로 유니버셜 링크와 관련하여 많은 것들을 처리하고 있습니다. 그러나 Adjust로 유니버셜 링크를 지원하려면 Adjust 대시 보드에서 유니버셜 링크에 대해 작은 설정을 수행해야합니다. 이에 대한 자세한 내용은 공식 [here] [universal-links-guide]를 참조하십시오. - -대시보드에서 유니버셜 링크 기능을 활성화한 후에는 앱에서도 이를 수행해야합니다. - -Apple Developer Portal에서 앱에 대해 `Associated Domains`를 활성화한 후에는 앱의 Xcode 프로젝트에서 동일한 작업을 수행해야합니다. `Associated Domains`를 활성화 한 후`Domains` 섹션의 Adjust 대시보드에서`applinks :`를 접두사로 사용하여 생성된 유니버설 링크를 추가하고 유니버설 링크의 `http(s)` 부분을 반드시 삭제하도록 합니다. - -![][associated-domains-applinks] - -이 설정이 완료되면 Adjust 트래커 유니버셜 링크를 클릭할 시 앱이 열립니다. 앱이 열리면 `AppDelegate`클래스의`continueUserActivity` 메서드가 트리거되고 유니버셜 링크 URL의 컨텐츠가 있는 곳이 전달됩니다. 딥링크의 컨텐츠에 액세스하려면이 이 매서드를 오버라이드합니다. - -``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - // url 객체는 사용자의 유니버셜 링크 콘텐츠가 포함되어 있습니다 - } - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -이 셋업을 사용하여 iOS9 및 이후 버전의 iOS 기기에 대한 딥링크 처리를 성공적으로 설정했습니다. - -딥링크 정보가 항상 기존 스타일의 커스텀 URL 스킴 형식으로 나올 것으로 예상되는 코드에 커스텀 로직이 있는 경우 유니버셜 링크를 이전 스타일의 딥링크 URL로 변환 할 수있는 도우미 기능을 제공합니다. 사용자는 유니버셜 링크와 딥링크가 접두어로 표시된 사용자 정의 URL 스킴 이름으로 이 메서드를 호출할 수 있으며 Adjust는 사용자 정의 URL 스킴 딥링크를 생성합니다: - -``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; - } - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -### 디퍼드 딥링크 시나리오 - -디퍼드 딥링크가 열리기 전에 알림을 받을 델리게이트 콜백을 지정하고, Adjust SDK가 이를 열지 결정할 수 있습니다. [어트리뷰션 콜백](#attribution-callback)에 사용되는 동일한 선택 프로토콜인 `AdjustDelegate`가 사용됩니다. - -동일한 단계를 수행하고, 디퍼드 딥링크에 대해 다음의 델리게이트 콜백 함수를 사용합니다. - -```objc -- (BOOL)adjustDeeplinkResponse:(NSURL *)deeplink { - // 딥링크 객체는 디퍼드 딥링크 콘텐츠에 대한 정보를 포함합니다. - - // Adjust SDK가 딥링크를 열려고 시도해야 하는지 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -콜백 함수는 SDK가 Adjust 서버에서 디퍼드 딥링크를 수신하고 열기 전에 호출됩니다. 콜백 함수 내에서 딥링크에 액세스할 수 있습니다. 반환된 불 논리 값은 SDK가 딥링크를 실행해야 할지 결정합니다. 예를 들어, SDK가 바로 딥링크를 열지 않고 저장 후 나중에 직접 열도록 할 수 있습니다. - -이 콜백이 구현되지 않으면 **Adjust SDK는 항상 기본적으로 해당 딥링크를 열려고 시도합니다.**. - -### 딥링크를 통한 리어트리뷰션 - -Adjust를 사용하면 립링크를 사용하여 리인게이지먼트(재유입) 캠페인 트래킹을 실행할 수 있습니다. 이를 수행하는 방법에 대한 자세한 정보는 Adjust의 [official docs][reattribution-with-deeplinks]에서 찾아볼 수 있습니다. - -이 기능을 사용하는 경우, 사용자에 대한 리어트리뷰션이 적절히 이루어지려면 앱에서 Adjust SDK에 대한 추가적인 호출을 수행해야 합니다. - -앱의 딥링크 콘텐츠 정보를 수신했으면 the `appWillOpenUrl` 매서드로 호출을 추가합니다. 이 호출을 수행함으로써 Adjust SDK는 딥링크 내부에서 새 어트리뷰션 정보를 찾으며, 정보가 있는 경우에는 Adjust 백앤드에 전송됩니다. 딥링크 콘텐츠를 포함하는 Adjust 트래커 URL에 대한 클릭으로 인해 사용자에 대한 리어트리뷰션이 이루어져야 하는 경우, 앱에서 해당 사용자에 대한 새 어트리뷰션 정보와 함께 [어트리뷰션 콜백](#attribution-callback)이 실행되는 것을 볼 수 있습니다. - -`appWillOpenUrl`에 대한 호출은 모든 iOS 버전에서 딥링크 리어트리뷰션을 지원하기 위해 다음과 같이 수행되어야합니다. - -```objc -- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { - // url 객체에 딥링크 콘텐츠가 있습니다 - - [Adjust appWillOpenUrl:url]; - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -``` objc -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL url = [userActivity webpageURL]; - - [Adjust appWillOpenUrl:url]; - } - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -### Link resolution - -이메일 서비스 제공자(ESP)로부터 딥링크를 제공하고 커스텀 트래킹 링크를 통해 클릭을 트래킹해야 하는 경우, `ADJLinkResolution` 클래스의 `resolveLinkWithUrl` 메서드를 사용하여 링크를 해석할 수 있습니다. 이를 통해 딥링크가 앱에서 열렸을 때 이메일 트래킹 캠페인과의 교류를 기록할 수 있습니다. - -`resolveLinkWithUrl` 메서드는 다음의 파라미터를 사용합니다: - -- `url` - 앱을 연 딥링크 -- `resolveUrlSuffixArray` - 해석되어야 하는 구성된 캠페인의 커스텀 도메인 -- `callback`- 최총 URL을 포함하게 될 콜백 - -수신한 링크가 `resolveUrlSuffixArray`에 명시된 도메인에 속하지 않는 경우, 해당 콜백은 딥링크 URL을 그대로 전달합니다. 링크가 명시된 도메인을 포함하는 경우, SDK는 링크 해석을 시도하고, `callback` 파라미터로 결과 딥링크를 반환합니다. 반환된 딥링크는 또한 `[Adjust appWillOpenUrl:]` 메서드를 사용하여 Adjust SDK에서 리어트리뷰션 될 수 있습니다. - -> **참고**: SDK는 URL 해석을 시도할 때 자동으로 최대 3개의 리다이렉트를 따릅니다. SDK는 `callback` URL의 가장 마지막 URL을 반환하는데, 이는 따라야 할 리다이렉트가 3개 이상인 경우 **3번째 리다이렉트 URL이** 반환됨을 의미합니다. - -**예시** - -```objc -[ADJLinkResolution - resolveLinkWithUrl:url - resolveUrlSuffixArray:@[@"example.com"] - callback:^(NSURL * _Nullable resolvedLink) - { - [Adjust appWillOpenUrl:resolvedLink]; - }]; -``` - -### [베타] 데이터 레지던시 - -데이터 레지던시 기능을 활성화하려면, 다음의 상수 중 1개와 함께 `ADJConfig` 인스턴스의 `setUrlStrategy:` 메서드를 호출하시기 바랍니다. - -```objc -[adjustConfig setUrlStrategy:ADJDataResidencyEU]; // EU 데이터 레지던시 지역 -[adjustConfig setUrlStrategy:ADJDataResidencyTR]; // 터키 데이터 레지던시 지역 -``` - -**참고:** 이 기능은 현재 베타 테스트 단계입니다. 이 기능에 액세스하고 싶다면 담당 어카운트 매니저나 support@adjust.com으로 연락주시기 바랍니다. Adjust의 지원팀이 앱에 해당 기능을 활성화한 것이 아니라 자체적으로 해당 기능을 활성화한 경우 SDK 트래픽이 중단되게 됩니다. - -## 문제 해결 - -### 지연된 SDK 초기화 문제 - -[기본 연동 단계](#basic-setup)에 명시된 바와 같이, ADjust는 앱 델리게이트의 `didFinishLaunching` 또는 `didFinishLaunchingWithOptions` 메서드 내에서 Adjust SDK를 초기화하는 것을 강력히 권고합니다. Adjust SDK를 최대한 빨리 초기화하여야 SDK의 모든 기능을 사용할 수 있습니다. - -Adjust SDK를 즉시 초기화하지 않은 경우 앱 트래킹에 여러 영향을 미칠 수 있습니다. **앱에서 트래킹을 수행하려면 Adjust SDK가 *반드시* 초기화되어야 합니다.** - -SDK를 초기화 하기 전에 다음의 활동을 수행하려고 하면, - -* [이벤트 추적](#event-tracking) -* [딥링크를 통한 리어트리뷰션( reattribution)](#deeplinking-reattribution) -* [추적 비활성화](#disable-tracking) -* [오프라인 모드](#offline-mode) - -`수행되지 않을 것입니다`. - -실제 초기화 이전에 Adjust SDK에서 이러한 활동을 트래킹하려고 하면, 앱 안에 `custom actions queueing mechanism`를 빌드해야 합니다. Adjust SDK가 수행하기를 원하는 모든 활동을 대기하고, SDK가 초기화되었을 때 해당 활동을 수행해야 합니다. - -오프라인 모드 상태와 트래킹 활성화/비활성화 상태는 변경되지 않을 것이며, 딥링크 리어트리뷰션은 발생하지 않을 것이며, 트래킹된 이벤트는 모두 `포함되지 않을 것입니다`. - -지연된 SDK 초기화에 영향을 받는 또 다른 요소는 세션 트래킹입니다. Adjust SDK는 초기화 되기 전에 세션 길이 정보를 수집할 수 없습니다. 이는 대시보드의 DAU 수치에 영향을 주며, 트래킹이 제대로 되지 않을 것입니다. - -예시 시나리오: 특정 뷰나 뷰 컨트롤러가 로딩되었을 때 Adjust SDK를 초기화하려는 상황. 해당 시점은 스플래시 화면이나 앱의 첫 화면이 아니므로, 유저가 홈스크린부터 해당 화면에 도달해야 하는 상황입니다. 유저가 앱을 다운로드하고 실행하면 홈스크린이 나타날 것입니다. 유저가 설치를 완료했으므로 트래킹이 되어야 하는 이벤트입니다. 그러나 유저가 Adjust SDK를 초기화하기로 결정한 해당 화면에 도달해야 하기 때문에, Adjust SDK는 이 시점에서는 설치에 대해서 알 수 없습니다. 또한, 유저가 홈스크린을 본 뒤 바로 삭제하게 되면 이 모든 정보는 Adjust SDK에 트래킹되지 않으며, 대시보드에도 나타나지 않게 될 것입니다. - -#### 이벤트 트래킹 - -내부 대기 메커니즘을 통해 트래킹하고자 하는 이벤트를 대기시킨 뒤 SDK가 초기화된 이후 트래킹하시기 바랍니다. SDK 초기화 전에 이벤트를 트래킹하면 이벤트가 `포함되지 않고` `영구적으로 소실`될 수 있습니다. SDK가 `초기화`되고 [`활성화`](#is-enabled)된 이후에 이벤트를 트래킹하시기 바랍니다. - -#### 오프라인 모드 및 트래킹 활성화/비활성화 - -오프라인 모드는 SDK 초기화 간에 유지되는 기능이 아니므로, 기본값 설정은 `false`로 되어 있습니다. SDK 초기화 전 오프라인 모드를 활성화하면, 이후 SDK를 초기화할 때 `false`로 설정될 것입니다. - -트래킹의 활성화/비활성화는 SDK 초기화 간에 유지됩니다. SDK 초기화 전 이 값의 토글을 사용하고자 하면 토글 시도가 거부될 것입니다. 초기화가 완료되면 SDK는 토글 시도 전의 상태(활성화 또는 비활성화)일 것입니다. - -#### 딥링크를 통한 리어트리뷰션 - -[위에서](#deeplinking-reattribution) 명시된 바와 같이, 딥링크 리어트리뷰션의 처리 시에는 사용하는 딥링크 메커니즘(이전 방식 또는 유니버설 링크)에 따라, `NSURL` 객체를 얻게 되고 이후 다음을 호출해야 합니다. - -```objc -[Adjust appWillOpenUrl:url] -``` - -SDK 초기화 전에 해당 호출을 하면, 해당 딥링크 URL로부터의 어트리뷰션 정보는 영구적으로 소실됩니다. Adjust SDK가 성공적으로 유저를 리어트리뷰션하길 원하면 `NSURL` 객체 정보를 대기시킨 뒤, SDK가 초기화 된 이후 `appWillOpenUrl` 메서드를 실행합니다. - -#### 세션 트래킹 - -세션 트래킹은 Adjust SDK가 자동으로 수행하는 기능으로, 앱 개발자가 액세스할 수 없습니다. 적절한 세션 트래킹을 위해 Adjust SDK는 이 README에서 설명된 방식으로 초기화되어야 합니다. 초기화가 제대로 되지 않으면 적절한 세션 트래킹과 대시보드의 DAU 수치에 예기치 못한 영향이 발생할 수 있습니다. - -그 예는 다음과 같습니다. -* SDK 초기화 전에 유저가 앱을 실행했으나 삭제한 경우, 해당 설치와 세션은 절대 트래킹되지 않으며 대시보드에서도 보고되지 않습니다. -* 유저가 자정 전에 앱을 다운로드하고 실행하고 Adjust SDK가 자정 이후에 초기화된 경우, 대기 중이었던 설치와 세션 데이터의 보고일이 정확하지 않을 것입니다. -* 유저가 특정일에는 앱을 사용하지 않았으나 자정 이후에 앱을 실행하고, SDK가 자정 이후 초기화된 경우에는 DAU가 앱 실행일과는 다른 날에 보고될 것입니다. - -이러한 이유로 본 문서에 있는 설명에 따라 앱 델리게이트의 `didFinishLaunching` 또는 `didFinishLaunchingWithOptions` 메서드에서 Adjust SDK를 초기화하시기 바랍니다. - -### "Adjust requires ARC" 오류가 발생한 경우 - -빌드가 `Adjust requires ARC` 오류로 실패한 경우는 프로젝트가 [ARC][arc]를 사용하지 않기 때문입니다. 이 경우 [프로젝트 트랜지션을 ][전환]하여 ARC를 사용하도록 하시기 바랍니다. ARC를 사용하고 싶지 않다면, 타겟의 빌드 단계에서 Adjust의 모든 소스 파일에 대해 ARC를 활성화해야 합니다. - -`Compile Sources` 그룹 확장, Adjust 파을 모두 선택하고 `Compiler Flags`를 `-fobjc-arc`로 변경 (모두 선택 후 `Return` 키를 눌러 일괄 변경 적용). - -### "[UIDevice adjTrackingEnabled]: 인스턴스에 미식별 선택자 전송" 오류가 발생한 경우 - -해당 에러는 Adjust SDK 프레임워크를 앱에 추가 시 발생합니다. Adjust SDK는 소스 파일 중에 `categories`를 포함하기 때문에, 사용자가 SDK 연동 접근법을 선택한 경우 Xcode 프로젝트 설정에서 `Other Linker Flags`에 `-ObjC` 플래그를 추가해야 합니다. 플래그를 추가하면 오류가 해결될 것입니다. - -### "세션 실패(너무 빈번한 세션 거부) 오류가 발생한 경우 - -본 오류는 일반적으로 설치 테스트 시 발생합니다. 앱의 설치 삭제와 재설치만으로는 새 설치가 트리거되지 않습니다. 서버는 SDK가 로컬에 집계된 세션 데이터를 소실했다고 판단하여, 해당 기기에 대해 서버에서 이용 가능한 정보를 기반으로 오류 메시지를 무시할 것입니다. - -이러한 행동은 테스트 시 번거로울 수 있으나, 샌드박스의 행동이 프로덕션 행동과 최대한 일치하도록 하기 위해 반드시 필요합니다. - -Adjust의 서버에서 해당 기기의 세션 데이터를 재설정할 수 있습니다. 로그에서 오류 메시지를 확인하시기 바랍니다. - -``` -세션 실패(너무 빈번한 세션 거부) 최종 세션: YYYY-MM-DDTHH:mm:ss,현재 세션: YYYY-MM-DDTHH:mm:ss, interval: XXs, min interval: 20m) (app_token: {yourAppToken}, adid: {adidValue}) -``` - -With the `{yourAppToken}` and either `{adidValue}` or `{idfaValue}` values filled in below, open one of the following links: - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&adid={adidValue} -``` - -``` -http://app.adjust.com/forget_device?app_token={yourAppToken}&idfa={idfaValue} -``` - -기기 정보가 삭제되면 링크는 `Forgot device` 값을 반환합니다. 기기 정보가 이미 삭제되었거나 값이 부정확한 경우, 링크는 `Device not found` 값을 반환합니다. - -### 로그에서 "Install tracked"를 확인할 수 없는 경우 - -테스트 기기에서 앱의 설치 시나리오를 시뮬레이션하고 싶은 경우, Xcode로부터 테스트 기기에 앱을 다시 실행하는 것만으로는 충분하지 않습니다. Xcode에서 앱을 다시 실행한다고 해서 앱 데이터가 삭제되는 것은 아니며, Adjust SDK가 앱 내부에서 보관하는 모두 내부 파일은 그대로 존재할 것입니다. 따라서, 앱이 재실행되면 Adjust SDK는 해당 파일을 보고 앱이 이미 설치(그리고 SDK가 이미 론칭되었다고 간주)되었으며, 최초 실행이 아니라 다시 실행된 것으로 간주합니다. - -앱 설치 시나리오를 확인하려면 다음을 수행해야 합니다. - -* 기기에서 앱 삭제(완전한 삭제) -* [위](#forget-device)에서 명시된 바와 같이 Adjust 백엔드에서 테스트 기기를 삭제합니다. -* 테스트 기기에 Xcode로부터 앱을 실행하면, "Install tracked" 로그 메시지를 볼 수 있습니다. - -### "Unattributable SDK click ignored" 메시지가 나타나는 경우 - -`sandbox` 환경에서 앱을 테스트할 때 나타날 수 있는 메시지입니다. 이는 Apple이 도입한 `iAd.framework` 버전 3 변경과 관련된 이슈입니다. 유저가 iAd 배너를 클릭하여 앱을 실행한 경우 Adjust SDK는 Adjust 백엔드로 `sdk_click` 패키지를 전송하여 클릭된 URL의 내용을 알립니다. 그러나 Apple은 iAD 배너를 클릭하지 않고 앱이 실행된 경우 무작위 값과 함께 iAd 배너 URL 클릭을 인위적으로 생성합니다. Adjust SDK는 iAD 배너 클릭이 실제 클릭인지 인위적으로 생성된 것인지 구분하지 못하기 때문에, 두 경우 모두 Adjust 백엔드로 `sdk_click` 패키지를 전송할 것입니다. 로그 레벨을 `verbose`로 설정한 경우, `sdk_click` 패키지가 다음과 같이 나타날 것입니다. - -``` -[Adjust]d: Added package 1 (click) -[Adjust]v: Path: /sdk_click -[Adjust]v: ClientSdk: ios4.10.1 -[Adjust]v: Parameters: -[Adjust]v: app_token {YourAppToken} -[Adjust]v: created_at 2016-04-15T14:25:51.676Z+0200 -[Adjust]v: details {"Version3.1":{"iad-lineitem-id":"1234567890","iad-org-name":"OrgName","iad-creative-name":"CreativeName","iad-click-date":"2016-04-15T12:25:51Z","iad-campaign-id":"1234567890","iad-attribution":"true","iad-lineitem-name":"LineName","iad-creative-id":"1234567890","iad-campaign-name":"CampaignName","iad-conversion-date":"2016-04-15T12:25:51Z"}} -[Adjust]v: environment sandbox -[Adjust]v: idfa XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -[Adjust]v: idfv YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY -[Adjust]v: needs_response_details 1 -[Adjust]v: source iad3 -``` - -`sdk_click`가 승인되면, 기타 캠페인 URL을 클릭하여 앱을 실행한 유저나 심지어 오가닉 유저조차 실제로 존재하지 않는 iAD 소스에 어트리뷰션 될 것입니다. 이러한 이유에서 Adjust 백엔드는 이를 거부하고, 다음의 메시지로 사용자에게 다음과 같이 알림을 보내는 것입니다. - -``` -[Adjust]v: Response: {"message":"Unattributable SDK click ignored."} -[Adjust]i: Unattributable SDK click ignored. -``` - -따라서 이 메시지는 SDK 연동에 문제가 있는 것이 아니라 Adjust 백엔드가 유저가 부정확하게 어트리뷰션/리어트리뷰션되지 않도록 인위적으로 생성된 `sdk_click`을 거부했음을 알리는 것입니다. - -### Adjust 대시보드에서 매출 데이터가 부정확한 경우 - -Adjust SDK는 사용자의 설정에 따라 트래킹합니다. 이벤트에 매출을 추가한 경우, 사용자가 입력한 금액만이 Adjust 백엔드에 전송되고 대시보드에 표시될 것입니다. Adjust SDK와 백엔드는 금액 값을 조정하지 않습니다. 잘못된 금액이 트래킹된다면 Adjust SDK가 해당 금액을 트래킹하도록 설정되었기 때문입니다. - -일반적으로 매출 이벤트 트래킹을 위한 사용자 코드는 다음과 같이 나타납니다. - -```objc -// ... - -- (double)someLogicForGettingRevenueAmount { - // 이 방식은 어떠한 매출 값이 트래킹 되어야 하는지에 관해 - // 사용자가 결정한 내용을 처리합니다. - - // 이를 결정하기 위해 계산을 할 수도 있습니다. - - // 또는 성공적으로 완료된 인앱 구매에서의 - // 정보를 가져올 수도 있습니다. - - // 또는 사전 정의된 이중 값을 반환할 수도 있습니다. - - double amount; // 이중 금액 = 이중 값 - - return amount; -} - -// ... - -- (void)someRandomMethodInTheApp { - double amount = [self someLogicForGettingRevenueAmount]; - - ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; - [event setRevenue:amount currency:@"EUR"]; - [Adjust trackEvent:event]; -} - -``` - -대시보드에서 예상한 바와 다른 트래킹 값을 보게 되면 **금액 값을 결정하는 로직을 확인하시기 바랍니다**. - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[en-readme]: ../../README.md -[zh-readme]: ../chinese/README.md -[ja-readme]: ../japanese/README.md -[ko-readme]: ../korean/README.md - -[sdk2sdk-mopub]: ../korean/sdk-to-sdk/mopub.md - -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[examples]: http://github.com/adjust/ios_sdk/tree/master/examples -[carthage]: https://github.com/Carthage/Carthage -[releases]: https://github.com/adjust/ios_sdk/releases -[cocoapods]: http://cocoapods.org -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html - -[example-tvos]: ../../examples/AdjustExample-tvOS -[example-iwatch]: ../../examples/AdjustExample-iWatch -[example-imessage]: ../../examples/AdjustExample-iMessage -[example-ios-objc]: ../../examples/AdjustExample-ObjC -[example-ios-swift]: ../../examples/AdjustExample-Swift - -[AEPriceMatrix]: https://github.com/adjust/AEPriceMatrix -[event-tracking]: https://docs.adjust.com/ko/event-tracking -[example-iwatch]: http://github.com/adjust/ios_sdk/tree/master/examples/AdjustExample-iWatch -[callbacks-guide]: https://docs.adjust.com/ko/callbacks -[universal-links]: https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html - -[special-partners]: https://docs.adjust.com/ko/special-partners -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[ios-web-views-guide]: /web_views.md -[currency-conversion]: https://docs.adjust.com/ko/event-tracking/#part-7 - -[universal-links-guide]: https://docs.adjust.com/ko/universal-links/ -[adjust-universal-links]: https://docs.adjust.com/ko/universal-links/ -[universal-links-testing]: https://docs.adjust.com/ko/universal-links/#part-4 -[reattribution-deeplinks]: https://docs.adjust.com/ko/deeplinking/#part-6-1 -[ios-purchase-verification]: https://github.com/adjust/ios_purchase_sdk/tree/master/doc/korean - -[reattribution-with-deeplinks]: https://docs.adjust.com/ko/deeplinking/#part-6-1 - -[run]: https://raw.github.com/adjust/sdks/master/Resources/ios/run5.png -[add]: https://raw.github.com/adjust/sdks/master/Resources/ios/add5.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag5.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate5.png -[framework]: https://raw.github.com/adjust/sdks/master/Resources/ios/framework5.png - -[adc-ios-team-id]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-ios-team-id5.png -[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png -[adc-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/adc-associated-domains5.png -[xcode-associated-domains]: https://raw.github.com/adjust/sdks/master/Resources/ios/xcode-associated-domains5.png -[universal-links-dashboard]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard5.png - -[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png -[universal-links-dashboard-values]: https://raw.github.com/adjust/sdks/master/Resources/ios/universal-links-dashboard-values5.png - -[en-helpcenter]: https://help.adjust.com/en/developer/ios-sdk-documentation -[zh-helpcenter]: https://help.adjust.com/zh/developer/ios-sdk-documentation -[ja-helpcenter]: https://help.adjust.com/ja/developer/ios-sdk-documentation -[ko-helpcenter]: https://help.adjust.com/ko/developer/ios-sdk-documentation - -## 라이선스 - -Adjust SDK는 MIT 라이선스에 따라 사용이 허가됩니다. - -Copyright (c) 2012-2019 Adjust GmbH, http://www.adjust.com - -이로써 본 소프트웨어와 관련 문서 파일(이하 "소프트웨어")의 복사본을 받는 사람에게는 아래 조건에 따라 소프트웨어를 제한 없이 다룰 수 있는 권한이 무료로 부여됩니다. 이 권한에는 소프트웨어를 사용, 복사, 수정, 병합, 출판, 배포 및/또는 판매하거나 2차 사용권을 부여할 권리와 소프트웨어를 제공 받은 사람이 소프트웨어를 사용, 복사, 수정, 병합, 출판, 배포 및/또는 판매하거나 2차 사용권을 부여하는 것을 허가할 수 있는 권리가 제한 없이 포함됩니다. - -위 저작권 고지문과 본 권한 고지문은 소프트웨어의 모든 복사본이나 주요 부분에 포함되어야 합니다. - -소프트웨어는 상품성, 특정 용도에 대한 적합성 및 비침해에 대한 보증 등을 비롯한 어떤 종류의 명시적이거나 암묵적인 보증 없이 "있는 그대로" 제공됩니다. 어떤 경우에도 저작자나 저작권 보유자는 소프트웨어와 소프트웨어의 사용 또는 기타 취급에서 비롯되거나 그에 기인하거나 그와 관련하여 발생하는 계약 이행 또는 불법 행위 등에 관한 배상 청구, 피해 또는 기타 채무에 대해 책임지지 않습니다. ---END-- diff --git a/doc/korean/criteo_plugin.md b/doc/korean/criteo_plugin.md deleted file mode 100644 index 7dfb51df4..000000000 --- a/doc/korean/criteo_plugin.md +++ /dev/null @@ -1,236 +0,0 @@ -## Criteo 플러그인 - -다음 방법 중 하나를 수행하여 Criteo 이벤트와 adjust를 연동하세요. - -### CocoaPods - -[CocoaPods](http://cocoapods.org/)를 사용하는 경우, Podfile에 다음 줄을 추가 할 수 있습니다 : - -```ruby -pod 'Adjust/Criteo' -``` - -### Carthage - -[Carthage](https://github.com/Carthage/Carthage)를 사용하는 경우 Cartfile에 다음 줄을 추가 할 수 있습니다. - -```ruby -github "adjust/ios_sdk" "criteo" -``` - -### 소스 - -다음 방법 중 하나를 수행하여 Criteo 이벤트와 adjust를 통합하세요. - -1. 애드저스트의 [releases page](https://github.com/adjust/ios_sdk/releases)에서 다운로드한 아카이브에서`plugin / Criteo` 폴더를 찾으세. - -2.`ADJCriteo.h`를 드래그하세요. 그리고`ADJCriteo.m` 파일을 프로젝트 내의`Adjust` 폴더에 넣습니다. - -3. '이 파일을 추가하기위한 옵션 선택'대화 상자에서 확인란을 선택하십시오 -'필요한 경우 항목 복사'로 이동하고 '그룹 만들기'라디오 버튼을 선택하십시오. - -### Criteo 이벤트 -이제 다음 예시와 같이 각기 다른 Criteo 이벤트를 연동할 수 있습니다. - -#### 리스팅보기 - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewListingEventToken}"]; - -NSArray *productIds = @[@"productId1", @"productId2", @"product3"]; - -[ADJCriteo injectViewListingIntoEvent:event productIds:productIds]; - -[Adjust trackEvent:event]; -``` - -#### View Product - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{viewProductEventToken}"]; - -[ADJCriteo injectViewProductIntoEvent:event productId:@"productId1"]; - -[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]; - -[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 - transactionId:@"transactionId1" newCustomer:@"newCustomerId"]; - -[Adjust trackEvent:event]; -``` - -#### User Level - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{userLevelEventToken}"]; - -[ADJCriteo injectUserLevelIntoEvent:event uiLevel:1]; - -[Adjust trackEvent:event]; -``` - -#### User Status - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{userStatusEventToken}"]; - -[ADJCriteo injectUserStatusIntoEvent:event uiStatus:@"uiStatusValue"]; - -[Adjust trackEvent:event]; -``` - -### Achievement Unlocked - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{achievementUnlockedEventToken}"]; - -[ADJCriteo injectAchievementUnlockedIntoEvent:event uiAchievement:@"uiAchievementValue"]; - -[Adjust trackEvent:event]; -``` - -### 커스텀 이벤트 - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEventEventToken}"]; - -[ADJCriteo injectCustomEventIntoEvent:event uiData:@"uiDataValue"]; - -[Adjust trackEvent:event]; -``` - -### 커스텀 이벤트 2 - -```objc -#import "ADJCriteo.h" - -ADJEvent *event = [ADJEvent eventWithEventToken:@"{customEvent2EventToken}"]; - -[ADJCriteo injectCustomEvent2IntoEvent:event uiData2:@"uiDataValue2" uiData3:3]; - -[Adjust trackEvent:event]; -``` - -#### Hashed Email - -`injectHashedEmailIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 해시 된 이메일을 첨부할 수 있습니다. -해시된 이메일은 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작하면 다시 설정해야합니다. -그러므로 앱이 다시 시작될 경우 다시 설정해야합니다. -`injectHashedEmailIntoCriteoEvents` 메소드를 0으로 설정하여 해시 된 이메일을 제거할 수 있습니다. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectHashedEmailIntoCriteoEvents:@"8455938a1db5c475a87d76edacb6284e"]; -``` - -#### Search dates - -`injectViewSearchDatesIntoCriteoEvent` 메소드를 사용하여 모든 Criteo 이벤트에 체크인 및 체크 아웃 날짜를 첨부 할 수 있습니다. 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 날짜가 전송되므로 앱을 다시 시작하면 다시 설정해야합니다. - -`injectViewSearchDatesIntoCriteoEvents` 날짜를 0으로 설정하여 검색 날짜를 제거할 수 있습니다. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectViewSearchDatesIntoCriteoEvents:@"2015-01-01" checkOutDate:@"2015-01-07"]; -``` - -#### Partner id - -`injectPartnerIdIntoCriteoEvent` 메소드를 사용하여 모든 Criteo 이벤트에 파트너 ID를 첨부 할 수 있습니다. 파트너 ID는 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작하면 다시 설정해야합니다. - -`injectPartnerIdIntoCriteoEvent` 값을`nil로 설정하여 검색 날짜를 제거 할 수 있습니다. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectPartnerIdIntoCriteoEvents:@"{criteoPartnerId}"]; -``` - -#### Send deeplink - -Project Navigator에서 애플리케이션 delegate의 소스 파일을 실행합니다. openURL 메소드를 찾거나 추가하고 다음 호출을 추가하여 조정하십시오. - -```objc -#import "ADJCriteo.h" - -- (BOOL) application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation -{ - ADJEvent *event = [ADJEvent eventWithEventToken:@"{deeplinkEventToken}"]; - - [ADJCriteo injectDeeplinkIntoEvent:event url:url]; - - [Adjust trackEvent:event]; - - //... -} -``` - -### 고객 ID - -`injectCustomerIdIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 고객 ID를 첨부 할 수 있습니다. 고객 ID는 애플리케이션 수명주기 동안 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작할 때 다시 설정해야합니다. - -`injectPartnerIdIntoCriteoEvent` 값을 `nil`으로 설정하여 검색 날짜를 제거 할 수 있습니다. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectCustomerIdIntoCriteoEvents:@"{CriteoCustomerId}"]; - -``` - -#### User Segment - -`injectUserSegmentIntoCriteoEvents` 메소드를 사용하여 모든 Criteo 이벤트에 사용자 분할을 첨부 할 수 있습니다. 고객 ID는 앱 라이프사이클에서 모든 Criteo 이벤트와 함께 전송되므로 앱을 다시 시작할 때 다시 설정해야합니다. - -`injectUserSegmentIntoCriteoEvents` 값을 'null'로 설정하여 사용자 분할을 제거 할 수 있습니다. - -```objc -#import "ADJCriteo.h" - -[ADJCriteo injectUserSegmentIntoCriteoEvents:@"{CriteoUserSegment}"]; -``` diff --git a/doc/korean/fb_pixel.md b/doc/korean/fb_pixel.md deleted file mode 100644 index 074b4efa5..000000000 --- a/doc/korean/fb_pixel.md +++ /dev/null @@ -1,126 +0,0 @@ -## Facebook 픽셀 연동 - -[Facebook 픽셀](https://www.facebook.com/business/help/952192354843755)은 Facebook의 웹 전용 애널리틱스 도구입니다. 종전에는 Facebook SDK으로 앱 WebView에서 픽셀 이벤트를 추적할 수 없었으나 [Facebook SDK](https://developers.facebook.com/docs/analytics) v4.34 버전 출시와 더불어 이제 가능해졌으며, [하이브리드 모바일 앱 이벤트](https://developers.facebook.com/docs/app-events/hybrid-app-events)를 사용하여 Facebook 픽셀 이벤트를 Facebook 앱 이벤트로 전환할 수 있습니다. - -또한 Facebook SDK에 연동하지 않고도 Adjust SDK로 Facebook 픽셀을 사용할 수 있습니다. - -## Facebook 연동 - -### 앱 예제 - -[`AdjustExample-FbPixel` 디렉토리][example-fbpixel]에서 Adjust WebView SDK를 사용하지 않고 Facebook 픽셀 이벤트를 추적하는 방법을 설명하는 앱 예제를 찾아볼 수 있습니다. - -### Facebook App ID - -Facebook SDK 연동을 하지 않아도 됩니다. 그러나 Adjust SDK가 Facebook 픽셀을 연동하도록 하기 위해서는 Facebook SDK에서와 동일한 몇 단계의 절차를 밟아야 합니다. - -[Facebook iOS SDK 지침](https://developers.facebook.com/docs/ios/getting-started/#xcode)에 설명한 대로 Facebook App ID를 앱에 추가해야 합니다. 위 지침에 설명한 단계를 그대로 따르면 되며, 이용자의 편의를 위해 아래에 그대로 복사해 놓았습니다. - -- Xcode에서 프로젝트 내 `Info.plist` 파일을 우클릭한 후 'Open As' -> 'Source Code'를 선택합니다. -- 다음 XML 라인을 파일 본문 마지막 `` 엘리먼트 바로 앞에 삽입합니다. - - ```xml - - ... - FacebookAppID - {your-app-id} - ... - - ``` - -- `{your-app-id}`를 사용 중인 앱의 App ID로 대체합니다. (App ID는 *Facebook App 대시보드*에서 확인할 수 있습니다.) - -### Facebook 픽셀 환경설정 - -픽셀 연동에 대한 Facebook 지침을 따르면 됩니다. 자바스크립트 코드는 다음과 같이 보일 것입니다. - -```js - - -... - -``` - -이제 [하이브리드 모바일 앱 이벤트 지침](https://developers.facebook.com/docs/app-events/hybrid-app-events) 내 `Update Your Pixel` 섹션에서 설명한 대로 Facebook 픽셀 코드를 다음과 같이 업데이트합니다. - -```js -fbq('init', ); -fbq('set', 'mobileBridge', , ); -``` - -**주의**: `'init'`를 먼저 호출하고 바로 그 다음에 `'set'` 메서드를 호출하는 게 **대단히 중요**함을 명심해 주십시오. (위에 나온 것처럼) Facebook에서 제공하여 사용 대상 HTML 웹 페이지에 붙이는 스크립트 라인에는, `'init'` 호출 바로 다음에 페이지 보기 이벤트에 사용하는 `'track'` 메서드가 들어 있습니다. 이 페이지 보기 이벤트를 올바로 추적하려면 그 사이에 반드시 `'set'` 메서드를 호출해야 합니다! - -## Adjust 연동 - -### WebView 증강 - -[iOS WebView](web_views.md) 앱의 연동 지침을 따르면 됩니다. WebView 브릿지를 로드할 섹션은 아래를 참조하십시오. - -```objc -- (void)viewWillAppear:(BOOL)animated { - ... - UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - // or with WKWebView: - // WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - // add @property (nonatomic, strong) AdjustBridge *adjustBridge; on your interface - self.adjustBridge = [[AdjustBridge alloc] init]; - [self.adjustBridge loadUIWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadUIWebViewBridge:webView webViewDelegate:(UIWebViewDelegate*)self]; - - // or with WKWebView: - // [self.adjustBridge loadWKWebViewBridge:webView]; - // optionally you can add a web view delegate so that you can also capture its events - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; - ... -``` - -WebView를 Adjust 브릿지에 로드하는 데 어떤 방법을 사용하든 상관 없이 공통적으로 아래 라인을 추가하고 해당 단계를 따르면 됩니다. - -```objc -[self.adjustBridge augmentHybridWebView]; -``` - -### 이벤트 이름 환경설정 - -Adjust 웹 브릿지 SDK는 Facebook 픽셀 이벤트를 Adjust 이벤트로 전환시켜 줍니다. - -따라서 Facebook 픽셀을 특정한 Adjust 이벤트에 배치(매핑, mapping)하거나, Facebook 픽셀 환경설정에서 복사해 와서 붙이는 `fbq('track', 'PageView');` 등의 Facebook 픽셀 이벤트 추적을 Adjust SDK를 사용하여 시작하기 **전에** Adjust 이벤트 토큰의 기본값을 설정해야 합니다. - -Facebook 픽셀 이벤트와 Adjust 이벤트를 매핑하려면 Adjust SDK를 초기화하기 전에 `adjustConfig` 인스턴스에서 `addFbPixelMapping(fbEventNameKey, adjEventTokenValue)` 메서드를 호출합니다. 매핑이 이루어진 예는 아래와 같습니다. - -```js -adjustConfig.addFbPixelMapping('fb_mobile_search', adjustEventTokenForSearch); -adjustConfig.addFbPixelMapping('fb_mobile_purchase', adjustEventTokenForPurchase); -``` - -위에 보이는 매핑의 예시는 Facebook 이벤트 중 `fbq('track', 'Search', ...);` 및 `fbq('track', 'Purchase', ...);`를 각각 추적하는 경우에 해당함을 유의해 주십시오. 아쉽게도 Adjust는 자바스크립트에서 추적하는 이벤트 이름과 Facebook SDK에 사용하는 이벤트 이름 전체의 매핑 구조에는 접근할 수 없습니다. - -사용자에게 도움을 드리고자 Adjust가 지금까지 찾아 낸 이벤트 이름 정보를 다음과 같이 정리했습니다. - -| 픽셀 이벤트 이름 | 해당하는 Facebook 앱 이벤트 이름 -| ---------------- | ------------------------------------- -| ViewContent | fb_mobile_content_view -| Search | fb_mobile_search -| AddToCart | fb_mobile_add_to_cart -| AddToWishlist | fb_mobile_add_to_wishlist -| InitiateCheckout | fb_mobile_initiated_checkout -| AddPaymentInfo | fb_mobile_add_payment_info -| Purchase | fb_mobile_purchase -| CompleteRegistration | fb_mobile_complete_registration - -위 목록은 완전하지 않을 수 있으며, Facebook이 현재 목록에 새 항목을 추가하거나 목록을 업데이트할 가능성도 있습니다. 테스트하는 중에는 다음과 같은 Adjust 경고 로그를 확인하십시오. - -``` -There is not a default event token configured or a mapping found for event named: 'fb_mobile_search'. It won't be tracked as an adjust event -``` - -매핑 환경설정을 하지 않았다면 그냥 Adjust 이벤트 기본값을 사용할 수도 있습니다. Adjust SDK를 초기화하기 전에 `adjustConfig.setFbPixelDefaultEventToken(defaultEventToken);` 메서드를 호출하기만 하면 됩니다. - -[example-fbpixel]: ../../examples/AdjustExample-FbPixel diff --git a/doc/korean/sdk-to-sdk/admob.md b/doc/korean/sdk-to-sdk/admob.md deleted file mode 100644 index 19626d909..000000000 --- a/doc/korean/sdk-to-sdk/admob.md +++ /dev/null @@ -1,28 +0,0 @@ -# Adjust SDK에서 AdMob 광고 매출 트래킹 - -[Adjust iOS SDK README][ios-readme] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.29.0** - -Admob SDK의 광고 매출을 트래킹하고 싶다면, Adjust의 SDK 연동을 사용하여 Adjust 백엔드로 광고 매출 정보를 전송할 수 있습니다. 이를 위해서는 기록하고자 하는 정보를 포함한 Adjust 광고 매출 객체를 구성한 뒤, `trackAdRevenue` 메서드를 사용하여 객체를 전송해야 합니다. - -> 참고: AdMob과의 광고 매출 트래킹에 관한 문의 사항은 담당 어카운트 매니저나 [support@adjust.com](mailto:support@adjust.com)으로 연락주시기 바랍니다. - -### 예시 - -```objc -- (void)requestRewardedAd { - self.rewardedAd = [[GADRewardedAd alloc] initWithAdUnitID:@"ad unit ID"]; - ViewController *strongSelf = weakSelf; - self.rewardedAd.paidEventHandler = ^void(GADAdValue *_Nonnull value) { - // ... - // send ad revenue info to Adjust - ADJAdRevenue *adRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAdMob]; - [adRevenue setRevenue:value.value currency:value.currencyCode]; - [Adjust trackAdRevenue:adRevenue]; - } -}; -``` -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/korean/README.md diff --git a/doc/korean/sdk-to-sdk/applovin-max.md b/doc/korean/sdk-to-sdk/applovin-max.md deleted file mode 100644 index d38575218..000000000 --- a/doc/korean/sdk-to-sdk/applovin-max.md +++ /dev/null @@ -1,28 +0,0 @@ -# Adjust SDK에서 AppLovin MAX 광고 매출 트래킹 - -[Adjust iOS SDK README][ios-readme] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.29.0** - -AppLovin MAX SDK와 광고 매출을 트래킹하고 싶다면, Adjust의 SDK간 연동을 사용하여 Adjust 백엔드로 해당 정보를 전송할 수 있습니다. 이를 위해서는 기록하고자 하는 정보를 포함한 Adjust 광고 매출 객체를 구성한 뒤, `trackAdRevenue` 메서드를 사용하여 객체를 전송해야 합니다. - -> 참고: AppLovin MAX와의 광고 매출 트래킹에 관한 문의 사항은 담당 어카운트 매니저나 [support@adjust.com](mailto:support@adjust.com)으로 연락주시기 바랍니다. - -### 예시 - -```objc -- (void)didPayRevenueForAd:(MAAd *)ad { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceAppLovinMAX]; - - adjustAdRevenue.setRevenue(ad.revenue, "USD"); - adjustAdRevenue.setAdRevenueNetwork(ad.networkName); - adjustAdRevenue.setAdRevenueUnit(ad.adUnitIdentifier); - adjustAdRevenue.setAdRevenuePlacement(ad.placement); - - Adjust.trackAdRevenue(adjustAdRevenue); -} -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/korean/README.md diff --git a/doc/korean/sdk-to-sdk/ironsource.md b/doc/korean/sdk-to-sdk/ironsource.md deleted file mode 100644 index 07ca76eaf..000000000 --- a/doc/korean/sdk-to-sdk/ironsource.md +++ /dev/null @@ -1,28 +0,0 @@ -# Adjust SDK에서 ironSource 광고 매출 트래킹 - -[Adjust iOS SDK README][ios-readme] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.29.0** - -ironSource SDK의 광고 매출을 트래킹하고 싶다면, Adjust의 SDK 연동을 사용하여 Adjust 백엔드로 광고 매출 정보를 전송할 수 있습니다. 이를 위해서는 기록하고자 하는 정보를 포함한 Adjust 광고 매출 객체를 구성한 뒤, `trackAdRevenue` 메서드를 사용하여 객체를 전송해야 합니다. - -> 참고: ironSource와의 광고 매출 트래킹에 관한 문의 사항은 담당 어카운트 매니저나 [support@adjust.com](mailto:support@adjust.com)으로 연락주시기 바랍니다. - -### 예시 - -```objc -- (void)impressionDataDidSucceed:(ISImpressionData *)impressionData { - ADJAdRevenue *adjustAdRevenue = [[ADJAdRevenue alloc] initWithSource:ADJAdRevenueSourceIronSource]; - [adjustAdRevenue setRevenue:impressionData.revenue currency:@"USD"]; - // optional fields - [adjustAdRevenue setAdRevenueNetwork:impressionData.ad_network]; - [adjustAdRevenue setAdRevenueUnit:impressionData.ad_unit]; - [adjustAdRevenue setAdRevenuePlacement:impressionData.placement]; - // track Adjust ad revenue - [Adjust trackAdRevenue:adjustAdRevenue]; -} -``` - -[ios-readme]: https://github.com/adjust/ios_sdk/blob/master/doc/korean/README.md diff --git a/doc/korean/sdk-to-sdk/mopub.md b/doc/korean/sdk-to-sdk/mopub.md deleted file mode 100644 index b7ffe0dd8..000000000 --- a/doc/korean/sdk-to-sdk/mopub.md +++ /dev/null @@ -1,35 +0,0 @@ -## Adjust SDK를 이용한 MoPub 광고 매출 트래킹 - -[Adjust iOS SDK README][ios-readme] - -[MoPub iOS 문서][mopub-docs] - -이 기능에 필요한 최소 SDK 버전: - -- **Adjust SDK v4.18.0** -- **MoPub SDK v5.7.0** - -**보상형 동영상 광고를** 보여주는 경우: MoPub SDK `didTrackImpressionWithAdUnitID:impressionData:` 콜백 메서드 구현 중에 다음과 같이 `trackAdRevenue:payload:` Adjust SDK 메서드를 호출하세요. - -```objc -- (void)didTrackImpressionWithAdUnitID:(NSString *)adUnitID - impressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -**다른 광고 포멧을** 보여주는 경우:보여주는 경우: MoPub SDK `mopubAd:didTrackImpressionWithImpressionData:` 콜백 메서드 구현 중에 다음과 같이 `trackAdRevenue:payload:` Adjust SDK 메서드를 호출하세요. - - -```objc -- (void)mopubAd:(id)ad didTrackImpressionWithImpressionData:(MPImpressionData * _Nullable)impressionData { - // Pass impression data JSON to Adjust SDK. - [Adjust trackAdRevenue:ADJAdRevenueSourceMopub payload:[impressionData jsonRepresentation]]; -} -``` - -MoPub을 이용한 광고 매출 트래킹에 관해 질문이 있는 경우 담당 계정 관리자에게 문의하거나 support@adjust.com에 이메일을 보내 주시기 바랍니다. - -[mopub-docs]: https://developers.mopub.com/publishers/android/impression-data/ -[ios-readme]: ../../korean/README.md diff --git a/doc/korean/web_views.md b/doc/korean/web_views.md deleted file mode 100644 index 0d84e04ff..000000000 --- a/doc/korean/web_views.md +++ /dev/null @@ -1,836 +0,0 @@ -## 요약 - -웹뷰(하이브리드)를 사용하는 iOS 앱 용 Adjust\'99의 iOS SDK 가이드입니다. [adjust.com]에서 Adjust™에 대한 정보를 더 자세히 알아보세요. - -[WebViewJavascriptBridge][web_view_js_bridge] 플러그인을 사용하여 Javascript에서 네이티브 Objective-C 호출(또는 그 반대로)로 브릿지를 제공합니다. 이 플러그인은 MIT 라이센스에 따라 사용이 허가되었습니다. - -## 목차 - -* [앱 예시](#example-app) -* [기본 연동](#basic-integration) - * [웹 브리지가있는 SDK를 프로젝트에 추가](#sdk-add) - * [iOS 프레임워크 추가](#sdk-frameworks) - * [앱에 SDK 연동](#sdk-integrate) - * [AdjustBridge를 앱에 연동](#bridge-integrate-app) - * [AdjustBridge를 웹뷰에 연동](#bridge-integrate-web) - * [기본 설정](#basic-setup) - * [Adjust 로](#adjust-logging) - * [앱 빌드하기](#build-the-app) -* [부가 기능](#additional-features) - * [이벤트 추적](#event-tracking) - * [매출 추적](#revenue-tracking) - * [매출 중복 제거](#revenue-deduplication) - * [콜백 파라미터](#callback-parameters) - * [파트너 파라미터](#partner-parameters) - * [세션 파라미터](#session-parameters) - * [세션 콜백 파라미터](#session-callback-parameters) - * [세션 파트너 파라미터](#session-partner-parameters) - * [지연 시작](#delay-start) - * [어트리뷰션 콜백](#attribution-callback) - * [이벤트 및 세션 콜백](#event-session-callbacks) - * [추적 비활성화](#disable-tracking) - * [오프라인 모드](#offline-mode) - * [이벤트 버퍼링](#event-buffering) - * [GDPR 잊혀질 권리(Right to be Forgotten)](#gdpr-forget-me) - * [타사 공유 비활성화](#disable-third-party-sharing) - * [SDK 서명](#sdk-signature) - * [백그라운드 추적](#background-tracking) - * [기기 ID](#device-ids) - * [iOS 광고 식별자](#di-idfa) - * [Adjust 기기 식별자](#di-adid) - * [사용자 어트리뷰션](#user-attribution) - * [푸시 토큰](#push-token) - * [사전 설치 트래커](#pre-installed-trackers) - * [딥링크](#deeplinking) - * [표준 딥링크 시나리오](#deeplinking-standard) - * [iOS 8 이전 버전에서의 딥링크](#deeplinking-setup-old) - * [iOS 9 이후 버전에서의 딥링크](#deeplinking-setup-new) - * [지연 딥링크(deferred deeplink) 시나리오](#deeplinking-deferred) - * [딥링크를 통한 리어트리뷰션( reattribution)](#deeplinking-reattribution) -* [라이선스](#license) - -## 앱 예시 - -repository에서 예시앱[웹 iOS 앱] [example-webview]를 찾을 수 있습니다. 이 프로젝트를 사용하여 Adjust SDK를 연동하는 방법을 확인할 수 있습니다. - -## 기본 연동 - -웹 브리지 SDK v4.9.1 또는 이전 버전에서 마이그레이션하는 경우이 새 버전으로 업데이트 할 때 [this migration guide] (web_view_migration.md)를 따르십시오. - -iOS 개발용 Xcode를 사용한다는 가정하에 iOS 프로젝트에 Adjust SDK를 연동하는 방법을 설명합니다. - -### 웹 브리지가있는 SDK를 프로젝트에 추가 - -[CocoaPods][cocoapods]를 사용하는 경우, 다음 내용을 'Podfile'에 추가한 후 [해당 단계](#sdk-integrate)를 완료하세요. - -```ruby -pod 'Adjust/WebBridge', '~> 4.31.0' -``` - ---- - -[Carthage][carthage]를 사용하는 경우, 다음 내용을 'Cartfile'에 추가한 후 [해당 단계](#sdk-frameworks)를 완료하세요. - -```ruby -github "adjust/ios_sdk" -``` - ---- - -프로젝트에 Adjust SDK를 프레임워크로 추가하여 연동할 수도 있습니다. [releases page][releases]에서`AdjustSdkWebBridge.framework.zip`을 찾을 수 있습니다 여기에는 동적 프레임이 포함되어 있습니다. \ - -### iOS 프레임워크 추가 - -1. Project Navigator에서 프로젝트를 선택합니다. -2. 메인 화면 좌측에서 타겟을 선택합니다. -3. 'Build Phases' 탭에서 'Link Binary with Libraries' 그룹을 확장합니다. -4. 해당 섹션의 하단에서 '+' 버튼을 선택합니다. -5. 'AdSupport.framework'를 선택하고 'Add' 버튼을 클릭합니다. -6. 동일한 단계를 반복하여 'iAd.framework'를 추가하십시오. `CoreTelephony.framework` and `WebView.framework` -7. 프레임워크의 'Status'를 'Optional'로 변경합니다. - -### 앱에 SDK 연동 - -Pod 리포지토리를 통해 Adjust SDK를 추가 한 경우 앱의 소스 파일에 다음 import 문 중 하나를 사용해야합니다. - -```objc -#import "AdjustBridge.h" -``` - ---- - -Adjust SDK를 정적/동적 프레임 워크 또는 Carthage를 통해 추가 한 경우 앱의 소스 파일에 다음 import 문구를 사용해야합니다. - -```objc -#가져오기 -``` - -다음으로는 기본 세션 추적을 설정하겠습니다. - -### AdjustBridge를 앱에 연동하기 - -프로젝트 네비게이터에서 소스 파일 View Controller를 엽니 다. 파일 맨 위에`import` 문구를 추가하십시오. -Web View Delegate의`viewDidLoad` 또는`viewWillAppear` 메소드는`AdjustBridge`에 다음 호출을 추가합니다. - -```objc -#import "AdjustBridge.h" -// or #import - -- (void)viewWillAppear:(BOOL)animated { - WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; - - //@property (nonatomic, strong) AdjustBridge *adjustBridge;를 인터페이스에 추가합니다 - [self.adjustBridge loadWKWebViewBridge:webView]; - // 선택적으로 이벤트를 캡처할 수 있도록 웹뷰 delegate를 추가 할 수 있습니다 - // [self.adjustBridge loadWKWebViewBridge:webView wkWebViewDelegate:(id)self]; -} - -// ... -``` - -`AdjustBridge` 인스턴스의`bridgeRegister` 속성을 사용하여 포함 된 WebViewJavascriptBridge 라이브러리를 사용할 수도 있습니다. -레지스터/콜 핸들러 인터페이스는 WebViewJavascriptBridge가 ObjC에 대해 수행하는 것과 유사합니다. 사용 방법은 [the library documentation] (https://github.com/marcuswestin/WebViewJavascriptBridge#usage)를 참조하십시오. - -### AdjustBrige를 웹뷰에 연동 - -웹뷰에서 자바 스크립트 브릿지를 사용하려면 섹션`4`에서`WebViewJavascriptBridge` 플러그인 [README] [wvjsb_readme]에서 설명하는 것처럼 구성해야합니다. 다음 자바스크립트 코드를 포함하여 Adjust iOS 웹브리지를 초기화합니다: - -```js -function setupWebViewJavascriptBridge(callback) { - if (window.WebViewJavascriptBridge) { - return callback(WebViewJavascriptBridge); - } - - if (window.WVJBCallbacks) { - return window.WVJBCallbacks.push(callback); - } - - window.WVJBCallbacks = [callback]; - - var WVJBIframe = document.createElement('iframe'); - WVJBIframe.style.display = 'none'; - WVJBIframe.src = 'https://__bridge_loaded__'; - document.documentElement.appendChild(WVJBIframe); - - setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0) -} -``` - -`WebViewJavascriptBridge`의 변경으로 인해`WVJBIframe.src = 'https : // __ bridge_loaded__';`행이 버전 4.11.6에서`WVJBIframe.src = 'wvjbscheme : // __ BRIDGE_LOADED__';`에서 변경되었습니다. 플러그인. - -### 기본 설정 - -동일한 HTML 파일에서`setupWebViewJavascriptBridge` 콜백 내에서 Adjust SDK를 초기화하십시오: - -```js -setupWebViewJavascriptBridge(function(bridge) { - // ... - - var yourAppToken = yourAppToken; - var environment = AdjustConfig.EnvironmentSandbox; - var adjustConfig = new AdjustConfig(yourAppToken, environment); - - Adjust.appDidLaunch(adjustConfig); - - // ... -}); -``` - -**참고**: Adjust SDK 초기화는 '아주 중요한' 단계입니다. 제대로 완료하지 않으면 [문제 해결 섹션](#ts-delayed-init)에서 설명하는 다양한 문제가 발생할 수 있습니다. - -Replace `yourAppToken` with your app token. [Dashboard]에서 결과를 확인해 보세요. - -테스트 또는 배포 등 어떤 목적으로 앱을 빌드하는에 따라 다음 두 값 중 하나의 'Environment(환경)'으로 설정해야 합니다. - -```js -var environment = AdjustConfig.EnvironmentSandbox; -var environment = AdjustConfig.EnvironmentProduction; -``` - -** 중요:**이 값은 앱을 테스트하는 상태에서만 'AdjustConfig.EnvironmentSandbox'로 설정해야합니다. 앱을 퍼블리시할 준비가 완료되면 앱스토어에 업데이트 전에 환경 모드를 AdjustConfig.EnvironmentProduction으로 변경하시기 바랍니다. 만약 앱 개발 및 테스트를 새로 시작한다면 AdjustConfig.EnvironmentSandbox로 설정하후 테스트를 진행하시면 대시보드에서 테스트 데이터가 구분됩니다. - -테스트 기기로 인해 발생하는 테스트 트래픽과 실제 트래픽을 구분하기 위해 다른 환경을 사용하고 있으니, 상황에 알맞은 설정을 적용하시기 바랍니다. 이는 매출을 추적하는 경우에 특히 중요합니다. - -### Adjust 로깅(logging) - -다음 파라미터 중 하나를 통해 'ADJConfig' 인스턴스에서 'setLogLevel:'을 호출하여 테스트하는 동안 조회할 로그의 양을 늘리거나 줄일 수 있습니다. - -```js -adjustConfig.setLogLevel(AdjustConfig.LogLevelVerbose) // enable all logging -adjustConfig.setLogLevel(AdjustConfig.LogLevelDebug) // enable more logging -adjustConfig.setLogLevel(AdjustConfig.LogLevelInfo) // the default -adjustConfig.setLogLevel(AdjustConfig.LogLevelWarn) // disable info logging -adjustConfig.setLogLevel(AdjustConfig.LogLevelError) // disable warnings as well -adjustConfig.setLogLevel(AdjustConfig.LogLevelAssert) // disable errors as well -adjustConfig.setLogLevel(AdjustConfig.LogLevelSuppress) // disable all logging -``` - -개발 중인 앱에 Adjust SDK가 기록하는 로그를 표시하지 않으려면, 'AdjustConfig.LogLevelSuppress` '를 선택한 후, 추가적으로 suppress log level 모드를 활성화한 constructor에서 세번째 파라미터의 true와 함께 'AdjustConfig' 객체를 초기화해야 합니다. - -```js -setupWebViewJavascriptBridge(function(bridge) { - // ... - - var yourAppToken = yourAppToken; - var environment = AdjustConfig.EnvironmentSandbox; - var adjustConfig = new AdjustConfig(yourAppToken, environment, true); - - Adjust.appDidLaunch(adjustConfig); - - // ... -}); -``` - -### 앱 빌드 - -앱을 빌드하고 실행합니다. 빌드를 성공적으로 완료했다면, 콘솔에서 SDK 로그를 꼼꼼하게 살펴보시기 바랍니다. 앱이 시작된 후 -앱을 처음으로 출시한 경우, 'Install tracked' 로그 정보를 반드시 확인하세요. - -## 부가 기능 - -Adjust SDK를 프로젝트에 연동하면 다음 기능을 활용할 수 있습니다. - -### 이벤트 추적 - -Adjust를 사용하여 이벤트를 트래킹할 수 있습니다. 특정 버튼에 대한 모든 탭을 트래킹하려는 경우를 가정해 보겠습니다. adjust 대시보드에서 이벤트 토큰을 생성합니다. 이는 'abc123'와 같은 형태입니다. 버튼의 'onclick' method에서 탭을 트래킹하기 위해 다음 줄을 추가합니다: - -```js -var adjustEvent = new AdjustEvent('abc123'); -Adjust.trackEvent(adjustEvent); -``` - -버튼을 탭하면 이제 로그에 'Event tracked'가 표시됩니다. - -이벤트 인스턴스를 사용하여 이벤트를 트래킹하기 전에 해당 이벤트를 더 구성할 수 있습니다. - -### 매출 트래킹 - -사용자가 광고를 탭하거나 인앱 구매를 통해 매출을 창출 할 수있는 경우 이벤트를 통해 해당 매출을 트래킹할 수 있습니다. 광고를 한번 누르는 행위에 €0.01의 매출 금액이 발생한다고 가정해 보겠습니다. 그 경우 매출 이벤트를 다음과 같이 트래킹할 수 있습니다.: - -```js -var adjustEvent = new AdjustEvent(eventToken); -adjustEvent.setRevenue(0.01, 'EUR'); -Adjust.trackEvent(adjustEvent); -``` - -이것은 물론 콜백 파라미터와 함께 쓸 수 있습니다. - -사용자가 통화 토큰을 설정하면 Adjust는 사용자가 대시보드에 설정한 통화 세팅에 따라 전송되는 매출을 reporting 매출로 자동 전환합니다. 지원하는 통화 리스트는 여기에서 확인하세요. [currency conversion here.][currency-conversion] - -[event tracking guide] [event-tracking-guide]에서 매출 및 이벤트 추적에 대한 자세한 내용을 확인할 수 있습니다. - -### 매출 중복 제거 - -중복되는 매출을 트래킹하는 것을 방지하기 위해 전환 ID를 선택적으로 추가할 수 있습니다. 마지막 열 개의 트랜잭션 ID가 보관되며, 중복되는 전환 ID가 있는 매출 이벤트는 건너뛰게 됩니다. 이러한 방식은 인앱 결제 트래킹에 활용하실 수 있습니다. - -웹뷰에서 트랜잭션 식별자에 액세스 할 수있는 경우 Adjust 이벤트 객체의 'setTransactionId' 메소드로 전달할 수 있습니다. 이렇게 하면 실제로 발생하지 않은 매출을 추적하는 것을 방지할 수 있습니다. - -```js -var adjustEvent = new AdjustEvent(eventToken); -adjustEvent.setTransactionId(transactionIdentifier); -Adjust.trackEvent(adjustEvent); -``` - -### 콜백 파라미터 - -[dashboard]에서 이벤트를 위한 콜백 URL을 등록할 수 있습니다. 그러면 Adjust는 이벤트가 트래킹될 때마다 해당 URL에 GET 요청을 보냅니다. 이벤트를 트래킹하기 전에 이벤트에서 'addCallbackParameter'를 호출하여 해당 이벤트에 콜백 파라미터를 추가 할 수 있습니다. 그런 다음 Adjust는 이러한 파라미터를 사용자의 콜백 URL에 추가합니다. - -예를 들어, 사용자가 이벤트를 위해 http://www.adjust.com/callback URL을 등록했으며 다음과 같은 이벤트를 트래킹한다고 가정해 보겠습니다. - -```js -var adjustEvent = new AdjustEvent(eventToken); -adjustEvent.addCallbackParameter('key', 'value'); -adjustEvent.addCallbackParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` - -이 경우, Adjust가 이벤트를 추적하여 다음으로 요청을 전송합니다. - - http://www.adjust.com/callback?key=value&foo=bar - -Adjust는 {idfa} 등 파라미터 값으로 사용될 수 있는 다양한 placeholder를 지원합니다. 콜백을 통해 이 placeholder는 현재 기기의 특정 ID로 대체될 수 있습니다. Adjust는 사용자의 커스텀 파라미터를 저장하지 않으며 콜백에 추가하기만 합니다. 또한 이벤트를 위한 콜백을 등록하지 않은 경우에는 이러한 파라미터를 읽지도 않습니다. - -Adjust [callbacks guide][callbacks-guide]에서 사용 가능한 값의 전체 리스트를 비롯하여 URL 콜백을 사용하는 방법을 자세히 알아보실 수 있습니다. - -### 파트너 파라미터 - -Adjust 대시보드에서 활성화된 연동에 대해 네트워크 파트너에게 전송할 파라미터를 추가 할 수도 있습니다. - -이는 상기 콜백 파라미터와 유사한 방식으로 이루어지지만, AdjustEvent 인스턴스의 addPartnerParameter 파라미터를 호출하여 추가할 수 있습니다. - -```js -var adjustEvent = new AdjustEvent('abc123'); -adjustEvent.addPartnerParameter('key', 'value'); -adjustEvent.addPartnerParameter('foo', 'bar'); -Adjust.trackEvent(adjustEvent); -``` - -[특별 파트너 가이드][special-partners]에서 특별 파트너와 연동 방법에 대한 자세한 내용을 알아보실 수 있습니다. - -### 세션 파라미터 - -일부 파라미터는 저장되어 Adjust SDK의 모든 이벤트 및 세션에 전송됩니다. 이러한 파라미터를 한 번 추가하면 로컬로 저장되기 때문에 매번 추가할 필요가 없습니다. 동일한 파라미터를 다시 추가해도 아무 일도 일어나지 않습니다. - -초기 설치 이벤트와 함께 세션 파라미터를 보내려면 Adjust.appDidLaunch ()를 통해 Adjust SDK를 시작하기 전에 반드시 호출해야합니다. 설치 시에 파라미터를 전송해야 하지만 필요한 값을 실행 이후에만 확보할 수 있는 경우, 이러한 동작이 가능하게 하려면 Adjust SDK의 첫 실행을 지연시키면 됩니다. - -### 세션 콜백 파라미터 - -Adjust SDK의 모든 이벤트 또는 세션에서 전송될 [events](#callback-parameters)를 위해 등록된 동일한 콜백 파라미터를 저장할 수 있습니다. - -세션 콜백 파라미터는 이벤트 콜백 파라미터와 유사한 인터페이스를 가집니다. 키와 이벤트에 값을 추가하는 대신 'Adjust' '메서 드'`addSessionCallbackParameter (key, value)`에 대한 호출을 통해 추가됩니다. : - -```js -Adjust.addSessionCallbackParameter('foo', 'bar'); -``` - -세션 콜백 파라미터는 콜백 파라미터와 병합되며 이벤트에 추가됩니다. 이벤트에 추가된 콜백 파라미터는 세션 콜백 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 콜백 파라미터를 이벤트에 추가하면 이벤트에 추가된 콜백 파라미터의 값이 우선시됩니다. - -원하는 키를`removeSessionCallbackParameter` 메소드에 전달하여 특정 세션 콜백 파라미터를 제거 할 수 있습니다. - -```js -Adjust.removeSessionCallbackParameter('foo'); -``` - -세션 콜백 파라미터에서 모든 키와 값을 삭제하려면 `resetSessionCallbackParameters` 메서드를 사용하여 재설정 할 수 있습니다. - -```js -Adjust.resetSessionCallbackParameters(); -``` - -### 세션 파트너 파라미터 - -Adjust SDK의 이벤트 또는 세션에 [session callback parameters] (# session-callback-parameters)가 전송되는 것처럼 세션 파트너 파라미터도 있습니다. - -이러한 파라미터는 사용자의 Adjust 대시보드에서 활성화된 네트워크 파트너 연동에 전송됩니다. - -세션 파트너 파라미터는 이벤트 파트너 파라미터와 유사한 인터페이스를 가집니다. 키와 값을 이벤트에 추가하는 대신, Adjust 메서드의 addSessionPartnerParameter:value::'로의 호출을 통해 추가합니다.\ - -```js -Adjust.addSessionPartnerParameter('foo','bar'); -``` - -세션 파트너 파라미터는 이벤트에 추가된 파트너 파라미터와 병합됩니다. 이벤트에 추가된 파트너 파라미터는 세션 파트너 파라미터보다 높은 우선순위를 가집니다. 세션에서 추가된 것과 동일한 키로 파트너 파라미터를 이벤트에 추가하면 이벤트에 추가된 파트너 파라미터의 값이 우선시됩니다. - -원하는 키를`removeSessionPartnerParameter` 메서드에 전달하여 특정 세션 파트너 파라미터를 삭제할 수 있습니다. - -```js -Adjust.removeSessionPartnerParameter('foo'); -``` - -세션 파트너 파라미터에서 모든 키와 값을 제거하려면`resetSessionPartnerParameters` 메소드를 사용하여 재설정할 수 있습니다. - -```js -Adjust.resetSessionPartnerParameters(); -``` - -### 시작 지연 - -Adjust SDK의 시작을 지연시키면 앱이 내부 유저 ID와 같은 세션 파라미터를 획득할 시간이 확보되므로, 세션 파라미터를 설치 시에 전송할 수 있게 됩니다. - -AdjustConfig 인스턴스의 setDelayStart 필드로 초기 지연 시간을 초 단위로 설정하세요. - -```js -adjustConfig.setDelayStart(5.5); -``` - -이렇게 설정하면 Adjust SDK가 초기 설치 세션과 5.5초 이내로 생성된 이벤트를 전송하지 않습니다. 이 시간이 만료되거나 그동안 Adjust.sendFirstPackages()`를 호출하면 모든 세션 파라미터가 지연된 설치 세션 및 이벤트에 추가되며 Adjust SDK가 평소대로 재개됩니다. - -Adjust SDK의 최대 시작 지연 시간은 10초입니다. - -### 어트리뷰션 콜백 - -어트리뷰션 변경에 대한 알림을 받도록 콜백 메서드를 등록 할 수 있습니다. 어트리뷰션에는 다양한 소스가 관련되어 있기 때문에 이 정보는 즉각적으로 제공될 수 없습니다. - -Adjust의 [applicable attribution data policies][attribution-data]을 반드시 고려해야 합니다. - -콜백 메소드는 'AdjustConfig'인스턴스를 사용하여 구성되므로`Adjust.appDidLaunch (adjustConfig)`를 호출하기 전에`setAttributionCallback`을 호출해야합니다. - -```js -adjustConfig.setAttributionCallback(function(attribution) { - //이 예시에서는 어트리뷰션 콘텐츠가 포함 된 경고만 표시합니다. - alert('Tracker token = ' + attribution.trackerToken + '\n' + - 'Tracker name = ' + attribution.trackerName + '\n' + - 'Network = ' + attribution.network + '\n' + - 'Campaign = ' + attribution.campaign + '\n' + - 'Adgroup = ' + attribution.adgroup + '\n' + - 'Creative = ' + attribution.creative + '\n' + - 'Click label = ' + attribution.clickLabel + '\n' + - 'Adid = ' + attribution.adid); -}); -``` - -SDK가 최종 어트리뷰션 데이터를 수신하면 콜백 메서드가 트리거됩니다. 콜백 내에서 어트리뷰션 파라미터에 액세스할 수 있습니다. 그 속성에 대한 요약 정보는 다음과 같습니다. - --`var trackerToken` 현재 설치의 트래커 토큰. --`var trackerName` 현재 설치의 트래커 이름. --var network : 현재 설치의 네트워크 레벨. --`var campaign` 현재 설치의 캠페인 레벨. --`var adgroup` 현재 설치의 광고 그룹 레벨. -- 'var creative'는 현재 설치의 크리에이티브 레벨 수준입니다. --`var clickLabel` 현재 설치의 클릭 레이블. -- 'var adid'는 어트리뷰션이 제공하는 고유 기기 식별자 (adjust ID). - -값을 사용할 수없는 경우 어트리뷰션 객체의 일부가 아닙니다. - -### 이벤트 및 세션 콜백 - -이벤트 또는 세션이 트래킹될시 알림을 받을 콜백을 등록할 수 있습니다. 콜백에는 네 가지가 있습니다. 하나는 성공적인 이벤트를 트래킹하기 위한 것, 하나는 실패한 이벤트를 트래킹하기 위한 것, 하나는 성공한 세션을 트래킹하기위한 것, 다른 하나는 실패한 세션을 트래킹하기 위한 것입니다. - -다음 단계를 수행하고 다음 콜백 메서드를 구현하여 성공적인 이벤트를 트래킹하십시오. - -```js -adjustConfig.setEventSuccessCallback(function(eventSuccess) { - // ... -}); -``` - -다음의 델리게이트 콜백 함수(delegate callback function)는 실패한 이벤트 트래킹에 사용됩니다: - -```js -adjustConfig.setEventFailureCallback(function(eventFailure) { - // ... -}); -``` - -성공한 세션을 트래킹하려면 : - -```js -adjustConfig.setSessionSuccessCallback(function(sessionSuccess) { - // ... -}); -``` - -실패한 세션을 트래킹하려면 : - -```js -adjustConfig.setSessionFailureCallback(function(sessionFailure) { - // ... -}); -``` - -SDK가 패키지를 서버로 전송하려고 시도한 후에 콜백 메소드가 호출됩니다. 콜백 메소드 내에서 콜백에 대한 response 데이터 객체에 액세스할 수 있습니다. 세션 반응 데이터 속성에 대한 요약 정보는 다음과 같습니다. - --`var message` 서버로부터의 메시지 또는 SDK에 의해 기록된 오류. --`var timeStamp` 서버의 타임 스탬프. -- 'var adid'는 Adjust가 제공하는 고유 기기 식별자 -- `var jsonResponse` 서버로부터의 응답을 포함하는 JSON 객체. - -두 이벤트 응답 데이터 개체는 다음을 포함합니다. - -- 'var eventToken'트래킹된 패키지가 이벤트인 경우 이벤트 토큰. - -두 이벤트 및 세션 실패 개체는 다음을 포함합니다. - -- 'var willRetry'는 이후 패키지 재전송 시도가 있음을 알립니다. - -### 추적 비활성화 - -`false` 파라미터와 함께`setEnabled`를 호출하여 Adjust SDK가 현재 기기의 모든 활동을 트래킹하는 것을 비활성화 할 수 있습니다. (주의: 트래킹 중단을 원한때만 사용하시기 바랍니다.) **이 설정은 세션 간에 유지됩니다 **. - -```js -Adjust.setEnabled(false); -``` - - `isEnabled 함수를 호출하여 Adjust SDK가 현재 활성화 되어있는지 확인할 수 있습니다. - -```js -Adjust.isEnabled(function(isEnabled) { - if (isEnabled) { - // SDK가 활성화되었습니다. - } else { - // SDK가 비활성화되었습니다. - } -}); -``` - -활성화된 파라미터를`true`로 설정하여 `setEnabled` 를 호출하고 언제든지 Adjust SDK를 활성화할 수 있습니다. - -### 오프라인 모드 - -Adjust 서버에 대한 전송을 연기하고 트래킹된 데이터가 이후에 전송되도록 유지함으로써 Adjust SDK를 오프라인 모드로 설정할 수 있습니다. 오프라인 모드에서는 모든 정보가 파일에 저장되기 때문에 너무 많은 이벤트를 발생시키지 않도록 주의해야 합니다. - -오프라인 모드를 활성화하려면 `setOfflineMode`를 호출하고 파라미터를 `true`로 설정합니다. - -```js -Adjust.setOfflineMode(true); -``` - -반대로 setOfflineMode를 false로 호출하여 오프라인 모드를 비활성화할 수 있습니다. Adjust SDK가 다시 온라인 모드가 되면 저장된 모든 정보가 정확한 시간 정보와 함께 Adjust 서버로 전송됩니다. - -트래킹 비활성화와는 다르게 **이 설정은 세션 간에 유지되지 않습니다**. 즉, 앱이 오프라인 모드에서 종료되었더라도 Adjust SDK는 항상 온라인 모드로 시작됩니다. - -### 이벤트 버퍼링 - -앱이 이벤트 추적을 많이 사용하는 경우, 일부 네트워크 요청을 연기하여 네트워크 요청을 1분에 한 번씩 일괄로 보낼 수 있습니다. `AdjustConfig` 인스턴스를 통해 이벤트 버퍼링을 활성화할 수 있습니다. - -```js -adjustConfig.setEventBufferingEnabled(true); -``` - -### GDPR 잊혀질 권리 - -EU의 개인정보보호법(GDPR) 제 17조에 따라, 사용자는 잊혀질 권리(Right to be Forgotten)를 행사했음을 Adjust에 알릴 수 있습니다. 다음 메서드를 호출하면 Adjust SDK가 잊혀질 권리에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다. - -```js -Adjust.gdprForgetMe(); -``` - -이 정보를 수신한 후 Adjust는 해당 사용자의 데이터를 삭제하며 Adjust SDK는 해당 사용자에 대한 추적을 중지합니다. 이 기기로부터의 요청은 향후 Adjust에 전송되지 않습니다. - - -### 타사 공유 비활성화 - -이제 사용자가 마케팅 파트너를 위해 파트너와 데이터 공유를 중단할 수 있는 권리를 행사하였지만 통계적인 목적을 위해 공유할 수 있도록 허용했다는 것을 Adjust에 알릴 수 있습니다. - -다음 메서드를 호출하여 Adjust SDK가 데이터 공유 비활성화에 대한 사용자의 선택과 관련된 정보를 Adjust 백엔드에 보냅니다: - -```js -Adjust.disableThirdPartySharing(); -``` - -이 정보를 수신하면 Adjust는 특정 사용자의 데이터를 파트너와 공유하는 것을 차단하고 Adjust SDK는 계속 정상적으로 작동합니다. - -### SDK 서명 - -Adjust SDK 서명은 클라이언트별로 활성화됩니다. 이 기능을 사용하기 위해서는 담당 매니저에게 문의하십시오. - -SDK 서명이 이미 계정에서 활성화되어 있으며 Adjust 대시보드의 App Secret에 액세스할 수 있는 경우, 아래 방법을 사용하여 SDK 서명을 앱에 연동하세요. - -'AdjustConfig'인스턴스에서`setAppSecret`을 호출하여 앱 시크릿을 설정합니다. - -```js -adjustConfig.setAppSecret(secretId, info1, info2, info3, info4); -``` - -### 백그라운드 추적 - -Adjust SDK는 기본적으로 앱이 백그라운드에서 작동하는 동안 네트워크 요청 전송을 일시 중지하도록 설정되어 있습니다. `AdjustConfig` 인스턴스에서 이 동작을 변경할 수 있습니다 : - -```js -adjustConfig.setSendInBackground(true); -``` - -아무 것도 설정되지 않으면 백그라운드 전송이 **기본적으로 비활성화됩니다**. - -### 기기 ID - -Adjust SDK를 사용하면 일부 기기 식별자를 얻을 수 있습니다. - -### iOS 광고 식별자 - -특정 서비스(예: Google Analytics)는 중복 보고를 방지하기 위해 기기 및 클라이언트 ID 통합을 요청합니다. - -기기 식별자 IDFA를 얻으려면`getIdfa` 함수를 호출하십시오. - -```js -Adjust.getIdfa(function(idfa) { - // ... -}); -``` - -### Adjust 기기 식별자 - -사용자의 앱이 설치된 각 기기에 대해 Adjust 백앤드는 고유한 **Adjust 기기 식별자**(**adid**)를 생성합니다. 이 식별자를 얻기 위해`Adjust` 인스턴스에서 다음 메서드를 호출 할 수 있습니다. - -```js -var adid = Adjust.getAdid(); -``` - -** 참고 ** : ** adid **에 대한 정보는 Adjust 백앤드에서 앱 설치를 트래킹한 후에 사용할 수 있습니다. 그 다음부터는 Adjust SDK가 기기 **adid** 정보를 보유하게 되며, 이 메서드를 사용하여 해당 정보에 액세스할 수 있습니다. 따라서 SDK가 초기화되고 앱 설치가 추적되기 전까지는 **adid**에 액세스할 수 **없습니다**. - -### 사용자 어트리뷰션 - -이 어트리뷰션 콜백은 [어트리뷰션 콜백 섹션](#attribution-callback)에 설명된 대로 실행되며, 변경될 때마다 새 어트리뷰션에 대한 정보를 제공합니다. 사용자의 현재 어트리뷰션에 대한 정보에 액세스할 수 있도록 하려면 `Adjust` object의 다음 메서드에 호출을 합니다. - -```js -var attribution = Adjust.getAttribution(); -``` - -**참고**: 현재 어트리뷰션에 대한 정보는 Adjust 백엔드가 앱의 설치를 추적하고 어트리뷰션 콜백이 처음으로 실행된 다음에만 사용할 수 있습니다. 그 다음부터는 Adjust SDK가 사용자의 어트리뷰션 상태에 대한 정보를 보유하게 되며, 이 메서드를 사용하여 해당 정보에 액세스할 수 있습니다. 따라서 SDK가 초기화되고 어트리뷰션 콜백이 실행되기 전까지는 사용자의 어트리뷰션 값에 액세스할 수 **없습니다**. - -### 푸시 토큰 - -푸시 토큰은 오디언스 빌더(Audience Builder) 및 클라이언트 콜백에 사용되며 삭제 및 재설치 트래킹 기능에 필요합니다. - -Adjust에 푸시 알림 토큰을 전송하려면 앱 델리게이트(app delegate)의 `didRegisterForRemoteNotificationsWithDeviceToken` 에 Adjust으로의 호출을 추가하세요. - -```objc -#"Adjust.h"가져오기 -// or # 가져오기 - -- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { - [Adjust setDeviceToken:deviceToken]; -} -``` - -또는 웹보기에서 푸시 토큰에 액세스 할 수있는 경우 Javascript의`Adjust` 오브젝트에서`setDeviceToken` 메소드를 대신 호출 할 수 있습니다. - -```js -Adjust.setDeviceToken(deviceToken); -``` - -### 사전 설치 트래커 - -Adjust SDK를 사용하여 본인의 앱을 발견하고 기기에 사전 설치한 사용자를 식별하려면 다음 단계를 따르세요. - -1. [대시보드]에서 새 트래커를 생성합니다. -2. 앱 델리게이트를 열고 AdjustConfig 인스턴스의 기본 트래커를 설정 및 추가합니다. - - ```js - adjustConfig.setDefaultTracker(trackerToken); - ``` - - 'trackerToken'을 2 단계에서 만든 트래커 토큰으로 바꿉니다. 대시보드에 트래커가 표시됩니다. - URL (including `http://app.adjust.com/`). 소스 코드에서 전체 URL이 아닌 - 6글자의 토큰만 지정해야 합니다. - -### 딥 링크 - -Adjust 트래커 URL을 사용하며 URL로부터 앱으로 딥링킹하는 옵션을 설정한 경우, 딥링크 및 그 콘텐츠에 대한 정보를 얻을 수 있습니다. 사용자가 앱을 이미 설치한 경우(표준 딥링크 시나리오) 또는 기기에 앲이 없는 경우(지연 딥링크 시나리오)에 URL 조회가 발생할 수 있습니다. 이 두 시나리오는 Adjust SDK에서 지원되며 두 경우 모두 트래커 URL에 도달 한 후 앱이 시작된 후 딥 링크 URL이 제공됩니다. 앱에서이 기능을 사용하려면 올바르게 설정해야합니다. - -### 표준 딥링크 시나리오 - -만일 사용자가 이미 앱을 설치하였고 딥링크 정보가 담긴 트래커 URL에 도달하였다면 애플리케이션이 열리고 딥링크의 내용이 앱으로 전송되어 파싱 및 다음 작업을 결정할 수 있습니다. iOS 9이 나오면서 Apple은 앱에서 딥링크를 처리하는 방식을 변경했습니다. 앱에 사용하려는 시나리오 (또는 다양한 기기를 지원하기 위해 둘 다 사용하려는 경우)에 따라 다음 시나리오 중 하나 또는 둘 다를 처리하도록 앱을 설정해야합니다. - -### iOS 8 및 이전 버전에서의 딥링크 - -iOS 8 및 이전 기기에서 딥링크는 커스텀 URL 스킴 설정을 사용하여 수행됩니다. 앱을 여는 데 사용할 커스텀 URL 스킴 이름을 선택해야합니다. 이 스킴 이름은`deep_link` 파라미터의 일부로 Adjust 트래커 URL에서도 사용됩니다. 앱에서 이를 설정하려면`Info.plist`를 엽니다. 파일에 새로운 'URL 유형'행을 추가합니다. 거기에 'URL 식별자'로 앱의 번들 ID를 작성하고 'URL 스킴'아래에서 앱이 처리 할 스킴 이름을 추가합니다. 아래 예제에서는 앱이`adjustExample` 스킴 이름을 처리하도록 선택했습니다. - -![][custom-url-scheme] - -이것이 설정되면 선택한 스킴 이름이 포함된`deep_link` 파라미터로 Adjust 트래커 URL를 클릭하면 앱이 열립니다. 앱이 열리면 'AppDelegate'클래스의`openURL` 메소드가 실행되고 트래커 URL의`deep_link` 파라미터의 내용이 전달됩니다. 딥링크의 컨텐츠에 액세스하려면이 이 매서드를 오버라이드합니다. - -```objc -#"Adjust.h"가져오기 -// or # 가져오기 - -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - // url 객체에 딥링크 콘텐츠가 있습니다 - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -이 셋업을 사용하여 iOS 8 및 이전 버전의 iOS 기기에 대한 딥링크 처리를 성공적으로 설정했습니다. - -### iOS 9 이후 버전에서 딥링크 - -iOS 9 이후 기기에 대한 딥링크 지원을 설정하려면 앱이 Apple 유니버셜 링크를 처리할 수 있도록 설정해야 합니다. 유니버셜 링크 및 해당 설정에 대해 자세히 알아 보려면 [here] [universal-links]를 확인하십시오. - -Adjust는 개별적으로 유니버셜 링크와 관련하여 많은 것들을 처리하고 있습니다. 그러나 Adjust로 유니버셜 링크를 지원하려면 Adjust 대시 보드에서 유니버셜 링크에 대해 작은 설정을 수행해야합니다. 이에 대한 자세한 내용은 공식 [here] [universal-links-guide]를 참조하십시오. - -대시보드에서 유니버셜 링크 기능을 활성화한 후에는 앱에서도 이를 수행해야합니다. - -Apple Developer Portal에서 앱에 대해 'Associated Domains'를 활성화한 후에는 앱의 Xcode 프로젝트에서 동일한 작업을 수행해야합니다. `Associated Domains`를 활성화 한 후`Domains` 섹션의 Adjust 대시보드에서`applinks :`를 접두사로 사용하여 생성된 유니버설 링크를 추가하고 유니버설 링크의 `http(s)` 부분을 반드시 삭제하도록 합니다. - -![][associated-domains-applinks] - -이 설정이 완료되면 Adjust 트래커 유니버셜 링크를 클릭할 시 앱이 열립니다. 앱이 열리면 'AppDelegate'클래스의`continueUserActivity` 메서드가 트리거되고 유니버셜 링크 URL의 컨텐츠가 있는 곳이 전달됩니다. 딥링크의 컨텐츠에 액세스하려면이 이 매서드를 오버라이드합니다. - -``` objc -#"Adjust.h"가져오기 -// or # 가져오기 - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - // url 객체는 사용자의 유니버셜 링크 콘텐츠가 포함되어 있습니다 - } - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -이 셋업을 사용하여 iOS9 및 이후 버전의 iOS 기기에 대한 딥링크 처리를 성공적으로 설정했습니다. - -딥링크 정보가 항상 기존 스타일의 커스텀 URL 스킴 형식으로 나올 것으로 예상되는 코드에 커스텀 로직이 있는 경우 유니버셜 링크를 이전 스타일의 딥링크 URL로 변환 할 수있는 도우미 기능을 제공합니다. 사용자는 유니버셜 링크와 딥링크가 접두어로 표시된 사용자 정의 URL 스킴 이름으로 이 메서드를 호출할 수 있으며 Adjust는 사용자 정의 URL 스킴 딥링크를 생성합니다: - -``` objc -#"Adjust.h"가져오기 -// or # 가져오기 - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL *url = [userActivity webpageURL]; - - NSURL *oldStyleDeeplink = [Adjust convertUniversalLink:url scheme:@"adjustExample"]; - } - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -### 지연된 딥링킹 시나리오 - -지연된 딥링크가 열리기 전에 알림을 받을 콜백을 등록할 수 있습니다. 이 설정은 다음을 통해 `AdjustConfig` 인스턴스에서 구성할 수 있습니다. - -```js -adjustConfig.setDeferredDeeplinkCallback(function(deferredDeeplink) { - // ... -}); -``` -콜백 함수는 SDK가 Adjust 서버에서 지연된 딥링크를 수신하고 열기 전에 호출됩니다. - -이 콜백이 구현되지 않으면 **Adjust SDK는 항상 기본적으로 해당 딥링크를 열려고 시도합니다.**. - -AdjustConfig 인스턴스에 다른 설정을 사용하면 Adjust SDK가 이 딥링크를 열지 여부를 결정할 수 있습니다. 예를 들어 SDK가 바로 딥링크를 열지 않고 저장 후 나중에 직접 열도록 할수 있습니다. You can do this by calling the `setOpenDeferredDeeplink` method: - -```js -//기본 설정. SDK는 디퍼트 딥링크 콜백 이후 딥링크를 열게 됩니다. -adjustConfig.setOpenDeferredDeeplink(true); - -// 혹은 Adjust SDK가 딥링크를 열지 못하게 하려면: -adjustConfig.setOpenDeferredDeeplink(false); -``` - -### 딥링크를 통한 리어트리뷰션 - -Adjust를 사용하면 립링크를 사용하여 리인게이지먼트(재유입) 캠페인 트래킹을 실행할 수 있습니다. 이를 수행하는 방법에 대한 자세한 정보는 Adjust의 [official docs][reattribution-with-deeplinks]에서 찾아볼 수 있습니다. - -이 기능을 사용하는 경우, 사용자에 대한 리어트리뷰션이 적절히 이루어지려면 앱에서 Adjust SDK에 대한 추가적인 호출을 수행해야 합니다. - -앱의 딥링크 콘텐츠 정보를 수신했으면 the `appWillOpenUrl` 매서드로 호출을 추가합니다. 이 호출을 수행함으로써 Adjust SDK는 딥링크 내부에서 새 어트리뷰션 정보를 찾으며, 정보가 있는 경우에는 Adjust 백앤드에 전송됩니다. 딥링크 콘텐츠를 포함하는 Adjust 트래커 URL에 대한 클릭으로 인해 사용자에 대한 리어트리뷰션이 이루어져야 하는 경우, 앱에서 해당 사용자에 대한 새 어트리뷰션 정보와 함께 [어트리뷰션 콜백](#attribution-callback)이 실행되는 것을 볼 수 있습니다. - -`appWillOpenUrl`에 대한 호출은 모든 iOS 버전에서 딥링크 리어트리뷰션을 지원하기 위해 다음과 같이 수행되어야합니다. - -```objc -#"Adjust.h"가져오기 -// or # 가져오기 - -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { - // url 객체에 딥링크 콘텐츠가 있습니다 - - [Adjust appWillOpenUrl:url]; - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -``` objc -#"Adjust.h"가져오기 -// or # 가져오기 - -- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity - restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler { - if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) { - NSURL url = [userActivity webpageURL]; - - [Adjust appWillOpenUrl:url]; - } - - //이 메서드의 리턴값을 결정하기 위해 로직을 적용합니다. - 리턴 YES; - // or - // 리턴 NO; -} -``` - -사용자가 웹뷰에서 딥링크 URL에 액세스할 수 있으면 Javascript의`Adjust` 객체에서`appWillOpenUrl` 메서드를 호출 할 수 있습니다. - -```js -Adjust.appWillOpenUrl(deeplinkUrl); -``` - - -[dashboard]: http://adjust.com -[adjust.com]: http://adjust.com - -[releases]: https://github.com/adjust/ios_sdk/releases -[carthage]: https://github.com/Carthage/Carthage -[cocoapods]: http://cocoapods.org - -[wvjsb_readme]: https://github.com/marcuswestin/WebViewJavascriptBridge#usage -[ios_sdk_ulinks]: https://github.com/adjust/ios_sdk/#universal-links -[example-webview]: https://github.com/adjust/ios_sdk/tree/master/examples/AdjustExample-WebView -[callbacks-guide]: https://docs.adjust.com/en/callbacks -[attribution-data]: https://github.com/adjust/sdks/blob/master/doc/attribution-data.md -[special-partners]: https://docs.adjust.com/en/special-partners -[basic_integration]: https://github.com/adjust/ios_sdk/#basic-integration -[web_view_js_bridge]: https://github.com/marcuswestin/WebViewJavascriptBridge -[currency-conversion]: https://docs.adjust.com/en/event-tracking/#tracking-purchases-in-different-currencies -[event-tracking-guide]: https://docs.adjust.com/en/event-tracking/#reference-tracking-purchases-and-revenues -[reattribution-deeplinks]: https://docs.adjust.com/en/deeplinking/#manually-appending-attribution-data-to-a-deep-link - -[custom-url-scheme]: https://raw.github.com/adjust/sdks/master/Resources/ios/custom-url-scheme.png -[associated-domains-applinks]: https://raw.github.com/adjust/sdks/master/Resources/ios/associated-domains-applinks.png - -## License - -Adjust SDK는 MIT 라이센스 하에 사용이 허가됩니다. - -Copyright (c) 2012-2018 Adjust GmbH, http://www.adjust.com - -다음 조건하에서 본 소프트웨어와 관련 문서 파일 -(이하 "소프트웨어")의 사본을 보유한 제3자에게 소프트웨어의 -사용, 복사, 수정, 병합, 게시, 배포, 재실시권 및/또는 사본의 판매 등을 포함하여 -소프트웨어를 제한 없이 사용할 수 있는 권한을 무료로 부여하며, -해당 제3자는 소프트웨어를 보유한 이에게 -이러한 이용을 허가할 수 있습니다. - -본 소프트웨어의 모든 사본 또는 상당 부분에 -위 저작권 공고와 본 권한 공고를 포함해야 합니다. - -소프트웨어는 "있는 그대로" 제공되며, -소프트웨어의 상품성과 특정 목적에의 적합성 및 비 침해성에 대해 -명시적이거나 묵시적인 일체의 보증을 하지 않습니다. 저자 또는 저작권자는 -본 소프트웨어나 이의 사용 또는 기타 소프트웨어 관련 거래로 인해 -발생하는 모든 클레임, 손해 또는 기타 법적 책임에 있어서 -계약 또는 불법 행위와 관련된 소송에 대해 어떠한 책임도 부담하지 -않습니다. diff --git a/doc/migrate.md b/doc/migrate.md deleted file mode 100644 index 13858778d..000000000 --- a/doc/migrate.md +++ /dev/null @@ -1,211 +0,0 @@ -## Migrate your Adjust SDK for iOS to v4.31.0 from v3.4.0 - -### Initial setup - -We've changed how you configure the adjust SDK. All initial setup is now done with -a new config object. We've also replaced the adjust prefix from `AI` to `ADJ`. -Here is an example of how the setup in `AppDelegate.m` might look before and -after the migration: - -##### Before - -```objc -[Adjust appDidLaunch:@"{YourAppToken}"]; -[Adjust setEnvironment:AIEnvironmentSandbox]; -[Adjust setLogLevel:AILogLevelInfo]; -[Adjust setDelegate:self]; - -- (void)adjustFinishedTrackingWithResponse:(AIResponseData *)responseData { -} -``` - -##### After - -```objc -NSString *yourAppToken = @"{YourAppToken}"; -NSString *environment = ADJEnvironmentSandbox; -ADJConfig *adjustConfig = [ADJConfig configWithAppToken:yourAppToken - environment:environment]; -[adjustConfig setLogLevel:ADJLogLevelInfo]; -[adjustConfig setDelegate:self]; -[Adjust appDidLaunch:adjustConfig]; - -- (void)adjustAttributionChanged:(ADJAttribution *)attribution { -} -``` - -### Event tracking - -We've also introduced proper event objects that can be set up before they are -tracked. Again, an example of how it might look like before and after: - -##### Before - -```objc -NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; -[parameters setObject:@"value" forKey:@"key"]; -[parameters setObject:@"bar" forKey:@"foo"]; -[Adjust trackEvent:@"abc123" withParameters:parameters]; -``` - -##### After - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"abc123"]; -[event addCallbackParameter:@"key" value:@"value"]; -[event addCallbackParameter:@"foo" value:@"bar"]; -[Adjust trackEvent:event]; -``` - -### Revenue tracking - -Revenues are now handled like normal events. You simply set a revenue and a -currency to track revenues. Note that it is no longer possible to track revenues -without associated event tokens. You might need to create an additional event token -in your dashboard. The optional transaction ID is now a property of the event -instance. - -*Please note* - the revenue format has been changed from a cent float to a whole -currency-unit float. Current revenue tracking must be adjusted to whole currency -units (i.e., divided by 100) in order to remain consistent. - -##### Before - -```objc -[Adjust trackRevenue:1.0 transactionId:transaction.transactionIdentifier forEvent:@"xyz987"]; -``` - -##### After - -```objc -ADJEvent *event = [ADJEvent eventWithEventToken:@"xyz987"]; -[event setRevenue:0.01 currency:@"EUR"]; // You have to include the currency -[event setTransactionId:transaction.transactionIdentifier]; -[Adjust trackEvent:event]; -``` - -## Additional steps if you come from v3.0.0 - -We've added an optional parameter called `transactionId` to our `trackRevenue` methods. -If you are tracking In-App Purchases, then you might want to pass in the transaction -identifier provided by Apple to avoid duplicate revenue tracking. It should -look roughly like this: - -```objc -- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState) { - case SKPaymentTransactionStatePurchased: - [self finishTransaction:transaction]; - - [Adjust trackRevenue:... - transactionId:transaction.transactionIdentifier // avoid duplicates - forEvent:... - withParameters:...]; - - break; - // more cases - } - } -} -``` - -## Additional steps if you come from v2.1.x or 2.2.x - -We renamed the main class `AdjustIo` to `Adjust`. Follow these steps to update -all adjust SDK calls. - -1. Right click on the old `AdjustIo` source folder and select `Delete`. Confirm - `Move to Trash`. - -2. From the Xcode menu select `Find → Find and Replace in Project...` to bring - up the project wide search and replace. Enter `AdjustIo` into the search - field and `Adjust` into the replace field. Press enter to start the search. - Press the preview button and deselect all matches you don't want to replace. - Press the replace button to replace all `Adjust` imports and calls. - - ![][rename] - -3. Download version v3.4.0 and drag the new folder `Adjust` into your Xcode - Project Navigator. - - ![][drag] - -4. Build your project to confirm that everything is properly connected again. - -The adjust SDK v3.4.0 added delegate callbacks. Check out the [README] for -details. - -## Additional steps if you come from v2.0.x - -In the Project Navigator open the source file your Application Delegate. Add -the `import` statement at the top of the file. In the `didFinishLaunching` or -`didFinishLaunchingWithOptions` method of your App Delegate add the following -calls to `Adjust`: - -```objc -#import "Adjust.h" -// ... -[Adjust appDidLaunch:@"{YourAppToken}"]; -[Adjust setLogLevel:AILogLevelInfo]; -[Adjust setEnvironment:AIEnvironmentSandbox]; -``` -![][delegate] - -Replace `{YourAppToken}` with your App Token. You can find in your [dashboard]. - -You can increase or decrease the amount of logs you see by calling -`setLogLevel:` with one of the following parameters: - -```objc -[Adjust setLogLevel:AILogLevelVerbose]; // enable all logging -[Adjust setLogLevel:AILogLevelDebug]; // enable more logging -[Adjust setLogLevel:AILogLevelInfo]; // the default -[Adjust setLogLevel:AILogLevelWarn]; // disable info logging -[Adjust setLogLevel:AILogLevelError]; // disable warnings as well -[Adjust setLogLevel:AILogLevelAssert]; // disable errors as well -``` - -Depending on whether or not you build your app for testing or for production -you must call `setEnvironment:` with one of these parameters: - -```objc -[Adjust setEnvironment:AIEnvironmentSandbox]; -[Adjust setEnvironment:AIEnvironmentProduction]; -``` - -**Important:** This value should be set to `AIEnvironmentSandbox` if and only -if you or someone else is testing your app. Make sure to set the environment to -`AIEnvironmentProduction` just before you publish the app. Set it back to -`AIEnvironmentSandbox` when you start testing it again. - -We use this environment to distinguish between real traffic and artificial -traffic from test devices. It is very important that you keep this value -meaningful at all times! Especially if you are tracking revenue. - -## Additional steps if you come from v1.x - -1. The `appDidLaunch` method now expects your App Token instead of your App ID. - You can find your App Token in your [dashboard]. - -2. The adjust SDK for iOS 3.4.0 uses [ARC][arc]. If you haven't done already, - we recommend [transitioning your project to use ARC][transition] as well. If - you don't want to use ARC, you have to enable ARC for all files of the - adjust SDK. Please consult the [README] for details. - -3. Remove all calls to `[+Adjust setLoggingEnabled:]`. Logging is now enabled - by default and its verbosity can be changed with the new `[Adjust - setLogLevel:]` method. See the [README] for details. - -4. Rename all calls to `[+Adjust userGeneratedRevenue:...]` to `[+Adjust - trackRevenue:...]`. We renamed these methods to make the names more - consistent. The amount parameter is now of type `double`, so you can drop - the `f` suffixes in number literals (`12.3f` becomes `12.3`). - -[README]: ../README.md -[rename]: https://raw.github.com/adjust/sdks/master/Resources/ios/rename.png -[drag]: https://raw.github.com/adjust/sdks/master/Resources/ios/drag3.png -[delegate]: https://raw.github.com/adjust/sdks/master/Resources/ios/delegate3.png -[arc]: http://en.wikipedia.org/wiki/Automatic_Reference_Counting -[transition]: http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html -[dashboard]: http://adjust.com diff --git a/doc/web_views.md b/doc/web_views.md deleted file mode 100644 index 602313f82..000000000 --- a/doc/web_views.md +++ /dev/null @@ -1,2 +0,0 @@ - -The ios webviews README has moved!!! no problems though, you can find it [here](https://github.com/adjust/ios_sdk/blob/master/doc/english/web_views.md) \ No newline at end of file diff --git a/doc/web_views_ja.md b/doc/web_views_ja.md deleted file mode 100644 index 34172897f..000000000 --- a/doc/web_views_ja.md +++ /dev/null @@ -1,3 +0,0 @@ - - -WebviewのREADMEは移動しました。[こちら](https://github.com/adjust/ios_sdk/blob/master/doc/japanese/web_views.md) をご覧ください。