Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Write JSON data to a public store for saving state about a Bing Ads Script automation - for example to create virtual 'labels'
function main() {
// Enter your own URL here - get it from
var MyJsonBin = '';
// This is the object you will store for use the next time the script runs
var dataToStore = {};
dataToStore.lastKeywordProcessed = "some keyword";
dataToStore.someOtherThingToTrack = "the other thing's ID is 123456";
var options = {
var response = UrlFetchApp.fetch(MyJsonBin, options);
var responseText = response.getContentText();
var responseCode = response.getResponseCode();
Logger.log(responseText + " (" + responseCode + ")");
var tokens = JSON.parse(response.getContentText());
var uri = tokens['uri'];
for(var key in tokens) {
var val = tokens[key];
Logger.log(key + " " + val);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.