简体   繁体   English

Google Analytics(分析)iOS按钮跟踪

[英]Google Analytics iOS Button Tracking

I am trying to track how many times users tap a certain button by using Google Analytics. 我正在尝试使用Google Analytics(分析)跟踪用户点击某个按钮的次数。 I was following the Google Analytics SDK, but I am getting an "Use of Undeclared Idtenifier 'CallHotline'" error, With the following code: 我一直在使用Google Analytics(分析)SDK,但是出现“使用未声明的标识符'CallHotline'”错误,并带有以下代码:

[[tracker sendEventWithCategory:@"uiAction"
                    withAction:@"buttonPress"
                     withLabel:callHotline
                     withValue:[NSNumber numberWithInt:100]]; 

is 'callHotline' a string literal? 'callHotline'是字符串文字吗? then use: 然后使用:

[tracker sendEventWithCategory:@"uiAction"
                    withAction:@"buttonPress"
                     withLabel:@"callHotline"
                     withValue:[NSNumber numberWithInt:100]];

the Category , Action , and Label fields are all strings. CategoryActionLabel字段均为字符串。

Note that in the code you provided, you also had an unnecessary [ at the start of the line. 请注意,在您提供的代码中,行首也没有必要[

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM