2013-07-04 79 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]);" />