Setting up Facebook Conversion Tracking
Last Updated / Reviewed: July 19th, 2022
Execution Time: 15-30 minutes
Goal: To have all your conversions set up and sending the conversions data to the Facebook ad platform.
Ideal Outcome: The conversions are properly set up and you are now able to use them inside your Ad campaigns.
Prerequisites or requirements: To follow this SOP to add Standard Events, you need:
- Google Tag Manager installed on your site. If you haven’t done so already, you can follow SOP 004 if you’re using WordPress, SOP 065 if you’re using Shopify, or SOP 066 if you’re using Squarespace.
- You should have created a Business Manager account for your site (you can follow SOP 010 to do that).
- You also need to have the Facebook pixel on your website, If you don’t have it yet, you can follow: SOP 005.
- Finally, you’ll need to have verified your domain inside Facebook Business Manager (you can follow SOP 97 to do that).
Why this is important: When you finish this SOP, you should then be able to see how many conversions and how much revenue each ad is bringing you, allowing you to start optimizing your campaigns for the best results.
Where this is done: In your Google Tag Manager account and Facebook Ads platform.
When this is done: Every time there is a new conversion that needs to be measured.
Who does this: The person responsible for IT, analytics, or paid advertising.
Setting up conversion tracking for page views using Facebook’s Standard Events with Google Tag Manager
- Open Facebook’s Business Manager on your browser by going to: Login and Access Meta Business Suite and Business Manager.
- On the sidebar, choose “All Tools” ➝ “Events Manager”:
- In the Event Manager dashboard, select “Add Events” ➝ “From a new Website”:
- Then select “Install code manually”.
- Copy the pixel code and paste it in an editor or notepad. You will need this code later on.
- Now open tagmanager.google.com in a new tab, click on ‘Tags’ in the left sidebar then click ‘New’:
- Click on the tag icon above ‘Choose a tag type to begin setup’ and then click on ‘Custom HTML’.
- Paste the pixel code that you copied just then.
- Scroll down to ‘Triggering,’ click the interlocking circles icon above ‘Choose a trigger to make this tag fire…’, then click the ‘+’ icon to add a new trigger:
- Rename your Trigger → Click icon above ‘Choose a trigger to begin setup’ → Select ‘Page View’:
Note: When naming your trigger, it is recommended that you define your naming convention. It should be clear and fast to guess what each trigger is doing based solely on its name. For this SOP we will be using: “FBLead_ThankYou_FriendReferral” since this trigger is going to be used to track a conversion, using a thank you page for referring a friend to get a $20 coupon. - After selecting ‘Page View,’ tick ‘Some Page Views.’ Under the trigger firing rules, select: ‘Page URL’ → ‘matches RegEx’.
- You will now need to build a RegEx (Regular Expression) that matches the URL where we want our Facebook Ads to fire.
- Note: If you are comfortable with GTM and your website structure you might not need to use a RegEx condition at this point, or you might want to tweak the RegEx to fit your needs. If not, you can follow this procedure.
- Note 2: In the following steps you’ll be creating a RegEx that will match your URL whether:
- It starts with http, or https;
- You are using a trailing slash, or not;
- You are adding parameters to your URL, or not;
- You have deeper URLs in your folder structure, or not;
- Type the URL where you want your conversion to fire.
e.g.: [_http://www.retroaddicts.com/thank-you-new-subscriber/](http://www.retroaddicts.com/thank-you-new-subscriber/ "") - Remove the http:// (or https://), the www, and the last trailing slash from the URL:
e.g.: [_retroaddicts.com/thank-you-new-subscriber](http://retroaddicts.com/thank-you-new-subscriber "") - Add a ____ right before every dot and every slash.
e.g.: [_retroaddicts.com/thank-you-new-subscriber](http://retroaddicts.com/thank-you-new-subscriber "") - Add this code after your URL: (?!/./)((/?)$|.*.*=.)
e.g.: [_retroaddicts.com/thank-you-new-subscriber](http://retroaddicts.com/thank-you-new-subscriber "")(?!/./)((/?)$|.*.*=.) - Add this code in the beginning of your URL: (http|https)://(www.)?
e.g.: (http|https)://(www.)?[_retroaddicts.com/thank-you-new-subscriber](http://retroaddicts.com/thank-you-new-subscriber "")(?!/./)((/?)$|.*.*=.) - That’s it. You just built your RegEx. Take note of that expression.
- Type the URL where you want your conversion to fire.
- Insert your RegEx in the last field. It should look something like this:
- Click the blue ‘Save’ button at the topmost right side of your screen.
- Rename your tag:
- Note: When creating new tags it’s recommended to define a naming convention from the beginning, this keeps your Google Tag Manager set up neatly organized and easy to maintain for many years to come.
[Abbreviated Name Of Tool][Use for this tag] is a good start._
- Note: When creating new tags it’s recommended to define a naming convention from the beginning, this keeps your Google Tag Manager set up neatly organized and easy to maintain for many years to come.
- Click on “Overview” on the sidebar, to see a summary of the changes you’ve made.
- Hit the ‘Submit’ button. You will be required to enter a Version Name and Description.
Note: Adding a name and description is optional but recommended. You should enter information here that will make it easy to know what changes are being made. - After you’re done, jump to “Check if conversions are being tracked properly”
Setting up conversion tracking for a button click using Facebook’s Standard Events with Google Tag Manager
Note: These steps will cover the process to track any button click conversion. This is especially useful when tracking “Add to Cart” events. This allows you to later create custom audiences based on this interaction with the store. e.g.;
- Open tagmanager.google.com in a new tab.
- Click “Variables” → “Configure”.
- A list of variables will be available to you. Select all the variables under “Clicks” and when that is done close the list.
- Note: If you already know which variables you are going to need. You can simply select the specific variable you are going to be using for this event.
- Next, click on ‘Tags’ in the left sidebar then click ‘New’:
- Click on the tag icon above ‘Choose a tag type to begin setup’ and then click on ‘Discover more tag types in the Community Template Gallery.’
- Since we added it before, the “Facebook Pixel” option is now in your Custom List when you scroll down, click on that option:
- Rename tag, go back to your Facebook Events Manager tab and copy your Pixel ID, then paste it in the “Facebook Pixel ID” field in Google Tag Manager. Note: When creating new tags it’s recommended to define a naming convention from the beginning, this keeps your Google Tag Manager set up neatly organized and easy to maintain for many years to come.
[Abbreviated Name Of Tool][Use for this tag] is a good start._- Scroll down to ‘Triggering,’ click the interlocking circles icon above ‘Choose a trigger to make this tag fire…’, then choose ‘All Elements’:
Rename your Trigger → Click “Choose a trigger to begin setup >> Select ‘All Elements’ under Clicks:
Note: When naming your trigger, it is recommended that you define your naming convention. It should be clear and fast to guess what each trigger is doing based solely on its name. For this SOP we will be using: ‘Engagement_AddtoCart‘ since this trigger is going to be used to track an AddtoCart click and we only have one button on this store.
- Scroll down to ‘Triggering,’ click the interlocking circles icon above ‘Choose a trigger to make this tag fire…’, then choose ‘All Elements’:
- Now, you need to find out which of the variables to use for the purpose of what you want to track. To do that open another tab to access the Google Tag Manager workspace panel and click “Preview” on the top right of the page:
- Enter the URL of your website → Click ‘Connect:’
- This will open your website’s URL on a new tab. Navigate to the page where the button you want to track is. You should be able to see a message on the bottom right corner letting you know that the debugger has connected successfully:
- On your keyboard, hold down the “Ctrl” (or “Cmd ⌘” key If you’re using a Mac) and click on the button that you want to track.
- Google Tag Assistant (Google Tag Assistant) will list all your actions. In this list, Google Tag Manager lists all the information that was returned from that click.
- If your “Click ID” field has been filled with a text string (e.g: 'link_text-6-20') take note of the combination. (e.g: Click ID | link_text-6-20)
- Note: Usually HTML IDs are unique within the page, in rare cases your web designer might have used the same ID for different elements. If that is the case you will want to select option b. or c.
- If you don’t have a “Click ID” and you are sure your HTML Class is not shared with any other button that you don’t want to track, you can use that. Take note of that combination (e.g: Click Classes | add_to_cart_button). If you are unsure, go with the next option (c.).
- If none of those two options apply to you, you should use the “Click Text” variable. Take note of that combination (e.g: Click Text | ADD TO CART)
- Note: Make sure this specific text is not being used elsewhere in another link. Otherwise clicks on that link will count as conversions as well.
- Go back to Google Tag Manager, and edit the trigger you previously created (in our example, the ‘Engagement_AddtoCart’ trigger).
- Click “Trigger Configuration” → Under “This trigger fires on” select ‘Some Clicks’ → Select the combination you took note in Step #8 of this SOP, then Hit “Save”.
- Click on “Overview” on the sidebar, to see a summary of the changes you’ve made.
- Hit the ‘Submit’ button. You will be required to enter a Version Name and Description.
Check if conversions are being tracked properly
Note: This step requires the Facebook Pixel Helper Chrome Extension to be installed on Google Chrome.
- Open your website using Chrome.
- Perform the action that you want to check if it is being tracked. (e.g.: submitting a form, adding a product to cart, etc.)
- Click on the Facebook Pixel Helper Chrome extension.
- You should be able to see the name of the conversion that you are tracking appear on the list, clicking on it will show the conversion parameters. Those will only be set if they were configured when setting up the event.
- Note: If you’re tracking a button click you might need to press and hold the Ctrl key (or Cmd ⌘ If you use a Mac) when you click on it. This will make sure the link is opened in a new tab and therefore the page will not refresh making you potentially miss the opportunity to see the event being tracked.
- Example for a Button Click:
- Go to the page where the button is.
- Press and hold the Ctrl key (or Cmd ⌘ If you use a Mac) and click the button you want to test.
- Click the Facebook Pixel Helper Extension, you should see the event you chose to fire when that button is clicked.
- Once you’ve verified that your conversion is being tracked successfully, you’ll need to configure it in Business Manager.
Using Facebook Custom Conversions to track a Lead Signup.
- In Facebook’s Event Manager panel, click on the Custom Conversions in the left sidebar:
- Click the “Create Custom Conversion” button.
- You should be able to set up all the information regarding what you want to track now. Make sure you have selected the right pixel to work on. The options to be configured here will depend on what you want to track:
- Name: Try not to make this too long, it should be evident what this conversion is about. (e.g: Trial Lead)
- Description (optional): Add some more information about this conversion if it is not clear enough in the name.
- Remember: You will want anyone to understand what the conversions are about. You might want to assign the ad account management to an employee or an agency. They should not be guessing what each conversion is.
- Conversion Event: Select the one that better fits your purpose. If It is not a Lead, or an Add to Cart, pick “All URL Traffic”. For this SOP, to track Lead Signups we’ll select “Lead”.
- Rule 1: Select [URL][contains] and type here a specific part of your URL that will not be in any other of your page URLs.
- E.g.: If your URL is: retroaddicts.com, and your “Thank you” page is: retroaddicts.com/thank-you-new-subscriber, you can use:
- retroaddicts.com/thank-you-new-subscriber, or
- /thank-you-new-subscriber
- But, if you have other URLs on your site that may contain that same text, do not use that, example:
- ‘Thank you’ page: retroaddicts.com/thank-you-new-subscriber
- Another unrelated page for a different conversion: retroaddicts.com/**thank-you-new-subscriber/**unrelated_offer
- E.g.: If your URL is: retroaddicts.com, and your “Thank you” page is: retroaddicts.com/thank-you-new-subscriber, you can use:
If you used [URL][contains][thank-you] for your rule, the second page will also count as a conversion since it also contains “/thank-you-new-subscriber”.
If this is the case, consider:
- Using another part of the URL to create the rule.
- Editing the URL slug of your ‘thank you’ page so that it is absolutely unique e.g.: retroaddicts.com/thank-you-new-subscriber-199282jsn | in this case you can use: [URL][contains][199282jsn]
- Using [URL][equals] instead of [URL][contains].
- Note: If your website or any of your tools use dynamic parameters in the URL your conversions will not be tracked.
- Not using Facebook Custom Conversions and using Standard Events through Google Tag Manager instead, as described in the first chapter of this SOP.
- Value (optional): How much is this conversion worth to you. If you choose to input this field, you will be able to see it when analyzing campaigns and more efficiently optimize your campaigns.
- Click “Create” and your custom conversion has been created successfully.
- You will see your new custom conversion on the list.
- If you’re seeing a green light and an “Active” status it means someone browsing your website has already triggered the rule that you created. If that is the case your custom conversion should be correctly configured.
- But in most cases, you will see an inactive status:
- If that is the case, simply open a new tab on your browser and open your “Thank you” page (or the conversion page you set up before)
- Wait 30 seconds. Go back to the Facebook Custom Conversion tab, refresh the page and re-check. You should now be able to see this message:
- Once you’ve verified that your conversion is being tracked successfully, you’ll move to the last section of this SOP.
Configuring your conversion events in Facebook Business Manager
- After you’ve set up conversion tracking, you’ll need to configure these conversions in Facebook Business Manager before you can use them in your campaigns. Follow this SOP to learn how to do that.