<GANSearchAdControllerDelegate> Protocol

<GANSearchAdControllerDelegate> Protocol Reference

Overview

A protocol for GANSearchAdController to inform a delegate that new ads have been loaded or that they have failed to load.

Typically, the client of the SDK will provide the delegate.

Inherits <NSObject>.

Instance Method Summary

(void) - searchAdController:didLoadAds:
 Notifies the GANSearchAdControllerDelegate that numberOfAds new ads have been loaded and are therefore now available. More...
 
(void) - searchAdController:didFailWithError:
 Notifies the GANSearchAdControllerDelegate that ads have failed to load. More...
 
(void) - externalLinkDidOpen
 Callback to inform a delegate if url was clicked and the link was opened in a browser. More...
 
(void) - spaAdClickedWithSKU:itemGroupID:
 Handles SPA ad clicks (other than an add-to-cart link in the ad). More...
 
(void) - spaAddToCartClickedWithSKU:itemGroupID:
 Handles add-to-cart link clicks in SPA ads. More...
 

Method Detail

- (void) searchAdController: (GANSearchAdController *)  adController
didLoadAds: (NSInteger)  numberOfAds 
optional

Notifies the GANSearchAdControllerDelegate that numberOfAds new ads have been loaded and are therefore now available.

Notes:

  • this method may be called several times after calling loadAds:, if the server has several pages of ads for a given query.
  • if there are no additional ads in the server, this method will return 0 for numberOfAds (this is not an error).
    Parameters
    adControllerThe GANSearchAdController that the ads were requested from.
    numberOfAdsThe number of ads that have been loaded. This is not cumulitave.
- (void) searchAdController: (GANSearchAdController *)  adController
didFailWithError: (NSError *)  error 
optional

Notifies the GANSearchAdControllerDelegate that ads have failed to load.

Parameters
adControllerThe GANSearchAdController that the ads were requested from.
errorThe error returned from the ad request.
- (void) externalLinkDidOpen
optional

Callback to inform a delegate if url was clicked and the link was opened in a browser.

- (void) spaAdClickedWithSKU: (nullable NSString *)  SKU
itemGroupID: (nullable NSString *)  itemGroupID 
optional

Handles SPA ad clicks (other than an add-to-cart link in the ad).

Required for SPA ads.

Parameters
SKUThe SKU of the ad that was tapped.
itemGroupIDThe itemGroupID of the ad that was tapped.
- (void) spaAddToCartClickedWithSKU: (nullable NSString *)  SKU
itemGroupID: (nullable NSString *)  itemGroupID 
optional

Handles add-to-cart link clicks in SPA ads.

Required for SPA ads with add to cart link.

Parameters
SKUThe SKU of the ad that was tapped.
itemGroupIDThe itemGroupID of the ad that was tapped.