Menu

iOS SDK integration (excluding IDFA-Advertising SDK)

  • Advertising SDK is used to support Apple Search Ads (Apple Search Advertising, referred to as ASA) activation attribution, can track the user's activation and post-link behavior in the full link, and support the front and back link connection, with Sensors advertising analysis products for channel analysis;
  • Advertising SDK relies onSensors Analytics SDK 4.4.1 and above, Before using, please ensure that the SDK has been successfully integrated and initialized. For details, see SDK Integration (iOS)SDK Integration(macOS)
  • If the IDFA is not used, it cannot be obtained on iOS 14.3 or later ASA Attribution data.

Integration step

CocoaPods way

  • In Podfile file add pod 'SensorsAdvertising', :subspecs => ['AdServices']
  • Open the terminal and switch to the project directory
  • 执行 pod install  pod update SensorsAdvertising

Note: If executedpod update the latest version cannot be detected. You can run it firstpod cache clean SensorsAdvertising clear local cache.

Source code mode

  • From GitHub get the SDK source code;
  • Put SDK(SensorsAdvertising_AdServicesin SensorsAdvertising.framework )Import the App project and select Copy items if needed.

Procedure of use

Import header file

Import the SensorsAdvertising header file in the AppDelegate.m file.

#import <SensorsAdvertising/SensorsAdvertising.h>

Initialize SDK

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 	// 初始化 SensorsAnalytics SDK NSString *serverURL = @"http://xxxxx"; SAConfigOptions *saconfigOptions = [[SAConfigOptions alloc] initWithServerURL:serverURL launchOptions:launchOptions];    saConfigOptions.autoTrackEventType = SensorsAnalyticsEventTypeAppStart | SensorsAnalyticsEventTypeAppEnd | SensorsAnalyticsEventTypeAppClick | SensorsAnalyticsEventTypeAppViewScreen;    saConfigOptions.enableLog = YES; [SensorsAnalyticsSDK startWithConfigOptions:saConfigOptions]; // 初始化 SensorsAdvertising SDK SADConfigOptions *sadconfigOptions = [[SADConfigOptions alloc] initWithLaunchOptions:launchOptions]; // sadconfigOptions 配置 	// ... [SensorsAdvertising startWithConfigOptions:sadconfigOptions]; // 其他业务处理 // ... return YES; }

Note

  1. The advertising SDK relies on the SensorsAnalyticsSDK, so the SensorsAnalyticsSDK needs to be initialized first
  2. The advertising SDK will automatically collect activation events, and the original activation event interface cannot be manually invoked
  3. If the original recorded activation event name is not $AppInstall, you need to use Virtual Event to merge the original activation event and $AppInstall for analysis data. For more details, please consult the on-duty colleague.
  4. Original activation event interface parameter, configured through SADConfigOptions
    1. appInstallProperties custom properties in the activation event

    2. disableAppInstallCallback callback request to disable channel matching in the activation event

Last modified: 2025-01-02