Skip to main content

Anyone who’s attempted to set up Facebook Conversions API on SamCart will have realised it’s not an easy task. Using Google Tag Manager with Samcart isn’t quite enough to pass all-important conversion and user data back to Facebook. You need to get fairly technical to strengthen the signals sent to Facebook.

Samcart is a great e-commerce platform that makes it very easy for brands to sell digital products, courses, webinars, etc. and create cross-sell and upsell promotions to increase revenue. That ease of use, however, comes with limitations that make it very difficult to implement CAPI and maximise the benefit of server side tracking.

Google Tag Manager (GTM) makes it comparatively simple to set up CAPI using web and server containers. If you haven’t done this part already, follow our guide to set up conversions API with GTM. Once you’ve set up the basic framework on GTM, you need to ensure SamCart sends info back to GTM about the products purchased and any user data you wish to share with Facebook to improve match rates.

Here’s what you need to do on Samcart:

  1. Login on your SamCart platform
  2. Navigate to each product you want to set up with CAPI > Advanced Settings and enter code in the first three fields as follows:
    • Embed HTML/Scripts in Header
      You should copy and paste the Google Tag Manager base code here
    • Embed HTML/Scripts in Footer
      You should copy and paste the Google Tag Manager “noscript” code, which is meant to go within the HTML <body>, here
    • Fire pixels/scripts after an order is completed
      If you use the SamCart default order confirmation screen, you should add JavaScript code here to detect the order info and pass it to a data layer.
      Important note: this data might get blocked by iOS 14.5+ users, since it comes from an unverified ( domain, and you might not track most of those conversions
  3. A better alternative, to ensure you track every single conversion on SamCart is to redirect customers to a custom ‘thank you’ page that sits on your verified domain
    • In this case, you’d implement step 2 as described above, but in the final part, instead of pushing the order and user data to a data layer, you need to pass it to your custom ‘thank you’ page
    • Important note: Any user data you pass to your domain must be hashed beforehand, or Facebook will give you a warning and may eventually disable your ads for exposing personally identifiable user info.
    • Set GTM variables for the order info – content IDs, value, currency, and user data – to get pulled from the data layer or via custom JS or even from URL variables
  4. Repeat this for every product you sell via SamCart

Your server events should automatically pick the currency, product ID, and user info such as name, surname, and email address. When done correctly, this would look like the screenshot below.

Facebook CAPI server event

Get expert support to implement CAPI on SamCart

Getting this right with SamCart isn’t simple. Their system is not made for such integrations. We’ve implemented comprehensive server-side tracking with order info and user data sent correctly to CAPI, with custom ‘thank you’ pages for our clients, and can help you implement this on your site.

Contact us to setup SamCart CAPI 

It’s worth noting that Google have recently released their own server tracking capability as well as ‘Enhanced Conversions’ for better tracking. So, if Google ads are an important source of business for you, it’s recommended to implement that at the same time.