iOS 代碼管理工具的進階設定

若要擴充 Google 代碼管理工具的功能,您可以新增函式呼叫變數和函式呼叫代碼。函式呼叫變數可讓您擷取呼叫預先註冊函式時回傳的值。函式呼叫代碼可讓您執行預先註冊函式 (例如觸發 Google Analytics (分析) 代碼範本目前不支援的額外評估和再行銷工具)。

如要建立自訂標記,請建立可實作 TAGCustomFunction 通訊協定的類別:

@implementation MYCustomTag<TAGCustomFunction>

- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
  // Add custom tag implementation here.
}

@end

如要建立自訂變數,請建立可實作 TAGCustomFunction 通訊協定的類別:

@implementation MYCustomVariable<TAGCustomFunction>

- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
  // Return the value of the custom variable.
  return @42;
}

@end

使用 TAGCustomFunction 設定類別後,請使用代碼管理工具的網頁介面來設定您建立的標記或變數。