Anac0n6a / Script-ADS

1 stars 1 forks source link

Study python code and set it up for me #1

Open VikasHK127001 opened 3 months ago

VikasHK127001 commented 3 months ago

Hello, I saw your proposal on Upwork. What exactly do you want?

fabianbernhart commented 3 months ago

Imports

Facebook Ads API Initialization

Initialize the Facebook Ads API using provided credentials (app_id, app_secret, access_token) and specify the API version (v19.0).

Function download_videos_from_drive(folder_id)

Authenticates to Google Drive using GoogleAuth() and downloads all MP4 videos from the specified folder (folder_id). Returns a list of downloaded video filenames.

Function create_campaign(name)

Creates a new Facebook ad campaign with the given name, specifying parameters such as objective and special_ad_categories.

Function create_ad_sets(campaign_id, folder_name, videos)

Creates multiple ad sets for a campaign (campaign_id), based on the number of videos (videos) available in a Google Drive folder (folder_name). Sets parameters like billing_event, optimization_goal, bid_amount, daily_budget, targeting, start_time, and platform preferences.

Function create_ad(ad_set_id, video_file)

Creates an individual ad within an ad set (ad_set_id) using a specified video file (video_file). Defines an ad creative (ad_creative) with parameters like page_id, link_data (URL, message, headline, description), and call-to-action. Uploads the video file and sets ad parameters such as name, thumbnail_url, and status.

Main Function main()

Main function that orchestrates the entire process:

Execution

The script executes the main() function if it is run directly (__name__ == "__main__").

Setup Instructions

DONT STORE THE CREDNTIALS IN TO YOUR GITHUB REPOSITORY. https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions

If you have any specific questions about any part of the script or need further assistance, feel free to ask!

VikasHK127001 commented 3 months ago

So, your script 'Script-ADS' is not working correctly, or do you want a script from scratch?

fabianbernhart commented 3 months ago

No, that is a description on how to use the Script?

You need the facebook credentials for developing this

So first of all register for api access

https://developers.facebook.com/docs/