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

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!

2 Likes

Any suggestions to it?

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

2 Likes

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?

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?

3 Likes

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?

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://support.google.com/adwords/answer/6331314?hl=en&ref_topic=3165803

2 Likes

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

image

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

5 Likes

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.

1 Like

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?

1 Like

i have my pixel code setup in body, not sure if that’s good or bad, but it’s been working for three years. You can install the pixel checker for chrome to validate it.

To track signups only might be more involved.

3 Likes