Google Analytics(分析):我正在跟踪“赞”按钮的点击次数,但如何跟踪页面链接的点击次数?

发布于 2024-12-29 07:54:44 字数 321 浏览 2 评论 0原文

我使用 ga_social_tracking.js 用于跟踪通过 Facebook Fan Box (HTML5) 完成的点赞。

这很好用,但我还想跟踪页面本身链接的点击次数。我认为很多人会先访问该页面,然后[i]然后[/i]喜欢该页面,而不是喜欢直接使用该框...

我怎样才能实现这一目标?

I use ga_social_tracking.js to track Likes done via the Facebook Fan Box (HTML5).

That works fine, but I also want to track clicks on the link to the Page itself. I think many go to the Page and [i]then[/i] like the Page, instead of liking directly using the box...

How can I achieve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

第七度阳光i 2025-01-05 07:54:44

使用 Jquery 和 Google 自定义事件跟踪,您可以执行以下操作:

$(document).ready(function(){


  $('a').click(function(e){

    link_url = $(this).attr('href');

    recordOutboundLink(link_url, 'Title of event', 'Description of the event');


  });

function recordOutboundLink(link, category, action) {
    try {
        var pageTracker = _gat._createTracker("{{google_analytics_code}}");
        pageTracker._trackEvent(category, action);

    } catch (err) { }
}

});

Using Jquery and Google custom event tracking you can do something like this:

$(document).ready(function(){


  $('a').click(function(e){

    link_url = $(this).attr('href');

    recordOutboundLink(link_url, 'Title of event', 'Description of the event');


  });

function recordOutboundLink(link, category, action) {
    try {
        var pageTracker = _gat._createTracker("{{google_analytics_code}}");
        pageTracker._trackEvent(category, action);

    } catch (err) { }
}

});

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文