如何使用Google Analytics事件triggars跟踪Paypal按钮点击

时间:2016-02-09 23:31:58

标签: paypal google-analytics

我试图在用户点击Paypal付款按钮时在Google Analytics中进行跟踪。我有一个事件跟踪器设置,但是当前点击按钮时没有触发任何事件。这是带有onclick事件触发器的paypal表单。

<form onclick="_trackEvent('buttonclick', 'buttonclick');"    action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZDHHMPA9CQR54">
<input type="image" id="imageH" style="width:90%"  src="http://roadcams.net/wp-content/uploads/2015/09/buttons2.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:2)

如果您使用的是最新版本的Google Analytics,则需要使用其他功能:

ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);

https://developers.google.com/analytics/devguides/collection/analyticsjs/events

所以你的可能......

<form onclick="ga('send', 'event', 'button', 'click', 'paypal');" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="ZDHHMPA9CQR54">
    <input type="image" id="imageH" style="width:90%" src="http://roadcams.net/wp-content/uploads/2015/09/buttons2.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>