# How to add a pixel which fires when any user registers?

**URL:** https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934
**Category:** Support
**Created:** [2016 年 1 月 14 日午前 9:05 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934 "2016-01-14T09:05:21Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![divine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divine/32/121302_2.png) [@divine](https://meta.discourse.org/u/divine)
#### Post date: [2016 年 1 月 14 日午前 9:05 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/1 "2016-01-14T09:05:21Z")

</div>

Hello

We need to add a facebook image pixel which is fired when the users register. Any idea on how can we do that?

Thanks!

---

<div class="post-metadata">

### Author: ![divine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divine/32/121302_2.png) [@divine](https://meta.discourse.org/u/divine)
#### Post date: [2016 年 1 月 17 日午前 4:13 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/2 "2016-01-17T04:13:40Z")

</div>

Any suggestions to it?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2016 年 1 月 17 日午前 6:00 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/3 "2016-01-17T06:00:32Z")

</div>

What you want is a webhook, not an image request.

---

<div class="post-metadata">

### Author: ![divine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divine/32/121302_2.png) [@divine](https://meta.discourse.org/u/divine)
#### Post date: [2016 年 1 月 22 日午後 1:53 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/4 "2016-01-22T13:53:10Z")

</div>

As I understand, ‘webhook’ is for the server (where discourse is installed) to send HTTP requests after a certain event. On the other hand, I want to place a HTML/Javascript code which executes from the client-side when he registers. Is this something which a webhook can do?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2016 年 1 月 27 日午後 3:52 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/6 "2016-01-27T15:52:40Z")

</div>

> [@divine](#):
>
> On the other hand, I want to place a HTML/Javascript code which executes from the client-side when he registers.

The question is why do you want to do it this way? Wouldn’t it make more sense to have the server send a signal once the user registers, rather than a hidden pixel which is less reliable?

---

<div class="post-metadata">

### Author: ![divine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divine/32/121302_2.png) [@divine](https://meta.discourse.org/u/divine)
#### Post date: [2016 年 1 月 28 日午前 5:51 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/7 "2016-01-28T05:51:26Z")

</div>

> [@eviltrout](#):
>
> The question is why do you want to do it this way? Wouldn’t it make more sense to have the server send a signal once the user registers, rather than a hidden pixel which is less reliable?

It is because Google Adwords and Facebook Ads only allow us to place image pixels and don’t allow server-to-server communication.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2016 年 1 月 28 日午前 6:55 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/8 "2016-01-28T06:55:55Z")

</div>

> [@divine](#):
>
> It is because Google Adwords and Facebook Ads only allow us to place image pixels and don’t allow server-to-server communication.

Are you saying you have advertisements on the registration modal?

---

<div class="post-metadata">

### Author: ![divine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/divine/32/121302_2.png) [@divine](https://meta.discourse.org/u/divine)
#### Post date: [2016 年 1 月 28 日午前 7:30 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/9 "2016-01-28T07:30:52Z")

</div>

We want to advertise our discourse forum on Google Adwords and Facebook Ads. They allow us to place an image pixel when a conversion takes place (in this case a user registration). This allows them to optimize our ad campaigns and show our ads to users who are more likely to signup. Does that make sense?

Here is more information on how to use image pixels for conversion tracking:  
[https://www.facebook.com/business/help/460491677335370](https://www.facebook.com/business/help/460491677335370)

> **[Add a Google tag to your website - Google Ads Help](https://support.google.com/google-ads/answer/6331314?hl=en&ref_topic=3165803)**
>
> Note: The global site tag (gtag.js) is now the Google tag. With this change, new and existing gtag.js installations will get new capabilities to help you do more, improve data quality, and adopt ne

---

<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: [2016 年 1 月 28 日午前 8:07 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/10 "2016-01-28T08:07:24Z")

</div>

It sounds like you want the script to fire on this page:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/8/d84b4d7af6f538afc4208f6f4fb549bc2f5de5d2.png)

Maybe you can paste the pixel code in here (admin/customize/text-content).

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/1/e15b18565e876caa690b1a10910ec72759becb62.png)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2016 年 1 月 28 日午後 3:56 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/11 "2016-01-28T15:56:54Z")

</div>

This should work and would be a great place for the tracking code.

Ideally this would be done via Javascript in the adwords plugin for you, but this is a nice workaround.

---

<div class="post-metadata">

### Author: ![dylanh724](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dylanh724/32/119642_2.png) [@dylanh724](https://meta.discourse.org/u/dylanh724)
#### Post date: [2016 年 12 月 29 日午後 4:33 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/12 "2016-12-29T16:33:39Z")

</div>

Apologies to bump, but it would be best when visiting the main page. It’s not for direct advertising - for remarketing later. For example if someone visited your forum, they are at least SOMEWHAT interested in what you have to offer, whether they register or not. That’ll allow FB pixel to send signal to remarket later.

**EDIT:** I placed it at admin \>\> customize \>\> css/html \>\> html customization \>\> under `</head>`. Is that right?

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019 年 9 月 6 日午後 2:01 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/14 "2019-09-06T14:01:50Z")

</div>



---

<div class="post-metadata">

### Author: ![SouperC](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/souperc/32/62875_2.png) [@SouperC](https://meta.discourse.org/u/SouperC)
#### Post date: [2019 年 9 月 6 日午後 3:57 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/15 "2019-09-06T15:57:13Z")

</div>

ボディ内にピクセルコードを設定していますが、それが良いのか悪いのかはわかりません。3 年間問題なく動作しています。Chrome 用のピクセルチェッカーをインストールして検証することもできます。

サインアップのみを追跡する場合は、もう少し複雑になる可能性があります。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023 年 4 月 4 日午後 8:06 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/16 "2023-04-04T20:06:00Z")

</div>



---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023 年 4 月 5 日午前 11:30 UTC](https://meta.discourse.org/t/how-to-add-a-pixel-which-fires-when-any-user-registers/37934/17 "2023-04-05T11:30:14Z")

</div>


