WooCommerce

WP Facebook Pixel + WooCommerce

WP Facebook Pixel automatically sends Facebook Pixel events based on your users WooCommerce actions. Below is a breakdown of each action, the event triggered and the data included in the event.

Product Page

View content

When a user reaches a specific product’s page, a ViewContent event is sent immediately to Facebook.

Event Data

content_type: Constant value of “product” (defined by FaceBook)
content_ids: Either the PostID or Product SKU based on the settings defined here
value: The current price associated with the product.  If the product is on sale, the sale price will be used.
currency: Currency set in the WooCommerce settings

Add to cart

Clicking the “Add to Cart” button on the product page will trigger the related Facebook Pixel event.

Event Data

content_type: Constant value of “product” (defined by FaceBook)
content_ids: Either the PostID or Product SKU based on the settings defined here
value: The current price associated with the product.  If the product is on sale, the sale price will be used.
currency: Currency set in the WooCommerce settings

Shop

Add to cart

Clicking the “Add to Cart” button for any product in the shop page will trigger the AddToCart Facebook Pixel event.  This event is triggered before WooCommerce’s AJAX Add to Cart operation, so it even works if the user is redirected to the cart after adding a product.

Event Data

content_type: Constant value of “product” (defined by FaceBook)
content_ids: Either the selected product’s PostID or Product SKU based on the settings defined here
value: The current price associated with the product.  If the product is on sale, the sale price will be used.
currency: Currency set in the WooCommerce settings

Order Received

Purchase

After the user has completed their purchase, they are redirected to the Thank You page, or what WooCommerce calls its Order Received endpoint.  You can see details about this setting in WooCommerce’s documentation here.  Once this page is loaded, the Purchase Facebook Pixel event is triggered automatically.

Event Data

content_type: Constant value of “product” (defined by FaceBook)
content_ids: An array of all cart items’ Product Identifiers, which are either the products’ PostIDs or Product SKUs based on the settings defined here
value: The total cost of the purchase including all items in the cart, shipping and taxes minus any discounts applied.
currency: Currency set in the WooCommerce settings
num_items: Total number of items purchased. If the user purchases 3 of product A and 2 of product B, there are 5 items in the cart.

Leave a Reply