הגדרות אישיות מתקדמות של Tag Manager ב-iOS
כדי להרחיב את הפונקציונליות של Google Tag Manager, תוכלו להוסיף משתני קריאה לפונקציות ותגי קריאה לפונקציות. משתני קריאה לפונקציה מאפשרים לתעד את הערכים שמוחזרים על ידי קריאות לפונקציות שנרשמו מראש. תגי קריאה לפונקציה מאפשרים להריץ פונקציות שרושמות מראש (למשל, כדי להפעיל היטים של כלים נוספים למדידת ביצועים ולרימרקטינג שלא נתמכים כרגע בתבניות התגים ב-Google Tag Manager).
כדי ליצור תג בהתאמה אישית, יוצרים כיתה שמטמיעה את הפרוטוקול 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
, תוכלו להשתמש בממשק האינטרנט של Tag Manager כדי להגדיר תגים או משתנים עם שם הכיתה שיצרתם.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2024-11-08 (שעון UTC).
[null,null,["עדכון אחרון: 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"]]