2013-07-04 80 views
0

我正在使用事件跟踪下载按钮。当任何用户点击下载按钮时,该事件必须运行,但这不会发生。这是我的代码Google事件跟踪不起作用

<input id="changesubmittxt_<?php echo $theme['Theme']['id']; ?>" type="submit" value="Proceed" class="submitButton" onclick="onClick="_gaq.push(['_trackEvent', 'themes', 'theme', 'free theme',, true]);"" /> 

所以告诉我,我错在哪里,我通过所有参数正确或我缺少的东西在这里。谢谢

回答

0

不知道这是否是一个错字,但你有onClick的onClick。所以先解决这个问题。

另外,请检查trackEvent方法 https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEventTracking

参考具体来说,它说:

您可以使用下列任何可选参数:opt_label,opt_value或的opt_noninteraction。如果只想为第二个或第三个可选参数提供值,则需要为前面的可选参数传递undefined。

所以你应该尽量

<input id="changesubmittxt_<?php echo $theme['Theme']['id']; ?>" type="submit" value="Proceed" class="submitButton" onclick="_gaq.push(['_trackEvent', 'themes', 'theme', 'free theme', undefined, true]);" />