Currently, I am using a third party app.
Looking to make it directly in Wix
You will need to read about how to access 3rd party services in the article Corvid: How to Access 3rd-Party Services with the Fetch API .
A nice simple example to start with is Create a Weather Widget . Also, t ake a look at the Advanced examples , many of them access 3rd party services. A couple of good examples to start with are: Example: Using the Places API from Google Maps services and Example: Send email with the SendGrid REST interface .
Thank you very much! Checking it out
Unfortunately, I am a marketer, not a high-end developer
I tried to understand but without success.
Soon it will be mandatory with Facebook, and we all want to be ready for it.
It will be more than appreciated if you can help us to do it.
From Facebook:
https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api
Send requests
To send new events, make a POST request to this API’s /events edge from this path: https://graph.facebook.com/{API_VERSION}/{PIXEL_ID}/events?access_token={TOKEN}. When you post to this edge, Facebook creates new server events.
cURL
curl -X POST \
-F 'data=[
{
"event_name": "PageView",
"event_time": 1600862498,
"user_data": {
"fbc": "fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
"fbp": "fb.1.1558571054389.1098115397",
"em": "309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd"
}
}
]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v8.0/<PIXEL_ID>/events
Node.js
'use strict';
const bizSdk = require('facebook-nodejs-business-sdk');
const ServerEvent = bizSdk.ServerEvent;
const EventRequest = bizSdk.EventRequest;
const UserData = bizSdk.UserData;
const CustomData = bizSdk.CustomData;
const Content = bizSdk.Content;
const access_token = '<ACCESS_TOKEN>';
const pixel_id = '<ADS_PIXEL_ID>';
const api = bizSdk.FacebookAdsApi.init(access_token);
let current_timestamp = Math.floor(new Date() / 1000);
const userData = (new UserData())
.setEmail('joe@eg.com')
.setFbp('fb.1.1558571054389.1098115397')
.setFbc('fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890');
const customData = (new CustomData())
.setCurrency('usd')
.setValue(123.45);
const serverEvent = (new ServerEvent())
.setEventName('Purchase')
.setEventTime(current_timestamp)
.setUserData(userData)
.setCustomData(customData);
const eventsData = [serverEvent];
const eventRequest = (new EventRequest(access_token, pixel_id))
.setEvents(eventsData);
eventRequest.execute();
Java
import com.facebook.ads.sdk.APIContext;
import com.facebook.ads.sdk.APIException;
import com.facebook.ads.sdk.serverside.Event;
import com.facebook.ads.sdk.serverside.EventRequest;
import com.facebook.ads.sdk.serverside.EventResponse;
import com.facebook.ads.sdk.serverside.UserData;
import com.facebook.ads.sdk.serverside.CustomData;
public class ServerSideApiExample {
public static final String ACCESS_TOKEN = "<ACCESS_TOKEN>";
public static final String PIXEL_ID = "<ADS_PIXEL_ID>";
public static void main(String[] args) {
APIContext context = new APIContext(ACCESS_TOKEN).enableDebug(true);
context.setLogger(System.out);
UserData userData = new UserData()
.fbc("fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890")
.fbp("fb.1.1558571054389.1098115397")
.email("joe@eg.com");
CustomData customData = new CustomData()
.currency("usd")
.value(123.45F);
Event pageViewEvent = new Event();
pageViewEvent.eventName("Purchase")
.eventTime(System.currentTimeMillis() / 1000L)
.userData(userData)
.customData(customData);
EventRequest eventRequest = new EventRequest(PIXEL_ID, context);
eventRequest.addDataItem(pageViewEvent);
try {
EventResponse response = eventRequest.execute();
System.out.println(String.format("Standard API response : %s ", response));
} catch (APIException e) {
e.printStackTrace();
}
}
}
An example request body looks like this:
{
"data": [
{
"event_name": "Purchase",
"event_time": 1600865478,
"event_id": "event.id.123",
"event_source_url": "http:\/\/jaspers-market.com\/product\/123",
"user_data": {
"client_ip_address": "192.19.9.9",
"client_user_agent": "test ua",
"em": "309a0a5c3e211326ae75ca18196d301a9bdbd1a882a4d2569511033da23f0abd",
"fbc": "fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890",
"fbp": "fb.1.1558571054389.1098115397"
},
"custom_data": {
"value": 100.2,
"currency": "USD",
"content_ids": [
"product.id.123"
],
"content_type": "product"
},
"opt_out": false
},
{
"event_name": "Purchase",
"event_time": 1600865478,
"user_data": {
"client_ip_address": "192.88.9.9",
"client_user_agent": "test ua2"
},
"custom_data": {
"value": 50.5,
"currency": "USD"
},
"opt_out": true
}
]
}
@ivan-terechin Check out the Wix Marketplace - it’s a place where you can look for Corvid experts for hire.
Hi Ivan - did you ever find a way to do the Conversions API with Wix?
Hi dear do you have find the way for use Facebook API Conversion in WIX ?
Waiting for a easier solution from Wix.
I am surprised wix are expecting us to become software engineers out of the blue
Hi all,
My name is Danny, I am from Wix Promote. We have implemented a proper Facebook onboarding that includes CAPI (Conversion API, based on server side reporting). This feature is being gradually rolled out now.
Go to the Marketing integrations at your Wix dashboard and see if you have a placeholder as shown on the screenshot. That means you are connected and can proceed with the onboarding.
If you do not have it, and you need it now, please let me know and I will connect your site manually.
Note that at the moment there is a small group of sites that cannot use this feature.
Kind regards,
Danny
Hi,
First of all, thank you very much!!!
Since the ios 14 update, my sales dropped.
I checked it but didn’t find the CAPI.
Can you please add my site?
I would like to do it privately
Thank you very much!
@ivan-terechin just to clarify… CAPI will not solve the iOS14 restrictions, and this is totally on the Facebook side. We send all events, CAPI and browser and they select what to display and use based on the users’ consent.
Ivan, can you provide me with your site url, please?
@ivan-terechin thanks, you can try now
please let me know how did it go
@danny Thanks, will keep you update
@danny It was much much easier than I thought!!! You guys are amazing!!!
Thanks!
@Danny Stienhoff
Hi Danny i dont find it in the marketing integration dashboard.
I urgently need it now, can you please help
Thanks,
@kkhaloufi sure, please share your site url
@danny www. rahassia .com
@kkhaloufi good to go
please check