# Forum Posts Triggering Facebook Pixel Twice

**URL:** https://meta.discourse.org/t/forum-posts-triggering-facebook-pixel-twice/222372
**Category:** Data & reporting
**Created:** [March 29, 2022, 4:30pm UTC](https://meta.discourse.org/t/forum-posts-triggering-facebook-pixel-twice/222372 "2022-03-29T16:30:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Charles\_Hoffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charles_hoffman/32/254725_2.png) [@Charles\_Hoffman](https://meta.discourse.org/u/Charles_Hoffman)
#### Post date: [March 29, 2022, 4:30pm UTC](https://meta.discourse.org/t/forum-posts-triggering-facebook-pixel-twice/222372/1 "2022-03-29T16:30:36Z")

</div>

Hey, I integrated my Facebook Pixel with [my forum](https://forum.blackghostaudio.com/). Everything is working as expected, except that a PageView Pixel event triggers twice when I load forum post pages. A single PageView Pixel event is triggered on other forum pages. Does anybody know why this double-fire might be happening?

---

<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: [March 29, 2022, 11:04pm UTC](https://meta.discourse.org/t/forum-posts-triggering-facebook-pixel-twice/222372/2 "2022-03-29T23:04:35Z")

</div>

How did you add the pixel?

---

<div class="post-metadata">

### Author: ![Charles\_Hoffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charles_hoffman/32/254725_2.png) [@Charles\_Hoffman](https://meta.discourse.org/u/Charles_Hoffman)
#### Post date: [March 30, 2022, 1:21am UTC](https://meta.discourse.org/t/forum-posts-triggering-facebook-pixel-twice/222372/3 "2022-03-30T01:21:40Z")

</div>

I created a component (Settings \> Customize \> Components) called “Facebook Pixel” and then clicked “Edit CSS/HTML”. Then, I copied and pasted my Meta Pixel Code into the Common Head section and clicked “Save”. I tried moving the pixel to the Body section to see if that would fix the issue but it didn’t.

Any help you can provide is appreciated. Thanks!

Edit: I figured out why this was happening but I don’t know how to fix it. The URL changes after the page loads. For example, there’s a /3 appended to the end of the URL in the first PageView and a /2 appended to the second PageView. When I scroll up the page, the appendage disappears, which actually triggers a third PageView. Also, when I scroll back down, the appendage reappears.

 ![pageview](https://global.discourse-cdn.com/meta/original/3X/7/b/7bd4f3922f65f7090dae413aa73968871082f322.png)

---

<div class="post-metadata">

### Author: ![fzngagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fzngagan/32/259349_2.png) [@fzngagan](https://meta.discourse.org/u/fzngagan)
#### Post date: [April 1, 2022, 7:27am UTC](https://meta.discourse.org/t/forum-posts-triggering-facebook-pixel-twice/222372/4 "2022-04-01T07:27:32Z")

</div>

Hi Charles,  
I briefly looked into this one and [here’s a link](https://developers.facebook.com/docs/meta-pixel/implementation/tag_spa) that describes how to achieve the correct behaviour using SPAs (Discourse being one). I think you need to hook into the Ember routing system and track the `PageView` only when a new topic is opened.

I think you can post this is #Marketplace and someone should be able to help out if you’re willing to spend some money on this.
