Tiktok Ads Automated Changelog

This automation will help you track the changes you make in Business Manager.

This automation allows you to export the following activities into a Spreadsheet:

  • Bidding & Optimization
  • Budget
  • Status
  • Targeting

JSON Recipe

Import the automation recipe(s) into your own account. Don’t know how? Learn here.

Facebook Changelog
{"name":"TikTok Changelog","description":"tiktok_ads_change_log_sheets_20231109","nodes":{"map_any_to_table_rows_1":{"type":"map_any_to_table_rows","logging_enabled":false,"error_rules":[],"x":1317,"y":121,"inputs":{"add_header":{"export_enabled":true,"data":true},"mapping":{"export_enabled":true,"data":{"A":"/time","B":"/log_object_type","C":"/object_id","D":"/object","E":"/operator","F":"/source","G":"/app_id","H":"/activity_details/0/action","I":"/activity_details/0/name","J":"/activity_details/0/before_after/0/before","K":"/activity_details/0/before_after/0/after"}},"schema":{"export_enabled":true,"data":"any_list"}},"outputs":{"mapped":{"title":"mapped","description":"Triggered when mapped"}}},"timestamp_1":{"type":"timestamp","logging_enabled":false,"error_rules":[],"x":181,"y":424,"group":"group_1"},"format_timestamp_v2_1":{"type":"format_timestamp_v2","logging_enabled":false,"error_rules":[],"x":471,"y":184,"group":"group_1","inputs":{"pattern":{"export_enabled":true,"data":"%Y-%m-%d %H:%M:%S"}}},"format_timestamp_v2_2":{"type":"format_timestamp_v2","logging_enabled":false,"error_rules":[],"x":1364,"y":218,"group":"group_2","inputs":{"pattern":{"export_enabled":true,"data":"%Y-%m-%d %H:%M:%S"}}},"calculate_math_operation_1":{"type":"calculate_math_operation","logging_enabled":false,"error_rules":[],"x":1086,"y":211,"group":"group_2","inputs":{"operator":{"export_enabled":true,"data":"-"},"b":{"export_enabled":true,"data":86400}}},"patch_json_v2_1":{"type":"patch_json_v2","logging_enabled":false,"error_rules":[],"x":654,"y":100,"group":"group_3","inputs":{"patches":{"export_enabled":true,"data":[{"op":"replace","path":"/end_time","value":"{{input.value}}"}]}}},"patch_json_v2_2":{"type":"patch_json_v2","logging_enabled":false,"error_rules":[],"x":1264,"y":142,"group":"group_3","inputs":{"patches":{"export_enabled":true,"data":[{"op":"replace","path":"/start_time","value":"{{input.value}}"}]}}},"patch_json_v2_3":{"type":"patch_json_v2","logging_enabled":false,"error_rules":[],"x":61,"y":118,"group":"group_3","inputs":{"patches":{"export_enabled":true,"data":[{"op":"replace","path":"/advertiser_id","value":"{{input.value/id}}"}]},"data":{"export_enabled":true,"data":{"advertiser_id":"","start_time":"","end_time":"","timezone":""}}}},"extract_1":{"type":"extract","logging_enabled":false,"error_rules":[],"x":201,"y":307,"group":"group_4","inputs":{"pointer":{"export_enabled":true,"data":"/id"}}},"stop_1":{"type":"stop","logging_enabled":false,"error_rules":[],"x":1824,"y":89},"start_1":{"type":"start","logging_enabled":false,"error_rules":[],"x":81,"y":225},"delay_to_1":{"type":"delay_to","logging_enabled":false,"error_rules":[],"x":54,"y":414,"inputs":{"weekdays":{"export_enabled":true,"data":["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]},"time":{"export_enabled":true,"data":"08:00:00+01:00"}}},"tik_tok_select_ad_account_ids_1":{"type":"tik_tok_select_ad_account_ids","logging_enabled":false,"error_rules":[],"x":113,"y":43,"inputs":{"ad_account_ids":{"title":"ad_account_ids","description":"Select one or more TikTok Ad Accounts"}}},"for_each_v2_1":{"type":"for_each_v2","logging_enabled":false,"error_rules":[],"x":451,"y":113},"post_integration_url_v2_1":{"type":"post_integration_url_v2","logging_enabled":false,"error_rules":[],"x":1596,"y":140,"group":"group_3","inputs":{"headers":{"export_enabled":true},"url":{"export_enabled":true,"data":"https://business-api.tiktok.com/open_api/v1.3/changelog/task/create/"},"provider":{"export_enabled":true,"data":"tik_tok"}},"outputs":{"posted":{"title":"posted","description":"Triggered when posted"}}},"extract_2":{"type":"extract","logging_enabled":false,"error_rules":[],"x":1898,"y":205,"group":"group_3","inputs":{"pointer":{"export_enabled":true,"data":"/data/task_id"}}},"replace_string_1":{"type":"replace_string","logging_enabled":false,"error_rules":[],"x":484,"y":259,"group":"group_4","inputs":{"regex":{"export_enabled":true,"data":"ACCOUNT_ID"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"any"},"data":{"export_enabled":true,"data":"https://business-api.tiktok.com/open_api/v1.3/changelog/task/download/?advertiser_id=ACCOUNT_ID\u0026task_id=TASKID"}}},"replace_string_2":{"type":"replace_string","logging_enabled":false,"error_rules":[],"x":732,"y":258,"group":"group_4","inputs":{"regex":{"export_enabled":true,"data":"TASKID"},"pointer":{"export_enabled":true,"data":""},"schema":{"export_enabled":true,"data":"any"}}},"fetch_integration_url_v2_1":{"type":"fetch_integration_url_v2","logging_enabled":false,"error_rules":[{"error_type":"integration/client/response_error","expression":"not ready"}],"x":999,"y":254,"group":"group_4","inputs":{"headers":{"export_enabled":true},"field":{"export_enabled":true},"all_pages":{"export_enabled":true},"provider":{"export_enabled":true,"data":"tik_tok"}}},"process_script_1":{"type":"process_script","logging_enabled":false,"error_rules":[],"x":1281,"y":277,"group":"group_4","inputs":{"b":{"export_enabled":true},"src":{"export_enabled":true,"data":"changelog = inputs['a']['data']['changelog']\n\nimport csv\nimport ast\n\nimport json\n\nchangelog = changelog.replace(\"b'\", \"'\")\nchangelog_dict = ast.literal_eval(changelog)\ncsv_data = changelog_dict['file_data'].split(\"\\r\\n\\r\\n\")[1].split(\"\\r\\n\")\n\ndata = []\n#keys = csv_data[0].split(\",\")\nkeys = [\"time\", \"log_object_type\", \"object_id\", \"object\", \"operator\", \"source\", \"app_id\", \"activity_details\"]\nfor row in csv_data[1:]:\n    item = {}\n    values = row.split(\",\")\n    extra_info = \",\".join(values[7:]).replace('\"[', '[').replace(']\"', ']').replace('\"\"', '\"')\n    if extra_info == '':\n        continue\n    extra_info = ast.literal_eval(extra_info)\n    values = values[0:7]\n    values.append(extra_info)\n    for i, v in enumerate(values):\n      item[keys[i]] = v\n    data.append(item)\n    \noutputs['a'] = data"},"runtime":{"export_enabled":true,"data":"python3_7"}}},"google_sheets_append_table_rows_v3_1":{"type":"google_sheets_append_table_rows_v3","logging_enabled":false,"error_rules":[],"x":1603,"y":180,"inputs":{"range":{"title":"range","description":"Input the range to search for the table to append to"},"spreadsheet_id":{"title":"spreadsheet_id","description":"Select a Google Spreadsheet file to append data to"}}},"delay_1":{"type":"delay","logging_enabled":false,"error_rules":[],"x":1018,"y":654,"group":"group_4","inputs":{"duration":{"export_enabled":true,"data":10}}}},"edges":[{"id":"fetch_integration_url_v2_1.fetched:process_script_1.process","points":[]},{"id":"process_script_1.processed:map_any_to_table_rows_1.map","points":[]},{"id":"google_sheets_append_table_rows_v3_1.appended:for_each_v2_1.next","points":[]},{"id":"process_script_1.a:map_any_to_table_rows_1.data","points":[]},{"id":"start_1.start:delay_to_1.start","points":[]},{"id":"for_each_v2_1.done:delay_to_1.start","points":[]},{"id":"post_integration_url_v2_1.body:extract_2.data","points":[]},{"id":"post_integration_url_v2_1.posted:extract_2.extract","points":[]},{"id":"replace_string_1.replaced:replace_string_2.replace","points":[]},{"id":"replace_string_1.data:replace_string_2.data","points":[]},{"id":"replace_string_2.replaced:fetch_integration_url_v2_1.fetch","points":[]},{"id":"replace_string_2.data:fetch_integration_url_v2_1.url","points":[]},{"id":"extract_2.data:replace_string_2.value","points":[]},{"id":"map_any_to_table_rows_1.mapped:google_sheets_append_table_rows_v3_1.append","points":[]},{"id":"map_any_to_table_rows_1.rows:google_sheets_append_table_rows_v3_1.rows","points":[]},{"id":"fetch_integration_url_v2_1.body:process_script_1.a","points":[]},{"id":"timestamp_1.done:format_timestamp_v2_1.format","points":[]},{"id":"timestamp_1.timestamp:format_timestamp_v2_1.timestamp","points":[]},{"id":"timestamp_1.timestamp:calculate_math_operation_1.a","points":[]},{"id":"calculate_math_operation_1.data:format_timestamp_v2_2.timestamp","points":[]},{"id":"calculate_math_operation_1.calculated:format_timestamp_v2_2.format","points":[]},{"id":"delay_to_1.delayed:for_each_v2_1.start","points":[]},{"id":"tik_tok_select_ad_account_ids_1.ad_account_ids:for_each_v2_1.items","points":[]},{"id":"for_each_v2_1.item:patch_json_v2_3.value","points":[]},{"id":"extract_1.data:replace_string_1.value","points":[]},{"id":"extract_2.extracted:extract_1.extract","points":[]},{"id":"patch_json_v2_3.patched:timestamp_1.now","points":[]},{"id":"format_timestamp_v2_1.formatted:patch_json_v2_1.patch","points":[]},{"id":"format_timestamp_v2_1.date_time:patch_json_v2_1.value","points":[]},{"id":"patch_json_v2_1.data:patch_json_v2_2.data","points":[]},{"id":"format_timestamp_v2_2.date_time:patch_json_v2_2.value","points":[]},{"id":"for_each_v2_1.do:patch_json_v2_3.patch","points":[]},{"id":"extract_1.extracted:replace_string_1.replace","points":[]},{"id":"for_each_v2_1.item:extract_1.data","points":[]},{"id":"patch_json_v2_3.data:patch_json_v2_1.data","points":[]},{"id":"patch_json_v2_1.patched:calculate_math_operation_1.calculate","points":[]},{"id":"patch_json_v2_2.data:post_integration_url_v2_1.body","points":[]},{"id":"patch_json_v2_2.patched:post_integration_url_v2_1.post","points":[]},{"id":"format_timestamp_v2_2.formatted:patch_json_v2_2.patch","points":[]},{"id":"delay_1.delayed:fetch_integration_url_v2_1.fetch","points":[{"x":988,"y":344},{"x":988,"y":832},{"x":988,"y":840},{"x":1242,"y":840},{"x":1252,"y":840},{"x":1252,"y":821},{"x":1252,"y":811}]},{"id":"fetch_integration_url_v2_1.failed:delay_1.start","points":[]}],"groups":{"group_3":{"title":"Request report","description":"","x":710,"y":134,"inputs":["patch_json_v2_3.value","patch_json_v2_3.patch"],"outputs":["extract_2.data","extract_2.extracted"]},"group_4":{"title":"Get report","description":"","x":1007,"y":128,"inputs":["replace_string_2.value","extract_1.data","extract_1.extract"],"outputs":["process_script_1.processed","process_script_1.a"]},"group_1":{"title":"End Time","description":"","x":336,"y":154,"group":"group_3","inputs":["timestamp_1.now"],"outputs":["timestamp_1.timestamp","format_timestamp_v2_1.date_time","format_timestamp_v2_1.formatted"]},"group_2":{"title":"Start Time","description":"","x":954,"y":146,"group":"group_3","inputs":["calculate_math_operation_1.a","calculate_math_operation_1.calculate"],"outputs":["format_timestamp_v2_2.date_time","format_timestamp_v2_2.formatted"]}},"widgets":{"widget_1":{"title":"Weekdays","description":"The weekdays to delay the trigger","position":5,"input":"delay_to_1.weekdays"},"widget_2":{"title":"Time","description":"The time to delay the trigger","position":6,"input":"delay_to_1.time"},"widget_3":{"title":"Ad Accounts","description":"Select one or more TikTok Ad Accounts","position":0,"input":"tik_tok_select_ad_account_ids_1.ad_account_ids"},"widget_4":{"title":"Spreadsheet","description":"Select a Google Spreadsheet file to append data to","position":1,"input":"google_sheets_append_table_rows_v3_1.spreadsheet_id"},"widget_5":{"title":"Tab / Range","description":"Select a tab or enter a range in A1 notation.","position":2,"input":"google_sheets_append_table_rows_v3_1.range"}},"variables":{},"config":{"capture_inputs_enabled":false,"caching_enabled":false},"tags":[]}

How To

Step 1

GSheets

Create a new spreadsheet.

Step 2

Notion image
  1. Select a Spreadsheet and tab that you have created in step 1. If it doesn’t show up, hit thre refresh icon 🔄.
  1. Select a Tiktok Ad Account
  1. Optionally, choose on which weekdays you want to run the automation. Note that per default only yesterday’s change log is added.
  1. Choose at what time you want to run the automation. It is recommended to run early in the morning to capture yesterday’s changes.
  1. Click Run Automation

The automation will now get the last 24h change log and add it to the spreadsheet and then wait until the specified time and weekday to run again.

 
Did this answer your question?
😞
😐
🤩

Last updated on November 9, 2023