Stay organized with collections
Save and categorize content based on your preferences.
This guide explains how to implement more control over clickthrough in your IMA SDK
implementation. "Clickthrough" refers to the process of a user clicking on an ad and getting to
the landing page for that ad. The examples in this guide demonstrates how to configure where that
landing page opens and how to listen for events related to users visiting that page.
Prerequisites
An iOS application with the IMA SDK implemented.
Configuring clickthrough
Changing the link opener
The IMA SDK offers two options for opening ad landing pages—via an in-app browser, or via
Safari. By default, the SDK opens pages using Safari. To update the SDK to use an in-app
browser, you need to use IMAAdsRenderingSettings:
The IMA SDK provides the IMALinkOpenerDelegate to communicate when the user is about
to see or has just closed a clickthrough page. To use this delegate, add it to your delegate
list in the header, and implement its methods. In the header:
funclinkOpenerWillOpen(externalBrowser:NSObject){print("External browser will open.")}funclinkOpenerWillOpen(inAppLink:NSObject){print("In-app browser will open.")}funclinkOpenerDidOpen(inAppLink:NSObject){print("In-app browser did open.")}funclinkOpenerWillClose(inAppLink:NSObject){print("In-app browser will close.")}funclinkOpenerDidClose(inAppLink:NSObject){print("In-app browser did close.")}
Objective-C
-(void)linkOpenerWillOpenExternalBrowser:(NSObject*)linkOpener{NSLog(@"External browser will open.");}-(void)linkOpenerWillOpenInAppBrowser:(NSObject*)linkOpener{NSLog(@"In-app browser will open.");}-(void)linkOpenerDidOpenInAppBrowser:(NSObject*)linkOpener{NSLog(@"In-app browser did open.");}-(void)linkOpenerWillCloseInAppBrowser:(NSObject*)linkOpener{NSLog(@"In-app browser will close.");}-(void)linkOpenerDidCloseInAppBrowser:(NSObject*)linkOpener{NSLog(@"In-app browser did close.");}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThis guide explains how to control ad clickthrough behavior within your iOS app using the IMA SDK.\u003c/p\u003e\n"],["\u003cp\u003eYou can configure the IMA SDK to open ad landing pages either in an in-app browser or in Safari.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIMALinkOpenerDelegate\u003c/code\u003e provides events to track when clickthrough pages are opened and closed, allowing developers to respond to user interactions.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize clickthrough control features, you must implement the \u003ccode\u003eIMAAdsRenderingSettings\u003c/code\u003e and the \u003ccode\u003eIMALinkOpenerDelegate\u003c/code\u003e within your iOS application.\u003c/p\u003e\n"]]],[],null,["# Control user click events\n\nThis guide explains how to implement more control over clickthrough in your IMA SDK\nimplementation. \"Clickthrough\" refers to the process of a user clicking on an ad and getting to\nthe landing page for that ad. The examples in this guide demonstrates how to configure where that\nlanding page opens and how to listen for events related to users visiting that page.\n\nPrerequisites\n-------------\n\n\nAn iOS application with the IMA SDK implemented.\n\nConfiguring clickthrough\n------------------------\n\n### Changing the link opener\n\nThe IMA SDK offers two options for opening ad landing pages---via an in-app browser, or via Safari. By default, the SDK opens pages using Safari. To update the SDK to use an in-app browser, you need to use `IMAAdsRenderingSettings`: \n\n### Swift\n\n```swift\nfunc createAdsRenderingSettings() {\n self.adsRenderingSettings = IMAAdsRenderingSettings();\n self.adsRenderingSettings.linkOpenerDelegate = self;\n self.adsRenderingSettings.linkOpenerPresentingController = self;\n}\n```\n\n### Objective-C\n\n```objective-c\n- (void)createAdsRenderingSettings {\n self.adsRenderingSettings = [[IMAAdsRenderingSettings alloc] init];\n self.adsRenderingSettings.linkOpenerDelegate = self;\n self.adsRenderingSettings.linkOpenerPresentingController = self;\n}\n```\nOnce you've configured the `IMAAdsRenderingSettings` instance, you can pass it to the `IMAAdsManager` initialization method: \n\n### Swift\n\n```swift\nself.adsManager.initialize(withAdsRenderingSettings: adsRenderingSettings);\n```\n\n### Objective-C\n\n```objective-c\n[self.adsManager initializeWithAdsRenderingSettings:adsRenderingSettings];\n```\n\n### Listening for clickthrough-related events\n\nThe IMA SDK provides the `IMALinkOpenerDelegate` to communicate when the user is about to see or has just closed a clickthrough page. To use this delegate, add it to your delegate list in the header, and implement its methods. In the header: \n\n### Swift\n\n```swift\nclass ViewController: UIViewController, IMALinkOpenerDelegate {\n```\n\n### Objective-C\n\n```objective-c\n@interface ViewController : UIViewController\u003cIMALinkOpenerDelegate\u003e\n```\nAnd in the implementation: \n\n### Swift\n\n```swift\nfunc linkOpenerWillOpen(externalBrowser: NSObject) {\n print(\"External browser will open.\")\n}\n\nfunc linkOpenerWillOpen(inAppLink: NSObject) {\n print(\"In-app browser will open.\")\n}\n\nfunc linkOpenerDidOpen(inAppLink: NSObject) {\n print(\"In-app browser did open.\")\n}\n\nfunc linkOpenerWillClose(inAppLink: NSObject) {\n print(\"In-app browser will close.\")\n}\n\nfunc linkOpenerDidClose(inAppLink: NSObject) {\n print(\"In-app browser did close.\")\n}\n```\n\n### Objective-C\n\n```objective-c\n- (void)linkOpenerWillOpenExternalBrowser:(NSObject *)linkOpener {\n NSLog(@\"External browser will open.\");\n}\n\n- (void)linkOpenerWillOpenInAppBrowser:(NSObject *)linkOpener {\n NSLog(@\"In-app browser will open.\");\n}\n\n- (void)linkOpenerDidOpenInAppBrowser:(NSObject *)linkOpener {\n NSLog(@\"In-app browser did open.\");\n}\n\n- (void)linkOpenerWillCloseInAppBrowser:(NSObject *)linkOpener {\n NSLog(@\"In-app browser will close.\");\n}\n\n- (void)linkOpenerDidCloseInAppBrowser:(NSObject *)linkOpener {\n NSLog(@\"In-app browser did close.\");\n}\n```"]]