【问题标题】:GA Event Tracking on Amazon button亚马逊上的 GA 事件跟踪按钮
【发布时间】:2016-05-14 06:46:03
【问题描述】:

我们无法控制亚马逊按钮的代码,因为亚马逊是自己生成的。

我的问题是我可以在外部这样做吗?

$j(#OffAmazonPaymentsWidgets0).click({
_gaq.push(['_trackEvent', 'Category', 'Action', 'Extra Label if you like!']);
});

谢谢!

【问题讨论】:

标签: jquery amazon-pay


【解决方案1】:

授权回调中的 JS 代码在点击按钮时执行。所以你可以这样做:

var authRequest;
OffAmazonPayments.Button("AmazonPayButton", "YOUR_SELLER_ID_HERE", {
  type:  "PwA",
  color: "Gold",
  size:  "medium",
  useAmazonAddressBook: true,
  authorization: function() {

    // additional on click code
    _gaq.push(['_trackEvent', 'Category', 'Action', 'Extra Label if you like!']);

    var loginOptions = {scope: 'profile payments:widget'};
    authRequest = amazon.Login.authorize(loginOptions, "YOUR_REDIRECT_URL_HERE");
  },
  onError: function(error) {
    // Write your custom error handling
  }
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-03
    • 2013-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    相关资源
    最近更新 更多