Pemirsa Khusus Situs Web

Buat pemirsa khusus pengguna yang berkunjung atau mengambil tindakan tertentu di situs web Anda dengan Meta Pixel, Tanda API JavaScript, dan aturan pemirsa.

Setelah Anda membuat pemirsa khusus dengan data situs web, referensikan pemirsa khusus itu di dalam penargetan iklan Anda sebagaimana yang Anda lakukan dengan pemirsa khusus standar. Facebook secara otomatis memperbarui pemirsa ini berdasarkan kebijakan retensi yang Anda siapkan.

Lihat Pemirsa Khusus, Penargetan, API Tanda Facebook, dan Statistik Meta Pixel untuk informasi selengkapnya.

Conversions API

Jika Anda membagikan peristiwa konversi menggunakan Conversions API, Anda dapat membuat Pemirsa Khusus Situs Web dan menggunakannya untuk iklan. Anda juga dapat membuat Pemirsa Khusus Offline dan Pemirsa Khusus Aplikasi Seluler. Kami rekomendasikan Anda untuk membagikan external_id sebagai parameter informasi pelanggan demi meningkatkan tingkat kecocokan dan memanfaatkan kecocokan di seluruh saluran.

Harap diperhatikan bahwa pemetaan external_id yang dibuat melalui Conversions API berbeda dari yang digunakan dengan extern_id untuk membuat Pemirsa Khusus File Pelanggan. Pemetaan external_id tidak dapat digunakan untuk membuat Pemirsa Khusus File Pelanggan. Demikian juga, extern_id dibuat melalui pemetaan Pemirsa Khusus File Pelanggan tidak dapat digunakan untuk membuat Pemirsa Khusus Web, Pemirsa Khusus Offline, atau Pemirsa Khusus Aplikasi Seluler.

Sebelum Memulai

Untuk membuat Pemirsa Khusus dari Situs Web, Anda harus menerima Ketentuan Layanan untuk Pemirsa Khusus, di Pengelola Iklan.

Buat Pemirsa

Untuk membuat pemirsa khusus situs web, buat permintaan POST ke:

https://graph.facebook.com/v19.0/act_<AD_ACCOUNT_ID>/customaudiences

Gunakan parameter berikut:

Nama Deskripsi

name

jenis: String

Wajib.

Nama pemirsa.

rule

jenis: Objek JSON

Wajib.

Aturan pemirsa berlaku untuk URL perujuk. Lihat Aturan Pemirsa.

retention_days

jenis: Int

Opsional.

Jumlah hari untuk mempertahankan seseorang dalam pemirsa. Antara 1 dan 180 hari.


Jika tidak ditentukan, kita mengambil nilai retention_days dari kolom retention_seconds di dalam aturan.

prefill

jenis: Boolean

Opsional. Default-nya true. Opsi yang tersedia:

  • true: Menyertakan aktivitas situs web yang dicatat sebelum pembuatan pemirsa.
  • false: Hanya menyertakan traffic situs web dari waktu pembuatan pemirsa.

Jika tidak ditentukan, kita mengambil nilai prefill dari kolom retention_seconds di dalam aturan. Isi awal maksimum adalah 180 hari.

Contoh:

curl -X POST \ -F 'name="My Test Website Custom Audience"' \ -F 'rule={ "inclusions": { "operator": "or", "rules": [ { "event_sources": [ { "id": "<PIXEL_ID>", "type": "pixel" } ], "retention_seconds": 8400, "filter": { "operator": "and", "filters": [ { "field": "url", "operator": "i_contains", "value": "shoes" } ] } } ] } }' \ -F 'prefill=1' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/act_<AD_ACCOUNT_ID>/customaudiences
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdAccount = bizSdk.AdAccount; const CustomAudience = bizSdk.CustomAudience; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_ACCOUNT_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { 'name' : 'My Test Website Custom Audience', 'rule' : {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'<pixelID>','type':'pixel'}],'retention_seconds':8400,'filter':{'operator':'and','filters':[{'field':'url','operator':'i_contains','value':'shoes'}]}}]}}, 'prefill' : '1', }; const customaudiences = (new AdAccount(id)).createCustomAudience( fields, params ); logApiCallResult('customaudiences api call complete.', customaudiences);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdAccount; use FacebookAds\Object\CustomAudience; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_ACCOUNT_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'My Test Website Custom Audience', 'rule' => array('inclusions' => array('operator' => 'or','rules' => array(array('event_sources' => array(array('id' => '<pixelID>','type' => 'pixel')),'retention_seconds' => 8400,'filter' => array('operator' => 'and','filters' => array(array('field' => 'url','operator' => 'i_contains','value' => 'shoes'))))))), 'prefill' => '1', ); echo json_encode((new AdAccount($id))->createCustomAudience( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.customaudience import CustomAudience from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'name': 'My Test Website Custom Audience', 'rule': {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'<pixelID>','type':'pixel'}],'retention_seconds':8400,'filter':{'operator':'and','filters':[{'field':'url','operator':'i_contains','value':'shoes'}]}}]}}, 'prefill': '1', } print AdAccount(id).create_custom_audience( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<AD_ACCOUNT_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdAccount(id, context).createCustomAudience() .setName(\"My Test Website Custom Audience\") .setRule(\"{\\"inclusions\\":{\\"operator\\":\\"or\\",\\"rules\\":[{\\"event_sources\\":[{\\"id\\":\\"<pixelID>\\",\\"type\\":\\"pixel\\"}],\\"retention_seconds\\":8400,\\"filter\\":{\\"operator\\":\\"and\\",\\"filters\\":[{\\"field\\":\\"url\\",\\"operator\\":\\"i_contains\\",\\"value\\":\\"shoes\\"}]}}]}}\") .setPrefill(true) .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_account = FacebookAds::AdAccount.get(id) customaudiences = ad_account.customaudiences.create({ name: 'My Test Website Custom Audience', rule: {'inclusions':{'operator':'or','rules':[{'event_sources':[{'id':'<pixelID>','type':'pixel'}],'retention_seconds':8400,'filter':{'operator':'and','filters':[{'field':'url','operator':'i_contains','value':'shoes'}]}}]}}, prefill: '1', })

Contoh tanggapan:

{
  "id": "123567890"
}

Aturan Pemirsa

Pemirsa khusus untuk Pemirsa Khusus Situs Web harus berisi satu aturan pemirsa. Tiap aturan harus diberikan sebagai string berenkode JSON. Lihat Aturan Pemirsa untuk informasi selengkapnya.

Pemirsa Khusus Situs Web Meta Pixel

Gunakan panggilan API berikut untuk membuat Pemirsa Khusus Pixel:

curl -X POST \ -F 'name="My WCA Pixel"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/act_<AD_ACCOUNT_ID>/adspixels
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdAccount = bizSdk.AdAccount; const AdsPixel = bizSdk.AdsPixel; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_ACCOUNT_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { 'name' : 'My WCA Pixel', }; const adspixels = (new AdAccount(id)).createAdsPixel( fields, params ); logApiCallResult('adspixels api call complete.', adspixels);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdAccount; use FacebookAds\Object\AdsPixel; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_ACCOUNT_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'My WCA Pixel', ); echo json_encode((new AdAccount($id))->createAdsPixel( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.adspixel import AdsPixel from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'name': 'My WCA Pixel', } print AdAccount(id).create_ads_pixel( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<AD_ACCOUNT_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdAccount(id, context).createAdsPixel() .setName(\"My WCA Pixel\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_account = FacebookAds::AdAccount.get(id) adspixels = ad_account.adspixels.create({ name: 'My WCA Pixel', })

Panggilan ini memberikan ID Pixel:

{
  "id": "11111"
}

Membaca Kode Pixel Pemirsa Khusus

Ambil kode Pixel Pemirsa Khusus:

curl -X GET \ -d 'fields="code"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/<PIXEL_ID>/
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdsPixel = bizSdk.AdsPixel; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<ADS_PIXEL_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ 'code', ]; params = { }; const sample_code = (new AdsPixel(id)).get( fields, params ); logApiCallResult('sample_code api call complete.', sample_code);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdsPixel; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<ADS_PIXEL_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( 'code', ); $params = array( ); echo json_encode((new AdsPixel($id))->getSelf( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adspixel import AdsPixel from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<ADS_PIXEL_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ 'code', ] params = { } print AdsPixel(id).get( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<ADS_PIXEL_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdsPixel(id, context).get() .requestCodeField() .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<ADS_PIXEL_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ads_pixel = FacebookAds::AdsPixel.get(id ,'code')

Tindakan ini memberikan kode berikut, dengan code berisi kode Pixel Pemirsa Khusus yang relevan:

{
  "data": [
    {
      "code": "<script>(function() {\n  var _fbq = window._fbq || (window._fbq = []);\n  if (!_fbq.loaded) {\n    var fbds = document.createElement('script');\n    fbds.async = true;\n    fbds.src = 'https://connect.facebook.net/en_US/fbds.js';\n    var s = document.getElementsByTagName('script')[0];\n    s.parentNode.insertBefore(fbds, s);\n    _fbq.loaded = true;\n  }\n  _fbq.push(['addPixelId', '11111']);\n})();\nwindow._fbq = window._fbq || [];\nwindow._fbq.push(['track', 'PixelInitialized', {}]);\n</script>\n<noscript><img height=\"1\" width=\"1\" alt=\"\" style=\"display:none\" src=\"https://www.facebook.com/tr?id=11111&amp;amp;ev=NoScript\" /></noscript>", 
      "id": "11111"
    }
  ], 
  "paging": {
    "cursors": {
      "before": "MjM4NzQ5Njk5NjI2Mzc2", 
      "after": "MjM4NzQ5Njk5NjI2Mzc2"
    }
  }
}

Mengelola Pemirsa

Membaca

Untuk membaca pemirsa akun iklan, buatlah permintaan HTTP GET:

https://graph.facebook.com/v19.0/act_<AD_ACCOUNT_ID>/customaudiences

Contoh:

curl -X GET \ -d 'fields="id"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/act_<AD_ACCOUNT_ID>/customaudiences
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdAccount = bizSdk.AdAccount; const CustomAudience = bizSdk.CustomAudience; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_ACCOUNT_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ 'id', ]; params = { }; const customaudiencess = (new AdAccount(id)).getCustomAudiences( fields, params ); logApiCallResult('customaudiencess api call complete.', customaudiencess);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdAccount; use FacebookAds\Object\CustomAudience; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_ACCOUNT_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( 'id', ); $params = array( ); echo json_encode((new AdAccount($id))->getCustomAudiences( $fields, $params )->getResponse()->getContent(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.customaudience import CustomAudience from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ 'id', ] params = { } print AdAccount(id).get_custom_audiences( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<AD_ACCOUNT_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdAccount(id, context).getCustomAudiences() .requestField(\"id\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_account = FacebookAds::AdAccount.get(id) customaudiencess = ad_account.customaudiences({ fields: { 'id' }, })

Contoh tanggapan:

{
  "data": [
    {
      "name": "My Test CA", 
      "id": "1234567890"
    }, 
    {
      "name": "WCA", 
      "id": "0987654321"
    },
  ],
}

Untuk membaca pemirsa khusus tertentu:

curl -X GET \ -d 'fields="name,rule"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/<CUSTOM_AUDIENCE_ID>/
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const CustomAudience = bizSdk.CustomAudience; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<CUSTOM_AUDIENCE_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ 'name', 'rule', ]; params = { }; const sample_code = (new CustomAudience(id)).get( fields, params ); logApiCallResult('sample_code api call complete.', sample_code);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\CustomAudience; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<CUSTOM_AUDIENCE_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( 'name', 'rule', ); $params = array( ); echo json_encode((new CustomAudience($id))->getSelf( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.customaudience import CustomAudience from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<CUSTOM_AUDIENCE_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ 'name', 'rule', ] params = { } print CustomAudience(id).get( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<CUSTOM_AUDIENCE_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new CustomAudience(id, context).get() .requestNameField() .requestRuleField() .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<CUSTOM_AUDIENCE_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end custom_audience = FacebookAds::CustomAudience.get(id ,'name,rule')

Contoh tanggapan:

{
  "name": "My WCA", 
  "rule": "{\"and\": [\n\t\t{\"url\": {\"i_contains\": \"shoes\"}},\n\t\t{\"url\": {\"i_contains\": \"red\"}}]}", 
  "id": "1234567890"
}

Memperbarui

Untuk memperbarui nama pemirsa khusus:

curl -X POST \ -F 'name="Updated Name for CA"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/<CUSTOM_AUDIENCE_ID>/
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const CustomAudience = bizSdk.CustomAudience; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<CUSTOM_AUDIENCE_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { 'name' : 'Updated Name for CA', }; const sample_code = (new CustomAudience(id)).update( fields, params ); logApiCallResult('sample_code api call complete.', sample_code);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\CustomAudience; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<CUSTOM_AUDIENCE_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'Updated Name for CA', ); echo json_encode((new CustomAudience($id))->updateSelf( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.customaudience import CustomAudience from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<CUSTOM_AUDIENCE_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'name': 'Updated Name for CA', } print CustomAudience(id).update( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<CUSTOM_AUDIENCE_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new CustomAudience(id, context).update() .setName(\"Updated Name for CA\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<CUSTOM_AUDIENCE_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end custom_audience = FacebookAds::CustomAudience.get(id) custom_audience.name = 'Updated Name for CA' custom_audience.save

Contoh Tanggapan:

{
  "success": true
}

Menghapus

Hapus pemirsa menurut id:

curl -X DELETE \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/<CUSTOM_AUDIENCE_ID>/
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const CustomAudience = bizSdk.CustomAudience; const AbstractObject = bizSdk.AbstractObject; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<CUSTOM_AUDIENCE_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { }; const sample_code = (new CustomAudience(id)).delete( fields, params ); logApiCallResult('sample_code api call complete.', sample_code);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\CustomAudience; use FacebookAds\Object\AbstractObject; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<CUSTOM_AUDIENCE_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( ); echo json_encode((new CustomAudience($id))->deleteSelf( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.customaudience import CustomAudience from facebook_business.adobjects.abstractobject import AbstractObject from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<CUSTOM_AUDIENCE_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { } print CustomAudience(id).delete( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<CUSTOM_AUDIENCE_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new CustomAudience(id, context).delete() .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<CUSTOM_AUDIENCE_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end custom_audience = FacebookAds::CustomAudience.get(id) custom_audience.destroy({ })

Contoh Tanggapan:

{
  "success": true
}

Pemirsa Khusus Situs Web Canggih

Produk ini telah dihentikan. Lihat EPemirsa Khusus Situs Web Canggih.

Tanggal Dinamis (beta)

Dengan fitur ini, pengiklan perjalanan/wisata dapat menargetkan kepada pengguna yang mencari hotel dan penerbangan berdasarkan tanggal singgah pengguna tersebut. Sebagai contoh, pengiklan dapat membuat pemirsa yang hanya menargetkan pada pengguna dengan tanggal singgah di waktu mendatang.

Pengiklan perjalanan dan wisata harus memberikan tanggal singgah yang dimaksud di kolom checkin_date untuk pengaktifan Pixel:

fbq('track', 'Search', {'checkin_date': '2015-09-15', 'num_of_travelers':2});  

Format Waktu yang Didukung

Saat ini, hanya format waktu ISO-8601 yang didukung. Contoh:

  • YYYYMMDD (mis. 20080921)
  • YYYY-MM-DD (mis. 1997-07-16)
  • YYYY-MM-DDThh:mmTZD (mis. 1997-07-16T19:20+0100)
  • YYYY-MM-DDThh:mm:ssTZD (mis. 1997-07-16T19:20:30+0100)

Di mana:

  • YYYY adalah tahun dalam empat digit
  • MM adalah bulan dalam dua digit (01=Januari, dst.)
  • DD adalah tanggal dalam dua digit (01 sampai 31)
  • hh adalah jam dalam dua digit (00 sampai 23) (am/pm TIDAK diizinkan)
  • mm adalah menit dalam dua digit (00 sampai 59)
  • ss adalah detik dalam dua digit (00 sampai 59)
  • TZD adalah penanda zona waktu (+jjmm atau -jjmm)

Contoh

Pengguna yang mencari hotel dengan start_date setelah hari ini dalam 30 hari terakhir:

curl 
-F "name=search_hotel_later_than_today" 
-F "pixel_id=PIXEL_ID"  
-F "retention_days=30" 
-F 'rule={"event": {"i_contains": "search"}}' 
-F 'rule_aggregation={"type":"last_event_time_field", "config":{"field":"checkin_date", "time_format":"YYYY-MM-DD"}, "operator":"@&amp;lt;", "value": "0"}' 
-F "access_token=ACCESS_TOKEN" 
"https://graph.facebook.com/API_VERSION/act_AD_ACCOUNT_ID/customaudiences"

Praktik Terbaik

  • Eksperimen dengan pengukuran potensial nilai yang berbeda, contoh: orang yang sering mengunjungi situs tetapi belum membeli atau orang yang mengunjungi situs dengan beberapa perangkat.
  • Buat Pemirsa Serupa berdasarkan pemirsa khusus dengan kinerja terbaik.

Pertanyaan Umum

With Custom Audiences, you can reach people who recently visited your website and deliver them highly relevant ads based on interest they express in your products.

Other benefits include:

  • Remarket to people using your website
  • Make your existing ads more efficient by excluding audiences of people who have already converted on your message
  • Create lookalike audiences of people who look like the people browsing your website

By tracking how each customer progresses in a process, you can more effectively influence customers who expressed interest in your products. For example, using Meta Pixel, capture intent based on activity of people who are viewing pages about a loyalty program, browsing a particular product page, or filling out a preferences form. Later, you can serve relevant ads to these people to help them complete the conversion.

See Advertiser Help Center, Custom Audience from your Website. When you add or remove people, updates can take a few hours. But your ads continue to run.

At this time, there's a maximum of 10000 Custom Audiences from your website that can be created in a single account.

Yes. Exclusion targeting prevents a particular audience from seeing your ad to help deliver your advertising more precisely. For example, exclude an audience of your current customers if you run a campaign to acquire new customers.

In Ads Manager, in the audience section of creating an ad, click Exclude and add the custom audience to the list.

The longest duration can be set for 365 days. After 365 days, audience members are removed, unless they revisit the website again and match the same audience rule.

Yes. Open Ad Manager. Under the Audiences tab, click the New Audience drop-down menu and select Lookalikes.

Dating can use Custom Audiences from your website. However, gambling websites must be approved through the sales team on a managed list, and you must provide demographic restrictions, such as 21 years+.

We recommend CPM bidding for Website Custom Audience until your audience has reached a sufficiently large size. Start with CPM, then migrate to oCPM or CPC once you reach sufficient scale.

Yes, Custom Audiences from your website works with all native ad formats and serves across desktop, mobile, and tablet.

FBX and Website Custom Audiences are complementary products. FBX is best when advertisers require product-level dynamic ads, which are as current as possible and are not yet easily facilitated by Custom Audiences from your website. However, FBX is limited to desktop inventory. Custom Audiences from your website allows targeting across browsers, overlaying of Meta data, access to mobile inventory, and usage of all Meta ad units—all of which are not available on FBX.

Custom Audiences from Your Website requests a duration where customers will be retained within the audience created. The duration is based on when customers visited a website and fired the Meta Pixel. For example, with a retention window of 30 days, if someone visits a website and matches an Audience rule on June 1st, Facebook automatically removes them from the Website Custom Audience on June 30.

You can create rules based on URLs visited or on custom events from Meta Pixel. Using custom data, create audiences based upon SKUs, Pricing, Color, or any other attribute you send to Facebook. See Meta Pixel.

No personal information is reported to the advertiser about any individual person on a website. You can only target an audience once it reaches a certain size; it's impossible to learn the individual identity an any person visiting a website.

Meta also provides an AdChoices link where people can learn more and opt out of targeted ads they receive. Click the “x” in the top-right corner of ads to show more options:

  • Hide this ad — Don't see this ad again (Facebook native). This is specific to the ad ID in the campaign only.
  • Hide all ads — Don't see any other ads from that advertiser (Facebook native). Hide any ads from either that subdomain, such as savings.att.com or att.com, or the page facebook.com/ATT if we have it. Block the sub-domain or page across ad accounts.
  • Why Am I seeing this Ad?

View Tags are not yet permitted for Custom Audiences from your website clients. Only Atlas view tag are accepted at this time.

If an Active campaign targets a Website Custom Audience and that audience is deleted, the campaign is put on Pause.

We update an audience as soon as technically possible. Once customers go to webpages with a Meta Pixel and match an Audience rule, they're added to that Website Custom Audience. If this Website Custom Audience is being targeted with an ad, the customer is eligible to be served an ad in a matter of minutes.

No. There's one Meta Pixel generated per account. Add this Meta Pixel to all pages of your website one at a time, and use Audience rules to create different Website Custom Audiences.

Yes. You can use data from third-party tags, Tag Managers, or a DFA Floodlight tag. This depends on the sophistication of the third-party client. Simple rules are easy to implement, but if you pass dynamic variables through the JavaScript event, your third-party tag should receive them and pass them to the Meta Pixel via Custom Data fields.

The full JavaScript version has the following advantages over the IMG-only pixel:

  • It's cross-browser and cross-platform.
  • It's fast and loads asynchronously so it doesn't block the page load.
  • Built-in cache buster increases effectiveness.
  • You can send custom data with large payloads using HTTP POST.
  • It captures the original page URL when the pixel is placed in a tag container.

A pixel ID is an identifier of the piece of code placed on an advertiser's website. There's one pixel ID per Meta Ad account.

In your rules, refer to event names under the parameter 'event'. For rules based on custom data, refer to it the same way you do for referring URLs, under the parameter 'url'. For example, to matches all visitors:

  • to URLs containing 'signup', or
  • associated with event 'SignUp' by fbq.push(['track', 'SignUp']);
"filter": {
    "operator": "or",
    "filters": [
        {
            "field": "url",
            "operator": "i_contains",
            "value": "signup"
        }
        {
            "field": "event",
            "operator": "i_contains",
            "value": "SignUp"
        }
    ]
}

The following rule matches all visitors who have viewed any product in the TV category by fbq.push(['track', 'ViewProduct', {category: 'TV'}]);.

"filter": {
    "operator": "or",
    "filters": [
        {
            "field": "event",
            "operator": "i_contains",
            "value": "ViewProduct"
        }
        {
            "field": "category",
            "operator": "i_contains",
            "value": "TV"
        }
    ]
},

The above examples shows how to track remarketing events. Use the same way to track conversion events by replacing eventName with conversion ID. This ID is created during the regular conversion creation flow (https://www.facebook.com/ads/manage/convtrack.php).

window.fbq = window.fbq || [];
fbq.push(['track', 123456, {currency: 'USD', value: 30.00}]);

Ideally, you don't need to know whether a fired event is a conversion event or a remarketing event. You only need the conversion ID to fire a conversion event. For example, if the old conversion pixel is:

var fb_param = {};
fb_param.pixel_id = '1234567890';
fb_param.value = '5.00';
fb_param.currency = 'USD';
(elided other code)

Then, using the new pixel, it is the following:

window.fbq = window.fbq || [];
fbq.push(['track', 1234567890, {currency: 'USD', value: 5.00}]);

The old conversion pixel allowed either a conversion pixel or a remarketing pixel on a page. Meta Pixel allows multiple pixel firings, including multiple conversion events, multiple remarketing events, or both per page.

Manually insert an IMG tag:

<img height="1" width="1" border="0" alt="" style="display:none"
  src="https://www.facebook.com/tr?id=pixel_ID/ad_account_id&amp;ev=event name&amp;cd[p1]=v1&amp;cd[p2]=v2..." />

Custom data is represented as key-value pairs. Each parameter is inside 'cd[...]'. For example:

<img height="1" width="1" border="0" alt="" style="display:none"
  src="https://www.facebook.com/tr?id=1234&amp;ev=ViewProduct
       &amp;cd[category]=TV" />

Is equivalent to the following JS call:

window.fbq = window.fbq || [];
fbq.push(['track', 'ViewProduct', {category: 'TV'}]);

Use parameter 'ev' to specify conversion ID, parameter 'cd[value]' to specify value, and parameter 'cd[currency]' to specify currency:

<img height="1" width="1" border="0" alt="" style="display:none"
  src="https://www.facebook.com/tr?id=1234&amp;ev=1234567890
       &amp;cd[value]=5.00&amp;cd[currency]=USD" />

Meta Pixel code tries to fire events using JavaScript first. If JavaScript isn't available, Meta Pixel code tries to use image pixel. However it's recommended to always use the JavaScript pixel:

  • Can be fired multiple times on each page load.
  • Can control when an event should be fired such as on a button click.
  • Not subject to HTTP GET limit in sending custom data.