Ads conversion
Ads conversion analysis allows you to evaluate the return on your commercial campaigns. Checkout Pro offers integration with Facebook Ads and Google Ads, allowing you to associate payments with your campaigns.
Facebook Ads
To associate an order with a Facebook Ads pixel, include the config.online.tracks parameter with the type facebook_ad and the corresponding pixel_id when sending the request to the Create orderAPI endpoint.
curl
curl -X POST \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ -H 'X-Idempotency-Key: UNIQUE_KEY' \ 'https://api.mercadopago.com/v1/orders' \ -d '{ "type": "online", "processing_mode": "manual", "total_amount": "1000.00", "external_reference": "order_pro_123", "payer": { "email": "buyer@email.com" }, "items": [ { "title": "My product", "unit_price": "1000.00", "quantity": 1, "unit_measure": "unit", "total_amount": "1000.00" } ], "config": { "online": { "tracks": [ { "type": "facebook_ad", "values": { "pixel_id": "PIXEL_ID" } } ] } } }'
Once the configuration is complete, a purchase event will be associated with the specified pixel when a payment originated by your ad is approved.
Google Ads
To associate an order with a Google Ads tag, include the config.online.tracks parameter with the type google_ad and the conversion_id and conversion_label values available in your Google account when sending the request to the Create orderAPI endpoint.
curl
curl -X POST \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ENV_ACCESS_TOKEN' \ -H 'X-Idempotency-Key: UNIQUE_KEY' \ 'https://api.mercadopago.com/v1/orders' \ -d '{ "type": "online", "processing_mode": "manual", "total_amount": "1000.00", "external_reference": "order_pro_123", "payer": { "email": "buyer@email.com" }, "items": [ { "title": "My product", "unit_price": "1000.00", "quantity": 1, "unit_measure": "unit", "total_amount": "1000.00" } ], "config": { "online": { "tracks": [ { "type": "google_ad", "values": { "conversion_id": "CONVERSION_ID", "conversion_label": "CONVERSION_LABEL" } } ] } } }'
Once the configuration is complete, a conversion will be associated with the specified tag when a payment originated by your ad is approved.
