Skip to content

Commit

Permalink
feat: update facebook destinations API version to v18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Nov 14, 2023
1 parent a6f7d13 commit db66390
Show file tree
Hide file tree
Showing 14 changed files with 1,310 additions and 1,446 deletions.
2 changes: 1 addition & 1 deletion src/v0/destinations/facebook_pixel/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const responseBuilderSimple = (message, category, destination) => {
} = Config;
const integrationsObj = getIntegrationsObj(message, 'fb_pixel');

const endpoint = `https://graph.facebook.com/v17.0/${pixelId}/events?access_token=${accessToken}`;
const endpoint = `https://graph.facebook.com/v18.0/${pixelId}/events?access_token=${accessToken}`;

const userData = fetchUserData(
message,
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/fb/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function responseBuilderSimple(message, payload, destination) {

// "https://graph.facebook.com/v13.0/644748472345539/activities"

const endpoint = `https://graph.facebook.com/v17.0/${appID}/activities`;
const endpoint = `https://graph.facebook.com/v18.0/${appID}/activities`;

const response = defaultRequestConfig();
response.endpoint = endpoint;
Expand Down
4 changes: 2 additions & 2 deletions src/v0/destinations/fb_custom_audience/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const BASE_URL = 'https://graph.facebook.com/v17.0';
const BASE_URL = 'https://graph.facebook.com/v18.0';

function getEndPoint(audienceId) {
return `${BASE_URL}/${audienceId}/users`;
Expand Down Expand Up @@ -93,7 +93,7 @@ const subTypeFields = [
// const MAX_USER_COUNT = 500; (using from destination definition)
const USER_ADD = 'add';
const USER_DELETE = 'remove';
/* No official Documentation is available for this but using trial
/* No official Documentation is available for this but using trial
and error method we found that 65000 bytes is the maximum payload allowed size but we are 60000 just to be sure batching is done properly
*/
const maxPayloadSize = 60000; // bytes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token',
'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=invalid_access_token',
params: {
destination: 'facebook_pixel',
},
Expand Down Expand Up @@ -90,7 +90,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token',
'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=my_access_token',
params: {
destination: 'facebook_pixel',
},
Expand Down Expand Up @@ -140,7 +140,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token',
'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token',
params: {
destination: 'facebook_pixel',
},
Expand Down Expand Up @@ -210,7 +210,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token',
'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=throttled_valid_access_token',
params: {
destination: 'facebook_pixel',
},
Expand Down Expand Up @@ -275,7 +275,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token',
'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token',
params: {
destination: 'facebook_pixel',
},
Expand Down Expand Up @@ -343,7 +343,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token',
'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=not_found_access_token',
params: {
destination: 'facebook_pixel',
},
Expand Down Expand Up @@ -412,7 +412,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token',
'https://graph.facebook.com/v18.0/1234567891234570/events?access_token=valid_access_token',
},
method: 'POST',
},
Expand Down Expand Up @@ -478,7 +478,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token',
'https://graph.facebook.com/v18.0/1234567891234571/events?access_token=valid_access_token',
},
method: 'POST',
},
Expand Down Expand Up @@ -544,7 +544,7 @@ export const data = [
headers: {},
version: '1',
endpoint:
'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response',
'https://graph.facebook.com/v18.0/1234567891234572/events?access_token=valid_access_token_unhandled_response',
},
method: 'POST',
},
Expand Down
18 changes: 9 additions & 9 deletions test/integrations/destinations/facebook_pixel/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getFormData } from '../../../../src/adapters/network';
export const networkCallsData = [
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=invalid_access_token',
data: getFormData(data[0].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -24,7 +24,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=invalid_timestamp_correct_access_token',
data: getFormData(data[2].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -49,7 +49,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=throttled_valid_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=throttled_valid_access_token',
data: getFormData(data[3].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -69,7 +69,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=invalid_account_id_valid_access_token',
data: getFormData(data[4].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -91,7 +91,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=not_found_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=not_found_access_token',
data: getFormData(data[5].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -112,7 +112,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234570/events?access_token=valid_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234570/events?access_token=valid_access_token',
data: getFormData(data[6].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -133,7 +133,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234571/events?access_token=valid_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234571/events?access_token=valid_access_token',
data: getFormData(data[7].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -154,7 +154,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234572/events?access_token=valid_access_token_unhandled_response',
url: 'https://graph.facebook.com/v18.0/1234567891234572/events?access_token=valid_access_token_unhandled_response',
data: getFormData(data[8].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand All @@ -175,7 +175,7 @@ export const networkCallsData = [
},
{
httpReq: {
url: 'https://graph.facebook.com/v17.0/1234567891234567/events?access_token=my_access_token',
url: 'https://graph.facebook.com/v18.0/1234567891234567/events?access_token=my_access_token',
data: getFormData(data[1].input.request.body.body.FORM).toString(),
params: { destination: 'facebook_pixel' },
headers: { 'User-Agent': 'RudderLabs' },
Expand Down
Loading

0 comments on commit db66390

Please sign in to comment.