问题
I've been trying to use the etag on the youtube api in my Swift app to find a playlist, but I was under the impression that I had to include it as a parameter. There is however no parameter for this. I also tried to cache the etag and compare it to the new one received from a different answer, but it always changes regardless of whether or not the playlist itself changed. Can somebody steer me in the right direction?
Thanks!
回答1:
To extend the functionality of Google Tag Manager, you can add Function Call variables and Function Call tags. Function Call variables let you capture the values returned by calls to pre-registered functions. Function Call tags let you execute pre-registered functions
To add a custom tag or custom variable with a Function Call:
To create a custom tag, create a class that implements the TAGCustomFunction protocol:
@implementation MYCustomTag<TAGCustomFunction>
- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Add custom tag implementation here.
}
@end
To create a custom variable, create a class that implements the TAGCustomFunction protocol:
@implementation MYCustomVariable<TAGCustomFunction>
- (NSObject*)executeWithParameters:(NSDictionary*)parameters {
// Return the value of the custom variable.
return @42;
}
@end
Make sure the linker doesn't eliminate your class during link time optimization.
In Google Tag Manager's web interface, use the class name to set up tags and variables.
来源:https://stackoverflow.com/questions/37732965/how-is-etag-used-on-youtube-api-swift