# How to catch click events on a link in order to fire a pixel

**URL:** <https://meta.discourse.org/t/how-to-catch-click-events-on-a-link-in-order-to-fire-a-pixel/58704>\
**Category:** Product Support\
**Created:** [3월 9, 2017, 8:39오전 UTC](https://meta.discourse.org/t/how-to-catch-click-events-on-a-link-in-order-to-fire-a-pixel/58704 "2017-03-09T08:39:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [3월 9, 2017, 12:45오후 UTC](https://meta.discourse.org/t/how-to-catch-click-events-on-a-link-in-order-to-fire-a-pixel/58704/2 "2017-03-09T12:45:01Z")

</div>

You should be able to catch click events with jquery via a customization. Put this in the `</head>` section:

```javascript
<script type="text/discourse-plugin" version="0.2">
    Discourse.PageTracker.current().on('change', function () {
        $(".topic-list-item .title").on("click", function(){
            console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
        })
    })
</script>

```

This will log the string of x`s every time you click on the title of a topic in a list of topics. You could alter this to do whatever you please for every link on the site.

---

_[View the full topic](https://meta.discourse.org/t/how-to-catch-click-events-on-a-link-in-order-to-fire-a-pixel/58704)._
