YouTube videos that could help you do this task :
How to set up Facebook Pixel Conversion Tracking with Google Tag Manager :
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 (if youâre using WordPress :
Adding Google Tag Manager to a WordPress SiteAdding Google Tag Manager to a Shopify StoreHow to add Google Tag Manager to a Squarespace site
You should have created a Business Manager account for your site, you can follow :
Create a Facebook Ads account using Business ManagerYou also need to have the Facebook pixel on your website, If you donât have it yet, you can follow:
Installing the Facebook Pixel on Your SiteFinally, youâll need to have verified your domain inside Facebook Business Manager you can follow :
Configuring your Facebook Ads conversion eventsWhy 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.
- Environment Setup
Important:
- On April 27th 2021, Facebook rolled out new ad measurement protocols to conform with iOS14 that introduced the App Tracking Transparency (ATT) prompt. Appleâs prompt requirement will also prohibit certain data collection and sharing by businesses unless Apple device users who updated to iOS14 opt into data tracking.
- When Apple users opt-out of data tracking, the accuracy or tracking and the size of remarketing audiences will decrease.
- Deciding which conversion tracking method is better for you.
Note: If you are already familiar with Facebook Conversion tracking and have a preference of one method over the other you can skip this chapter and go straight to the tracking method you prefer. In some cases, choosing one over the other can be a matter of personal preference. For the purpose of this SOP, a decision diagram was created to simplify the decision process.
This SOP will cover both methods, you can jump to the one you prefer by clicking here:
- Tracking conversions using Facebookâs Custom Conversions
- Tracking conversions using Facebookâs Standard Events for page views
- Tracking conversions using Facebookâs Standard Events for button clicks
- Setting up conversion tracking for page views using Facebookâs Standard Events with Google Tag Manager
**Note: These steps will cover the process to track any conversion that ends in a redirection to a âThank Youâ page. In most cases, you will have a page where the user needs to perform an action (e.g.: insert contact details or purchase a product) and after the user performs that action he will be sent to a final page. This is the page where you will be setting up your conversion event.
E.g.:
- Open Facebookâs Business Manager on your browser by going to: https://business.facebook.com.
- On the sidebar, choose âEvents Managerâ:
- In the Event Manager panel, you will see your Pixel ID which you can click to copy:
- 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 âDiscover more tag types in the Community Template Gallery.â
- Click on the search icon and type in âFacebook Pixelâ
- Choose âFacebook Pixel by facebookincubatorâ (it should have a green checkmark beside it).
- Click âAdd to Workspace,â then click âAddâ again when prompted
- Go back to your Facebook Events Manager tab and copy your Pixel ID, then paste it in the Facebook Pixel ID blank in the Google Tag Manager tab. Next, tick âStandardâ and choose the event that best fits your situation from the dropdown.
**Note: For the purpose of this SOP we will be tracking a pageview. If you are tracking any other event you should select the one that relates the most to what you would like to track.
- 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/
- Remove the http:// (or https://), the www, and the last trailing slash from the URL:
e.g.: retroaddicts.com/thank-you-new-subscriber
- Add a \ right before every dot and every slash.
e.g.: retroaddicts\.com\/thank-you-new-subscriber
- Add this code after your URL: (?!\/.*\/)((\/?)$|.*.*=.*)
e.g.: 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(?!\/.*\/)((\/?)$|.*.*=.*)
- Thatâs it. You just built your RegEx. Take note of that expression.
- 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.
- 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.
- 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 (https://tagassistant.google.com/) 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)
- 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.
**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.
- 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â.
(e.g.: Click text | equals | ADD TO CART)
- 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â
- 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
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-subscriber199282jsn | in this case you can use: [URL][contains][199282jsn]
- Using [URL][equals] instead of [URL][contains].
- Not using Facebook Custom Conversions and using Standard Events through Google Tag Manager instead, as described in the first chapter of this SOP.
**Note: If your website or any of your tools use dynamic parameters in the URL your conversions will not be tracked.
- 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 need to configure it in Business Manager.
- 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 :
Configuring your Facebook Ads conversion events