Configuración avanzada de Tag Manager para iOS
Para extender la funcionalidad de Google Tag Manager, puedes agregar variables de llamada a función y etiquetas de llamada a función. Las variables de llamada a función te permiten capturar los valores que muestran las llamadas a funciones registradas previamente. Las etiquetas de llamada a función te permiten ejecutar funciones registradas previamente (p.ej., para activar hits para herramientas de medición y remarketing adicionales que actualmente no son compatibles con las plantillas de etiquetas en Google Tag Manager).
Para crear una etiqueta personalizada, crea una clase que implemente el protocolo TAGCustomFunction
:
@implementation MYCustomTag<TAGCustomFunction>
- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Add custom tag implementation here.
}
@end
Para crear una variable personalizada, crea una clase que implemente el protocolo TAGCustomFunction
:
@implementation MYCustomVariable<TAGCustomFunction>
- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Return the value of the custom variable.
return @42;
}
@end
Una vez que tu clase se haya configurado con TAGCustomFunction
, usa la interfaz web de Tag Manager para configurar etiquetas o variables con el nombre de clase que creaste.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2024-11-08 (UTC)
[null,null,["Última actualización: 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"]]