How to render text and frame overlays on an image for a dynamic item in Dynamic Ads
GET v21.0/...?fields={fieldname_of_type_AdCreativeLinkDataImageLayerSpec} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'...?fields={fieldname_of_type_AdCreativeLinkDataImageLayerSpec}',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"...?fields={fieldname_of_type_AdCreativeLinkDataImageLayerSpec}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"...?fields={fieldname_of_type_AdCreativeLinkDataImageLayerSpec}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"...?fields={fieldname_of_type_AdCreativeLinkDataImageLayerSpec}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Feld | Beschreibung |
---|---|
blending_mode enum {lighten, multiply, normal} | Combine the product image and frame image together using a certain blend mode. This field is only valid for |
content AdCreativeLinkDataImageTextOverlayContent | The content of |
frame_auto_show_enroll_status enum | This field indicates whether the ad is eligible for frame overlay automation which could conditionally not display frame for some users if it predicts that doing so would increase ad engagement. |
frame_image_hash string | The hash string for a frame image that you can use in creatives.This field is required for |
frame_source enum {custom} | The source of the frame image. Currently, we only support |
image_source enum {catalog} | The source of the product image. Currently, we only support |
layer_type enum {frame_overlay, image, text_overlay} | Each layer can be a layer of |
opacity int32 | The opacity of the text or frame image. This field is valid for both |
overlay_position enum {bottom, bottom_left, bottom_right, center, left, right, top, top_left, top_right} | Position for overlay on an image. This field is valid for both |
overlay_shape enum {circle, none, pill, rectangle, triangle} | The background shape of |
scale int32 | The scale resizes the frame image by multiples of ten from |
shape_color string | The color of the background in |
text_color string | The color of the text in |
text_font enum {droid_serif_regular, lato_regular, noto_sans_regular, nunito_sans_bold, open_sans_bold, open_sans_condensed_bold, pt_serif_bold, roboto_condensed_regular, roboto_medium} | Font type for text strings. If you choose a text font which does not support the language you are using, it will fallback to the default font.This field is only valid for |