Adjustのリンク短縮ソリューションは、複雑で長いリンクをより簡潔で短いリンクに変換します。短縮リンクはディープリンクとキャンペーン情報を保持し、アプリがインストールされていない場合は、ユーザーをApp Storeに誘導します。
このセクションで説明するメソッドを使用して、短縮リンクを解析します。
Adjust SDKでディープリンクを設定する
Adjust SDKに、以下のサポートを追加してください。
Adjust SDKを設定して短縮リンクを解析する
+ (void)processAndResolveDeeplink:(nonnull NSURL *)deeplink
withCompletionHandler:(nonnull ADJResolvedDeeplinkBlock)completion;
ユーザーをアプリ内にディープリンクするAdjustのショートリンクURLを解決するために、AppDelegate
からprocessAndResolveDeeplink:completionHandler:
メソッドを呼び出してください。
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([any UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType.isEqual(NSUserActivityTypeBrowsingWeb) {
// Pass deep link URL to Adjust in order to potentially reattribute the user
// and to get the URL resolved if it’s a shortened one.
if let incomingURL = userActivity.webpageURL {
if let deeplink = ADJDeeplink(deeplink: incomingURL) {
Adjust.processAndResolve(deeplink) { resolveDeeplink in
// resolvedLink contains either resolved URL (if it was unshortened)
// or just echoed URL if it was not shortened
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<uiuseractivityrestoring>> *restorableObjects))restorationHandler {
if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) {
// Pass deep link URL to Adjust in order to potentially reattribute the user
// and to get the URL resolved if it’s a shortened one.
ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]];
[Adjust processAndResolveDeeplink:deeplink
withCompletionHandler:^(NSString * _Nullable resolvedLink) {
// resolvedLink contains either resolved URL (if it was unshortened)
// or just echoed URL if it was not shortened
processDeeplink:completionHandler:
メソッドに送信したリンクが短縮されていた場合、 resolvedLink
は拡張された元のリンクを返します。メソッドにパスしたリンクが短縮されていない場合、 resolvedLink
にはパスした同じリンクが含まれます。
リファラーを使用したディープリンクを処理する
オプションのリファラーURLは、ディープリンクやアプリのソースを計測して、より正確なアトリビューションやリアトリビューション、ディープリンクを実現するために使用されます。例えば、SEOやオーガニック検索、Adjustリンクなどのチャネルには直接使用されません。クライアントのルートドメインでユニバーサルリンクが実装されており、それによってアプリが起動する場合、そのチャネルでは、ユーザーのアトリビューションまたはリアトリビューションを行うために、リファラーURLから得られるシグナルに依存する場合があります。
リファラーURLを設定する
func application(_ application: UIApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType.isEqual(NSUserActivityTypeBrowsingWeb) {
// Pass deep link URL to Adjust in order to potentially reattribute the user
// and to get the URL resolved if it’s a shortened one.
if let incomingURL = userActivity.webpageURL {
if let deeplink = ADJDeeplink(deeplink: incomingURL) {
// If referrer URL is available, add it to the deeplink object
if let referrer = URL(string: "https://example.com") {
deeplink.setReferrer(referrer)
Adjust.processAndResolve(deeplink) { resolveDeeplink in
// resolvedLink contains either resolved URL (if it was unshortened)
// or just echoed URL if it was not shortened
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<uiuseractivityrestoring>> *restorableObjects))restorationHandler {
if ([[userActivity activityType] isEqualToString:NSUserActivityTypeBrowsingWeb]) {
// Pass deep link URL to Adjust in order to potentially reattribute the user
// and to get the URL resolved if it’s a shortened one.
ADJDeeplink *deeplink = [[ADJDeeplink alloc] initWithDeeplink:[userActivity webpageURL]];
NSURL *referrer = [NSURL URLWithString:@"https://example.com"];
// If referrer URL is available, add it to the deeplink object
[deeplink setReferrer:referrer];
[Adjust processAndResolveDeeplink:deeplink
withCompletionHandler:^(NSString * _Nullable resolvedLink) {
// resolvedLink contains either resolved URL (if it was unshortened)
// or just echoed URL if it was not shortened