Facebook ads tracking

Hi,

I would like to create a Facebook ads based on conversion tracking. I tried to set the page : /wp-login.php?action=register as the page that should be tracked for a purchase.

But it doesn’t work. (it works properly on any other page). And I don’t get how to manage this with the API tracking section.

Do you have an idea how to solve this ?

Thank you !

Sophie

Facebook has changed their tracking to their universal pixel, so you actually need to embed 2 things to track facebook ad conversions now.

  1. the universal pixel itself needs to go into the header on each page
  2. the tracking javascript event code snippet for the conversion tracking. This needs to go into the API/tracking section > Signup tracking

Here’s the instructions on how to create the pixels:

Thank you Ryan,

The pixel is in my header, like I said it’s working fine on all pages but the registration page.

Do I have to put the event code alone in the Api/tracking section, or the full pixel + code ?

And the problem is : it’s working allready perfectly on any other page than /wp-login.php?action=register, so do you think it will change something to ad this event code also in the API tracking section ? Cause I added the event code inside the pixel code allready (following facebook tutorial) and it’s working fine on any page but /wp-login.php?action=register

Thank you for your help,

You paste something that looks like this in the api/tracking section:

<script>
fbq('track', 'CompleteRegistration', {
value: 30,
currency: 'USD'
});
</script>

This will only track for accounts created through the checkout process, so if you are trying to track free accounts created without checkout, I don’t think it will work.

Thank you Ryan, I will try this !

Well…It’s not working. When I use custom conversion on registration page, it shows no activity, but on any other page it works.

Is it working for you ?

Anyone can help on this ?

Sophie, I seem to be saying this a lot lately on the forum. But here goes again. This is nothing to do with s2Member.

You are using the WordPress registration page, so it’s a Facebook/WordPress issue.

Why does that matter? Because, once you realize that, you should think to Google instead. And that makes you much more likely to find the answer. I did a quick Google and turned up this plugin: https://wordpress.org/plugins/pixelyoursite/

You’d be much better off trying that and asking further questions on their forum.

Yes, I understand what you are saying.

But as I say before : It works like a charm on any page, but this page only.

You know, I searched on Google, on Elance (no one even messaged me), I contacted Facebook, asked my 5000 friends on FB, a dev on Fiverr…No one has a clue on this. So, I have to ask again if someone know something…

But I will stop to post here, got it.

And I repeat: that is nothing to do with s2Member.

That page is created by WordPress. s2Member has nothing to do with it.

Hi Sophie, I’m having the same issue and although I don’t yet have a solution I can explain what’s happening. If you look in your s2member member areas you will see the fb tracking pixels work within s2member - it isn’t an s2member issue.

The issue is that the registration page you want to track isn’t within your theme (I had the same issue with a thrive leads landing page template which was outside of the theme templates themselves a while ago) - so if like me your tracking pixel code is inside your theme header code it won’t work on wordpress login and registration pages.

My first solution is to track the welcome page people go to after registering and logging in since I can’t edit login/register pages from within wordpress to add the code to these pages individually. If you found another solution do let me know!

1 Like

Hi Tim, I appreciate that this registration/login page is nothing to do with s2member, what IS to do with s2member is the ‘thank you’ page after paypal redirect. I’m trying to track sales for facebook ad optimisation but the tracking pixel for the site is not on the thank you page for s2member. Since I can’t edit the thank you page this is a problem, if you have a solution could you let me know please. Thanks, Gemma

Here is my solution.

I have created my own plugin to add tracking script to Login headers.

This way, the Login pages are also monitorized and I can add to Facebook the events asociated to specific URLs like “checkemail=registered”

This is myplugin.ptp content, replace XXXXX with your own codes:

<?php /* Plugin Name: myplugin Description: Personalizacion Author: My Name * Version: 0.1 */ // // Login page header // add_action('login_head', 'carlosheader'); function carlosheader(){ if ( !current_user_can('edit_posts') ) { //Close PHP tags ?>

add your code here between scripts tags

<?php //Open PHP tags

}
}

//
// Fin Header
//
/* Fin del cógido del plugin */

?>

I have removed the rest of my pluggin to leave just the code related to tracking Facebook Ads. I hope I haven’t make a mistake.

Create a PHP file named as the plugin (see “Plugin name” in the code) and leave it in plugins directory. Do not forget to activate it.

These constant comments about something not being about s2member unhelpful. This is a community of 2member users who likely have experience solving problems related to implementation. It is perfectly normal and acceptable and, in fact, HELPFUL for people to post their questions here.

1 Like

Helpful to whom? If the person asking the question actually wants an answer, then asking here when it isn’t about s2Member isn’t going to provide it, whereas posting in the appropriate forum or using Google is very likely to do so.

It’s been a while, but when I ran FB ads to an s2 site I did something similar to what
uurayan
said above.

That code would need the normal pixel loaded earlier in the page to work and since FB changes all the time it’s probably different now, but it’s a good starting point. I really don’t know because I don’t use FB ads anymore.

Look at the FB pixel docs, make sure your pixel is loaded first, and put whatever they suggest for a conversion event later on the page (putting in api/tracking as suggested above, for example).

It’s more of a FB and JS question once you know that s2 wants code like this in api/tracking.

And, as far as I can remember, I think there are sections to track different accounts (even free ones) there.

s2 actually make it much easier to implement than even WooCommerce. If you’ve ever worked with MS Ads, then you’ll know :slight_smile: