facebook-ads-reporting-google-apps-script
facebook-ads-reporting-google-apps-script copied to clipboard
Love What I'm Seeing But I May Need Some Help...
I've got everything in place per the instructions in the articles that led me here, but I am left with a couple of questions as I am very interested in using this on a continuous basis and I have very little technical knowledge.
First, is how do I get the long term access key? I understand that there is a method that is outlined in the link provided, but does this go in its own separate script or does it go right above the access token input in the script called?
Second, I am having trouble getting all of the columns that I need in the right order. Currently, I have this in place: const FIELDS = "['date_start','date_stop','campaign_id','campaign_name','adset_id','adset_name','ad_id','ad_name','spend','conversions','purchase_roas']" However, I get 'purchase_roas' placed after 'date_stop' and 'conversions' is not even showing up at all.
Third, I want to run this in a way that saves the data pulled and does not clear it before each run. If there is a way to remove the clear function and have the data appended instead, that would be ideal.
I know this is a lot of customization that I should probably learn to do myself, but if anyone is out there that has run into these issues and has a solution, it would go a long way!
Figured out what to do with the 3rd point - simply deleted the clearing section and adjusted the pasting code to read the following: // Pastes the csv file in the sheet sheet.getRange(sheet.getLastRow()+1,1, results.length, results[0].length).setValues(results); // Inserts a number of rows to the end of the sheet that are equal to the amount of rows pasted. sheet.insertRows(sheet.getLastRow()+1,results.length);