简体   繁体   English

当有人单击Facebook赞按钮时如何触发事件? (在Google跟踪代码管理器中)

[英]How to trigger an event when someone clicks the Facebook Like Button? (in Google Tag Manager)

Can you trigger an event when someone clicks this Facebook Like button which is embeded on articles like this one ? 当有人单击嵌入在此类文章中的Facebook Like按钮时,您是否可以触发事件?

From what I've found so far, it seems hardly possible since the event is taking place on a 3rd party site. 根据到目前为止的发现,由于该事件是在第3方网站上进行的,因此似乎几乎不可能。

When you click the button, it changes its text but no event shows up in GTM's previe & debug pane. 当您单击按钮时,它会更改其文本,但GTM的预览和调试窗格中不会显示任何事件。 I also tried AJAX event listeners but that doesn't work either. 我也尝试了AJAX事件侦听器,但这也不起作用。

Do you know of a way to track this in GTM? 您知道在GTM中进行跟踪的方法吗?

Found the answer. 找到了答案。 Facebook has its own API for picking up events like these. Facebook拥有自己的API ,可以接收此类事件。 Clickinsight created a custom Google Tag Manager script you can use to send these events through the dataLayer, so you can track them in Google Analytics. Clickinsight创建了一个自定义Google跟踪代码管理器脚本,您可以使用该脚本通过dataLayer发送这些事件,从而可以在Google Analytics(分析)中进行跟踪。 Here's the tutorial on how to do that. 这是有关如何执行此操作的教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM