Cấu hình Trình quản lý thẻ iOS nâng cao
Để mở rộng chức năng của Trình quản lý thẻ của Google, bạn có thể thêm biến Lệnh gọi hàm và thẻ Lệnh gọi hàm. Biến Lệnh gọi hàm cho phép bạn thu thập các giá trị được các lệnh gọi đến các hàm đã đăng ký trước trả về. Thẻ Lệnh gọi hàm cho phép bạn thực thi các hàm đã đăng ký trước (ví dụ: để kích hoạt lượt truy cập cho các công cụ đo lường và tái tiếp thị bổ sung hiện không được hỗ trợ bằng mẫu thẻ trong Trình quản lý thẻ của Google).
Để tạo một thẻ tuỳ chỉnh, hãy tạo một lớp triển khai giao thức TAGCustomFunction
:
@implementation MYCustomTag<TAGCustomFunction>
- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Add custom tag implementation here.
}
@end
Để tạo một biến tuỳ chỉnh, hãy tạo một lớp triển khai giao thức TAGCustomFunction
:
@implementation MYCustomVariable<TAGCustomFunction>
- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Return the value of the custom variable.
return @42;
}
@end
Sau khi thiết lập lớp bằng TAGCustomFunction
, hãy sử dụng giao diện web của Trình quản lý thẻ để thiết lập thẻ hoặc biến bằng tên lớp mà bạn đã tạo.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-11-08 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-08 UTC."],[[["Function Call variables and tags extend Google Tag Manager's capabilities by enabling custom functions."],["Function Call variables capture values from pre-registered functions, while Function Call tags execute them."],["Custom tags and variables are created by implementing the `TAGCustomFunction` protocol in a class."],["These custom classes are then utilized within Tag Manager's interface to set up new tags or variables."]]],["Function Call variables and tags in Google Tag Manager enhance its capabilities by interacting with pre-registered functions. Both utilize a class implementing the `TAGCustomFunction` protocol, with the `executeWithParameters` method defining their behavior. For a tag, this method executes custom logic; for a variable, it returns a value. After implementing the protocol in the class, you can use the Tag Manager web interface to create tags or variables by referencing the class name.\n"]]