# How to add facebook pixel code for analytics in the discourse instance, installed on our GCP?

**URL:** https://meta.discourse.org/t/how-to-add-facebook-pixel-code-for-analytics-in-the-discourse-instance-installed-on-our-gcp/102714
**Category:** Support
**Created:** [November 25, 2018, 11:03am UTC](https://meta.discourse.org/t/how-to-add-facebook-pixel-code-for-analytics-in-the-discourse-instance-installed-on-our-gcp/102714 "2018-11-25T11:03:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sagar2agrawal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sagar2agrawal/32/125298_2.png) [@sagar2agrawal](https://meta.discourse.org/u/sagar2agrawal)
#### Post date: [November 25, 2018, 11:03am UTC](https://meta.discourse.org/t/how-to-add-facebook-pixel-code-for-analytics-in-the-discourse-instance-installed-on-our-gcp/102714/1 "2018-11-25T11:03:37Z")

</div>

I have installed Discourse in our server and we need to add facebook pixel code in our installations, any idea how to make it happen?

i saw there’s an inbuilt plugin for google analytics but not facebook analytics.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [November 25, 2018, 1:24pm UTC](https://meta.discourse.org/t/how-to-add-facebook-pixel-code-for-analytics-in-the-discourse-instance-installed-on-our-gcp/102714/2 "2018-11-25T13:24:23Z")

</div>

You should be able to add that code as a theme component. Probably stick it in the `head ` section.

---

<div class="post-metadata">

### Author: ![hyd504](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hyd504/32/177122_2.png) [@hyd504](https://meta.discourse.org/u/hyd504)
#### Post date: [July 17, 2021, 7:05am UTC](https://meta.discourse.org/t/how-to-add-facebook-pixel-code-for-analytics-in-the-discourse-instance-installed-on-our-gcp/102714/3 "2021-07-17T07:05:36Z")

</div>

Just sticking it in the head won’t miss virtual page views? I guess it needs to fire its page view event each time a virtual page view is triggered.
