Hi all,
we integrated meta pixel (server side) on our storefront, the connection is established correctly, but seems like meta is not accepting (understanding) the passed parameters of each callout.
I managed to set up code integration with meta, I'm receiving the events, but not sure why I don't see the sent parameters inside the meta configurator. I've set all the matching and also added all the fields I'm sending, getting no error, but Meta still doesn't see the params. For example, the View content is empty, I can only see something for the addToCart call. What is more strange is for testing events everything looks good. When I add the test Code for the callout, the test events are displayed correctly, with all the data.
Sample code, I'm using
https://graph.facebook.com/v19.0/pixelCode/events?access_token=TOKEN
Map<String, Object> event = new Map<String, Object>();
event.put('event_name', type);
event.put('action_source', 'website');
event.put('event_time', unixTimestamp);
event.put('user_data', new Map<String, Object>{
'em' => new List<String>{ hashedEmail }
});
event.put('event_source_url', 'myurl.com');
if (type == 'ViewContent' || type == 'AddToCart') {
event.put('custom_data', new Map<String, Object>{
'content_category' => product.Family,
'content_name' => product.Name,
'content_ids' => new List<String>{ product.Id },
'content_type' => 'product'
});
} else if (type == 'CompleteRegistration') {
event.put('custom_data', new Map<String, Object>{
'content_category' => product.Family,
'content_name' => product.Name,
'content_ids' => new List<String>{ product.Id },
'content_type' => 'product'
});
} else if (type == 'Purchase') {
event.put('custom_data', new Map<String, Object>{
'currency' => 'EUR',
'value' => orderTotal
});
}
//Prepare the request body
List<Map<String, Object>> events = new List<Map<String, Object>>();
events.add(event);
Map<String, Object> requestBody = new Map<String, Object>();
requestBody.put('data', events);
// Convert the request body to JSON
String requestBodyJson = JSON.serialize(requestBody);
httpRequest.setBody(requestBodyJson);
Http http = new Http();
HttpResponse httpResponse = http.send(httpRequest);
I also posted a screenshot, where it's visible that the connection is working fine, but even from the event match quality, you can see that my parameters are not matched correctly. What am I doing wrong? I guess it must be somehow related to the meta configuration.
👋 Hello Thomas, As you may know, there are lots of ways to setup Facebook Pixel and Conversion API Tracking on the website 1. Manually code 2. Partner Integration 3. PixelYourSite 4. Woocommerce Plugin 5. Meta and Instagram app 6. Google Tag Manager
The most popular event-tracking tool here is Google Tag Manager. If you want to send accurate data to your advertising platform or analytics platform. Also If you want to optimize your ad then Google Tag Manager is the best.
However, if you want to setup pixels properly and increase product sales by retargeting and remarketing through accurate data or generate loyal customers. Then definitely follow facebook requirement and setup facebook pixel and conversion API. Facebook pixel Requerment 👉 https://www.facebook.com/business/help/1021909254506499
Facebook Conversion API Tracking 👉 https://developers.facebook.com/docs/marketing-api/conversions-api/guides/gtm-server-side/
What is your CMS?
Hi, thanks a lot for the answer. We're using a storefront built on the Salesforce platform. As mentioned above, the connection is established correctly, since I can see all the events that I'm sending. The missing part is the parameters inside the calls. You can see the attached images in the original question, showing that the parameters are not recognized by meta-pixel.
Is there maybe some support that could provide us some help with setting up the pixel configuration within the portal? Or maybe there is some working example that I can fire in postman to validate that our setup in not working as expected?