IMPORTANT: This is your private access link. Bookmark this page in your browser right now so you do not lose it

Part 1: The Foundation - Setting Up Your Core Infrastructure

Copy the code below as seen in 11:14 of part 1 and paste into your site using Code Snippet Plugin.

add_action( ‘woocommerce_checkout_order_created’, function( $order ) {
if ( isset( $_COOKIE[‘_fbp’] ) ) {
$order->update_meta_data( ‘_fbp’, sanitize_text_field( $_COOKIE[‘_fbp’] ) );
}
if ( isset( $_COOKIE[‘_fbc’] ) ) {
$order->update_meta_data( ‘_fbc’, sanitize_text_field( $_COOKIE[‘_fbc’] ) );
}
$order->save();
});

After copying the code, save and visit https://make.com

Part 2: Bringing it all together

Copy the link below edit it, then add your PIXEL_ID and your ACCESS_TOKEN and paste into the URL field on make.com

https://graph.facebook.com/v18.0/YOUR_PIXEL_ID/events?access_token=YOUR _ACCESS_TOKEN

Copy the code below change the event source URL to your thank you page and paste in the body content of make.com

{
“data”: [
{
“event_name”: “Purchase”,
“event_time”: {{formatDate(now; “X”)}},
“action_source”: “website”,
“event_id”: “{{1.id}}”,
“event_source_url”: “THE_LINK_TO YOUR_THANK_YOU_PAGE”,
“user_data”: {
“em”: [
“{{sha256(lower(trim(toString(1.billing.email))))}}”
],
“ph”: [
“{{sha256(replace(toString(1.billing.phone); “/[^0-9]/g”; “”))}}”
],
“fn”: [
“{{sha256(lower(trim(toString(1.billing.firstName))))}}”
],
“ln”: [
“{{sha256(lower(trim(toString(1.billing.lastName))))}}”
],
“external_id”: [
“{{sha256(toString(1.id))}}”
],
“client_ip_address”: “{{1.customerIpAddress}}”,
“client_user_agent”: “{{1.customerUserAgent}}”,
“fbp”: “{{get(map(1.metaData; “value”; “key”; “_fbp”); 1)}}”,
“fbc”: “{{get(map(1.metaData; “value”; “key”; “_fbc”); 1)}}”
},
“custom_data”: {
“currency”: “NGN”,
“value”: {{parseNumber(replace(toString(1.total); “,”; “”))}}
}
}
]
}

Part 3: Wrapping It All Up

Setting Up TikTok Browser Events And Conversion API