Meta Pixel Tracking

If you want to track your sales from Facebook and/or Instagram back to the Meta Ads Manager, then follow this quick tutorial and let SamCart do all the heavy lifting. 

When you invest money in advertising, you need to know exactly how many revenue those ads generated. With SamCart's Meta Pixel integration, you can track your Return on Ad Spend (aka "ROAS") down to the dollar. So you know exactly when to scale up what you're spending and acquire more customers. 

Add Your Meta Pixel ID to SamCart

To get started, click on Settings in the left-hand sidebar. 

Scroll down to the Pixel Tracking section, and toggle Meta's pixel tracking on. 

Paste your Meta Pixel ID in the space provided. Your Meta Pixel ID is usually 15-16 characters, and comprised of numbers only. If you need help creating a Meta Pixel, or finding your Meta Pixel ID, visit this help article from Meta

After your Pixel ID is pasted in, click Save Changes at the top of the page. 

Firing Events Back To Meta

Once your Meta Pixel is saved, SamCart will automatically populate it onto every checkout you create. SamCart fires a few different standard events back to Meta, which you can use to track how your ad campaigns are performing. Here are the list of events SamCart will fire as your users checkout...

  • Page View: Each time a visitor loads a checkout, or an upsell page, this event will fire. 
  • Add Payment Info: When a user submits their order, but before the charge is successful, this event will fire. 
  • Purchase: When a customer's credit card is charged, this even will fire. This means that throughout a single order, multiple purchase events could potentially fire (depending on whether you are offering One Click Upsells or not).

The most important event for your tracking is Purchase. Each time your customer's card is charged, SamCart will fire a Purchase event back to Meta. SamCart includes metadata with each event that will tell Meta additional information. 

- The SamCart product ID(s) of any product included in the charge

- The name of the original product the customer bought

- The quantity of each item purchased

- The total charge amount (which does reflect any discounts from coupons the customer might have used)

If you are using One Click Upsells after checkout, a separate purchase event will fire for each upsell a customer buys. Upsell purchase events will only include products and revenue. 

Testing Your Meta Pixel

If you would like to test your Meta Pixel to see these events, we recommend downloading the Meta Pixel Helper Chrome Plugin. After installing and activating that plugin, you can load any SamCart checkout and see the events firing as you place your order. You can also see the metadata SamCart sends back to Meta in real time.

The Meta Pixel Helper is what you are seeing in the screenshots above.

Alternatively, you can test your Meta pixel by using the testing events tool inside of your Meta Events Manager. Simply plug in the URL to your SamCart checkout or landing page where you have embedded a SamCart Checkout. Meta will open that page in a new tab, place an order yourself, and then go back to the Meta Events Manager to see each of the different events SamCart has sent back to Meta (like the example below).

Remove Any Duplicate Pixels

If you have your Meta Pixel embedded in the footer or header of your SamCart pages, you should remove those pixels to avoid any duplicative information being sent to Meta. There are two places to check for extra Meta pixels you may have embedded on your checkouts...

First, head to your Marketplace Settings. Check for any Meta Pixel in the "Embed Scripts In Header" or "Embed Scripts In Footer" boxes. If you have turned on the Meta Pixel tracking from the beginning of this article, these two boxes do not need your Meta Pixel script. 

Secondly, checkout your products' Advanced Settings tab. There are three similar boxes where you could embed custom scripts. Your Meta Pixel script should not be included in any of these three boxes if you have turned on the Meta Pixel tracking outlined in this article. While you may have other scripts included in these boxes, there is no need for your Meta Pixel to be included. 

Important Setting for External Thank You Pages

If you are sending customers to an external thank you page (aka not using SamCart's Order Summary Page), make sure you set the toggle shown below on. This toggle is found in your Marketplace Settings, just below where you setup this integration. 

Fire Pixels Before Redirect must be toggled on if you are sending customers to your own thank you page. This toggle ensures that sales made from your final one click upsell are tracked before the user is redirected away from SamCart to your own thank you page. 


Troubleshooting

Problem: I do not see the Meta Pixel when I load a SamCart checkout.
Solution: Make sure you do not have any ad blockers running on your browser. Ad blockers can prevent Meta Pixels from being rendered on a page.  

Problem: My sales are being reported twice in my ads dashboard.
Solution: Make sure you have removed all Meta Pixels and event tracking from the embed boxes in your Marketplace Settings, and in each of your product's settings (see the Remove Any Duplicate Pixels section of this article).

You will also want to make sure you are not firing any integration rules with the Facebook Conversions API. Using the built-in tracking alongside with the Conversions API integration could cause duplicate reporting inside of Meta. 

Frequently Asked Questions

Q: Does this replace the need to have my Meta Pixel embedded in the Header/Footer? What about conversion events script in my products' advanced settings? 

A: Yes! With this integration active, you can remove any Meta Pixels you have embedded in your Marketplace Settings. You also no longer need any pixels with conversions events added to your product's "Fire Pixels/Scripts After Order Is Completed" box under Advanced Settings. This integration will fire events back to Meta for all products after.

Q: Should I use the Facebook Conversions API alongside this integration? 

A: Our recommendation is to use either this new integration, or the Facebook Conversions API. In theory, the events sent through Conversion API's "server side" tracking are "de-duplicated" by Meta. But since we cannot guarantee that, our recommendation is to use this Meta Pixel integration or the Conversions API, not both together.

You should feel free to test including Conversions API integration rules, and monitor your Meta Events for accuracy.

Q: Will the purchase events account for coupons?

A: Yes, any discount from a coupon will be reflected in the order value SamCart sends back to Meta. 

Q: Will any extra revenue from order bumps, upsells, or upgrades be sent back to Meta?

A: Yes again. No matter what combination of products your customers end up purchasing, SamCart will send the correct order value back to Meta. SamCart also includes metadata in the purchase events that include the products' SamCart Order ID. 

Q: Can I use multiple Meta Pixels?

A: Each Marketplace allows for one Meta Pixel to be added. However you could use the Embed Scripts boxes shown above to manually enter Meta Pixels and track events for additional pixels.

Q: How do I verify my domain within Facebook?

A: You may wish to verify your SamCart subdomain inside of the Meta Ads Dashboard. This is an optional step, but follow these directions to make it happen...

First, you need to set up your own SamCart Custom Domain

You now need to verify your domain using Facebook’s DNS Verification process, which will require you to put a TXT file in your DNS settings in your domain registrar. 

This process requires the verification script from Facebook!

Here is how you will want to correctly grab that script:

  1. Navigate to your Meta/Facebook Business Setting's Brand Safety drop-down menu, and click on Domains
  2. Click the Add button and type in your root domain (ex: yourwebsite.com)
  3. Make sure that you have the Update the DNS TXT record with your domain registrar option selected
  4. You can now find the verification script to add this TXT record in your DNS hosting provider

Once you log into your domain registrar, you will need to navigate to the domain you’re trying to verify. Then you will want to:

  1. Go to the screen within your domain registrar where you can manage this domain's DNS records
  2. Add a TXT record
  3. Type the @ symbol into the Name/Host field
  4. Paste the verification script from Facebook (as explained above) into the Answer/Content field (i.e. “facebook-domain-verification=xxxxxxxxxxxxxx”)
  5. Click Save

This record will look something like the following:

After a few minutes, you can go back to Facebook and verify the domain by clicking the green Verify button!

This will allow that domain to appear under Facebook's Web Event Configurations page, enabling you to assign up to 8 Facebook ad conversion events that your ads can be optimized towards.


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.