Marketing API-Version

Anzeigenvorschau

Zeige eine Vorschau bestehender oder geplanter Werbeanzeigen an. Die erstellte Vorschau basiert auf dem Inhalt deiner Werbeanzeige. Für die Anzeigenvorschau gibst du einen Nutzer-Zugriffsschlüssel und keinen Seiten-Zugriffsschlüssel an. Erstelle beispielsweise eine Vorschau einer bestehenden Werbeanzeige:

curl -X GET \ -d 'ad_format="DESKTOP_FEED_STANDARD"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v27.0/<CREATIVE_ID>/previews

Du kannst auch eine Vorschau mit einer Gestaltungsspezifikation für eine Domain Ad für eine externe Webseite erstellen:

curl -X GET \ -d 'creative="<CREATIVE_SPEC>"' \ -d 'ad_format="<AD_FORMAT>"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v27.0/act_<AD_ACCOUNT_ID>/generatepreviews

Vorschau erstellen

Es gibt mehrere Möglichkeiten, eine Vorschau zu erstellen:

Um eine Anzeigen-ID für eine bestehende Werbeanzeige zu nutzen, verwende previews der Anzeige.

https://graph.facebook.com/<API_VERSION>/<AD_ID>/previews

Um die ID einer bestehenden Anzeigengestaltung zu nutzen, verwende previews der Anzeigengestaltung.

https://graph.facebook.com/<API_VERSION>/<AD_CREATIVE_ID>/previews

Für die Verwendung einer Anzeigengestaltungsspezifikation stehen dir zwei Endpunkt-Optionen zur Verfügung:

Übergib für Advantage+ Catalog Ads die gesamte object_story_spec an den /generatepreviews-Endpunkt und verwende auch product_item_ids wie in Advantage+ Catalog Ads, Vorschau beschrieben.

Eine Vorschau aus einem Werbekonto ist nur für Personen sichtbar, die eine Rolle für das Werbekonto innehaben. Mit der generatepreviews-Edge erstellte Vorschauansichten sind für alle sichtbar.

https://graph.facebook.com/API_VERSION>/act_<AD_ACCOUNT_ID>/generatepreviews
https://graph.facebook.com/API_VERSION>/generatepreviews

Alle der vier oben genannten Endpunkte geben ein Anzeigenvorschauobjekt zurück.

Beispiele

Erstelle eine Vorschau mit object_story_spec:

curl -G \ --data-urlencode 'creative={ "object_story_spec": { "link_data": { "call_to_action": {"type":"SIGN_UP","value":{"link":"<URL>"}}, "description": "Description", "link": "<URL>", "message": "Message", "name": "Name" }, "page_id": "<PAGE_ID>" } }' \ -d 'ad_format=DESKTOP_FEED_STANDARD' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v27.0/act_<AD_ACCOUNT_ID>/generatepreviews

Erstelle eine Multi-Product Ad-Vorschau mit object_story_id. Um object_story_id abzurufen, musst du zunächst eine Multi-Product Ad erstellen.

curl -X GET \ -d 'creative={ "object_story_id": "<PAGE_ID>_<POST_ID>" }' \ -d 'ad_format="DESKTOP_FEED_STANDARD"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v27.0/act_<AD_ACCOUNT_ID>/generatepreviews

Erstelle eine App Ad-Vorschau mit object_story_spec. Das ist die einzige Möglichkeit, eine Vorschau für eine App Ad zu erstellen.

curl -X GET \ -d 'creative={ "object_story_spec": { "link_data": { "call_to_action": { "type": "USE_APP", "value": { "link": "<URL>" } }, "description": "Description", "link": "<URL>", "message": "Message", "name": "Name", "picture": "<IMAGE_URL>" }, "page_id": "<PAGE_ID>" } }' \ -d 'ad_format="MOBILE_FEED_STANDARD"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v27.0/act_<AD_ACCOUNT_ID>/generatepreviews


Anzeigenvorschau der Instagram Explore-Startseite mit dem Anzeigenformat INSTAGRAM_EXPLORE_GRID_HOME

curl -X GET \
  -d 'ad_format="INSTAGRAM_EXPLORE_GRID_HOME"' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v27.0/<AD_ID>/previews

Damit wird in etwa Folgendes zurückgegeben:

{
  "data": [
    {
      "body": "<iframe src=\"https://www.facebook.com/ads/api/preview_iframe.php?d=AQKuwYcWpyFgVKLORPWQi52_uTud4v8PpMoDtyBfntL65i0iFtgkiXWN5S4JMBhq-UMKQmvxXFexVxu-5l5Xbf4WWRP48sCAtn3ArQAXwbdrD5qH0EL2z34K-gAgYyENd80cOGAdhVreKGJZvPkLbjDS3iDkdqdNNJQ6yaAFTmUpaz__cjgmhVVCUW68wU3UOZwqlv376mkijYR57Sm2OlyES4U6ivMPNGDx4xnZEd5d8kWyagDD-lPbCaGEk0nnQF5mnyeV9pFqdByhq-IqN6n0ZhSWjCPXZQa84wu5GNQ70YR2w7QxEYoiWCgI2WP0Z2OPeUMiNOf9bhYB-TBZJZ7G6HylsOnzzII9FQ8-0K-b_Q&t=AQJws9t-TtIGrKoFtCM\" width=\"274\" height=\"213\" scrolling=\"yes\" style=\"border: none;\"></iframe>"
    }
  ]
}

Anzeigenvorschau in Instagram-Suchergebnissen mit dem Anzeigenformat „INSTAGRAM_SEARCH_CHAIN“

curl -X GET \
  -d 'ad_format="INSTAGRAM_SEARCH_CHAIN"' \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v27.0/<AD_ID>/previews

Damit wird in etwa Folgendes zurückgegeben:

{
  "data": [
    {
      "body": "<iframe src=\"https://www.facebook.com/ads/api/preview_iframe.php?d=AQKVMPdwuorP3mliXRaOi0TCSvsGRfucEzBTnB4jghArle84f8kBjvJmX3gmdjniUjohKA3GUppDZqljStZwxxRRxkQl9Y4R1o5wV4zRGE3xO3NHf1_qBbFM_uEIGAnAvptMWo_DLpbiIqIYFMjxbXNELzmZQsR0gnbBjaXM9i6gkI29dnHPqnm4xGvPxo2w8RWeXfWvmik2C96_2PrhrRhh4NKL3SOmFC9JDVsTp9Z6SYDlLVcLJWwpRKmciAZqEMOnMEFgepVTZ39yJ4ZiAMRo76RK9XNVGcornsUBtxI8cZHKtdW7nmj3ivq09_NGGUnFiJdJaPm-Mk-obM3K0QyOvgHKwnmLn7wvMiizJeXPEWAcSBa4DPUFLAO1mSuaKla0VQ6tzAM4BqFU9LJOG1-zZmPec7wKxQGDcrXoCOKfv2xkLyzECc-oDS0JJgvxxlo&t=AQI8ECKvkemIoVDaDrs\" width=\"274\" height=\"213\" scrolling=\"yes\" style=\"border: none;\"></iframe>"
    }
  ],
  "__www_request_id__": "AzCC2RoeSL0rMbSPTYDyDHa"
}