How to render text and frame overlays on an image for a dynamic item in Dynamic Ads
GET v25.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
}];| Field | Description |
|---|---|
blending_modeenum {lighten, multiply, normal} | Combine the product image and frame image together using a certain blend mode. This field is only valid for |
contentAdCreativeLinkDataImageTextOverlayContent | The content of |
frame_auto_show_enroll_statusenum | 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_hashstring | The hash string for a frame image that you can use in creatives.This field is required for |
frame_sourceenum {custom} | The source of the frame image. Currently, we only support |
image_sourceenum {catalog} | The source of the product image. Currently, we only support |
layer_typeenum {frame_overlay, image, text_overlay} | Each layer can be a layer of |
opacityint32 | The opacity of the text or frame image. This field is valid for both |
overlay_positionenum {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_shapeenum {circle, none, pill, rectangle, triangle} | The background shape of |
scaleint32 | The scale resizes the frame image by multiples of ten from |
shape_colorstring | The color of the background in |
text_colorstring | The color of the text in |
text_fontenum {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 |