# How to track events and send them to GTM, Facebook or others?

**URL:** https://meta.discourse.org/t/how-to-track-events-and-send-them-to-gtm-facebook-or-others/143227
**Category:** Development
**Created:** [March 3, 2020, 4:29pm UTC](https://meta.discourse.org/t/how-to-track-events-and-send-them-to-gtm-facebook-or-others/143227 "2020-03-03T16:29:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![agmontpetit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agmontpetit/32/160109_2.png) [@agmontpetit](https://meta.discourse.org/u/agmontpetit)
#### Post date: [March 3, 2020, 4:29pm UTC](https://meta.discourse.org/t/how-to-track-events-and-send-them-to-gtm-facebook-or-others/143227/1 "2020-03-03T16:29:48Z")

</div>

I’m wondering what would be the best way to track events happening on the (front-end) site such as user registration or engagement (for example, post creation or liked post). Tracking such events is fundamental for analytics, conversion measurement or simply in order to build audiences, as it is widely used by tools like Google Analytics, Google Tag Manager or Facebook Pixel.

The question seems to have been asked many times before ([here](https://meta.discourse.org/t/how-can-i-track-discourse-signups-for-facebook-ad-campaigns/54199) or [here](https://meta.discourse.org/t/track-sign-ups-on-google-analytics/96746/2)), but I couldn’t find a convincing answer. I’m asking this again in case something has changed, or someone more experienced comes across my question.

Let’s go through a few examples.

### Account creation

It does not seem to suffice tracking URLs such as `/u/account-created`, as this would miss users coming from Google/FB oAuth registration (they don’t get to see that page). What would be the best alternative here?

### Post creation

It seems one can use an `AppEvent` (`topic:created`) in order to trigger those events.

### Liking a post

This seems the hardest as I couldn’t find any `AppEvent` trigger nor there is a specific URL to track like in the case of account creation.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [March 3, 2020, 7:50pm UTC](https://meta.discourse.org/t/how-to-track-events-and-send-them-to-gtm-facebook-or-others/143227/2 "2020-03-03T19:50:48Z")

</div>

For tracking posts created and likes, have a look at the code in this post: [Integrate Google Tag Manager with Google Analytics - #44](https://meta.discourse.org/t/setup-google-tag-manager-for-analytics/47335/44).

---

<div class="post-metadata">

### Author: ![agmontpetit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/agmontpetit/32/160109_2.png) [@agmontpetit](https://meta.discourse.org/u/agmontpetit)
#### Post date: [March 3, 2020, 8:08pm UTC](https://meta.discourse.org/t/how-to-track-events-and-send-them-to-gtm-facebook-or-others/143227/3 "2020-03-03T20:08:59Z")

</div>

Excellent! Wasn’t aware of the `page:like-toggled` event.

Now I just need to figure out how to properly track signups.

---

<div class="post-metadata">

### Author: ![steven.surdiacourt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/steven.surdiacourt/32/134898_2.png) [@steven.surdiacourt](https://meta.discourse.org/u/steven.surdiacourt)
#### Post date: [September 14, 2020, 11:13am UTC](https://meta.discourse.org/t/how-to-track-events-and-send-them-to-gtm-facebook-or-others/143227/4 "2020-09-14T11:13:53Z")

</div>

Did you ever figure this out? I would be interested in this as well.
