Posts tagged with salesforce

I integrated meta pixel (server side) on my storefront (B2B commerce), 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'             });         }              //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);             String requestBodyJson = JSON.serialize(requestBody);             httpRequest.setBody(requestBodyJson);             Http http = new Http();             HttpResponse httpResponse = http.send(httpRequest); 

Here is my configuration and result presented in the meta.

  • List item