iOS 代碼管理工具進階設定

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

如要建立自訂標記,請建立用於實作 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 設定課程後,請使用代碼管理工具的網頁 介面,使用您建立的類別名稱設定代碼或變數。