by Marketing Supply Co. Team | July 8th, 2019
Facebook is still the most-used social media platform on the planet. But, keep in mind that Facebook is much more than a social platform; it’s a vast tool that uses a plethora of different variables to optimize social media advertising campaigns—specifically dynamic e-commerce tracking.
Despite its importance, dynamic e-commerce tracking in Facebook ads is tragically under-utilized. So, today, we’re going to explain why it’s so vital to every e-commerce Facebook campaign, and how you can jumpstart implementation.
Facebook’s elaborate targeting and e-commerce tracking capabilities allow social advertisers to peer inside the minds of our customers in a far more intimate way than traditional advertising could ever do. Why not take advantage of that?
That said, let me reiterate: setting up dynamic e-commerce tracking is essential to great Facebook campaigns. The more data that Facebook has, the better the optimization. And how does Facebook do that?
Simple: by adding snippets of code to virtually every action on your website—from CTAs to page views. Pulling those events into Facebook lets Facebook optimize ad delivery to people more likely to complete the action (e.g. visit your website, purchase a product, etc.).
Disclaimer: This article is assuming you have already installed your Facebook pixel on your website to fire off on page loads.
Event codes are snippets that are attached to actions on your website. The placement of your event code depends on what type of action is taking place: when a page is viewed or when an action occurs.
Your Facebook Pixel will take care of page load tracking in the header of your website. However, the more complicated, but more valuable method of tracking, is tracking event actions on your site.
This event is shot off when an inline action occurs. So for example, let’s say a customer clicks a “Submit Order” button in their shopping cart. In this instance, you would add the following code to the HTML element on the site (the button):
<!– The below method uses jQuery, but that is not required –>
<button id=”addToCartButton”>Add To Cart</button>
<!– Add event to the button’s click handler –>
<script type=”text/javascript”>
$( ‘#addToCartButton’ ).click(function() {
fbq(‘track’, ‘AddToCart’, {
content_ids: [‘xxxx’],
content_type: ‘product’,
value: x.xx,
currency: ‘USD’
});
});
</script>
Note: Do not insert the event code inside the <head> tags.
Dynamic conversion values are what you need to get sales from ads into your Facebook ads account. You need to dynamically pass the value of a purchase in place of the actual dollar amount. For context, just refer to the “value: x.xx” section of the event in the example above.
The variable of value associated with purchases varies depending on which e-commerce platform you’re on and how you (or your developer) set it up.
Here are examples of common e-commerce platform values:
‘{{ total_price | money_without_currency }}’,’currency’:’USD’
<?php echo $order->get_order_total(); ?>
%%ORDER_SUBTOTAL%%;
<?php echo $amount; ?>
{orderGrandTotal}
The view content event code should be inserted into any product pages to track when users hit them. Product details should be added to dynamically target people who have viewed product pages and optimize ad delivery to drive conversions (purchases).
<script>
fbq(‘track’, ‘ViewContent’, {
content_ids: [‘xxxx’],
content_type: ‘product’,
value: x.xx,
currency: ‘USD’
});
</script>
This event does what it says: tracks when someone adds an item to their shopping cart. Tracking this event allows you to see who fell off through your purchase funnel, and retarget them with ads to drive them to convert (purchase).
<script>
fbq(‘track’, ‘AddToCart’, {
content_ids: [‘xxxx’, ‘xxxx’, ‘xxxx’],
content_type: ‘product’,
value: x.xx,
currency: ‘USD’
});
</script>
The “initiate checkout” event should be triggered when a person first enters the checkout process. This can be used to track the people who started the checkout process but didn’t actually complete it.
<script>
fbq(‘track’, ‘InitiateCheckout’);
</script>
The add payment event should be fired off when a person adds payment information to an account or in the checkout process.
<script>
fbq(‘track’, ‘AddPaymentInfo’);
</script>
Finally, end of the line–the holy grail of Facebook events. The purchase event is fired off when the order is completed. This is generally added to the “Checkout” button. When a user clicks that button Facebook gets alerted that the purchase has occurred. This is also the most important event to make sure you have dynamic values added to so you can track sales attributed to your ads
When a user clicks that button, Facebook gets alerted that the purchase has occurred. This is also the most important event to make sure you have dynamic values added to so you can track sales attributed to your ads
The purchase event is fired off when the purchase is completed. This is generally added to the “Checkout” button, so when a user clicks that button, Facebook gets an alert that the purchase occurred. This is also the most important event to make sure you have dynamic values.
added to so you can track sales attributed to your ads.
<script>
fbq(‘track’, ‘Purchase’, {
content_ids: [‘xxxx’, ‘xxxx’, ‘xxxxx’],
content_type: ‘product’,
value: xxx.xx,
currency: ‘USD’
});
</script>
While getting these events setup is somewhat of an overhaul, this is crucial to getting optimal Facebook Ads campaigns and a great asset to keep reporting on ad performance from driving you insane. Do yourself a favor and get those pesky snippets added to your site.
Or, make your life easier and reach out to Marketing Supply so we can set up your tracking, analytics, or even run your social advertising campaigns.
Photo by Kon Karampelas on Unsplash