15 mins to complete
In this tutorial, you will learn how to create single-image ads from scratch via Facebook API but change the image. Complete this tutorial before starting.
Video Tutorial
Instructions
- Complete this tutorial before starting.
- Add Select Google File ID node. Choose a
parent_folder_id
in which your image is located. Choose jpeg asmimes_type
. Choose thefile_id
which you want to use for your new ad. - Add Extract node. Connect
file_id
todata
. Insert/id
pointer. - Add Replace String node. Choose
Any
schema
. Input{id}
regex
. Connectdata
(Extract) tovalue
. Insert the following string intodata
:
https://drive.google.com/uc?export=download&id={id}
- Add Create Facebook Ad Image V3 node. Connect
ad_account_id
sockets. Connectdata
(Replace String) tourl
. Insert thename
of the file. - Add Extract node. Connect
ad_creative
(Fetch Facebook Ad Creative) todata
. Insert/object_story_spec
as apointer
. - Add Patch JSON node. Connect
data
(Extract) todata
. Connectad_image_id
tovalue
. - Add 1 replace patch with the following value:
- path:
/link_data/image_hash
value:{{input.value/context/image/hash}}
- Add Input Any node. Insert the following JSON template:
{
"account_id": "",
"adset_id": "",
"creative": {
"object_story_spec": ""
},
"name": "",
"conversion_domain": "",
"tracking_specs": ""
}
- Add Patch JSON node. Connect
any
todata
. Connectdata
(Patch JSON) tovalue
. - Add 1 replace patch with the following value:
- path:
/creative/object_story_spec
value:{{input.value}}
- Add Patch JSON node. Connect
data
todata
. Connect ad (Fetch Facebook ad) tovalue
. - Add 5
replace
patches with the following input:
- path:
/account_id
value:{{input.value/account_id}}
- path:
/adset_id
value:{{input.value/adset}}
- path:
/name
value:{{input.value/name}}
- path:
/tracking_specs
value:{{input.value/tracking_specs}}
- path:
/conversion_domain
value:{{input.value/conversion_domain}}
- path:
/status
value:{{input.value/status}}
- Add Create Facebook Ad node. Connect
data
sockets.