GithubHelp home page GithubHelp logo

5l1v3r1 / adwords-scripts-reporting Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tomayac/adwords-scripts-reporting

0.0 1.0 0.0 9 KB

AdWords Scripts Reporting

License: Apache License 2.0

JavaScript 100.00%

adwords-scripts-reporting's Introduction

AdWords Scripts Reporting

This project allows you to easily get started with AdWords My Client Center (MCC) cross-account reports using AdWords Scripts and with the full expressive power of the AdWords Query Language (AWQL).

Setup Guide

  • Log in to the MCC account for which you want to create the cross-account report.
  • Using this account, create a new Google spreadsheet.
  • In AdWords, navigate to "Bulk operations" โ†’ "Scripts", and click "Create script".
  • Paste the contents of the file mcc_cross_account_report.js into the scripts editor.
  • Paste the URL of the spreadsheet from step 1 at the beginning of the script:
// Store the output here
var SPREADSHEET_URL = 'https://docs.google.com/spreadsheets/d/ABCdefGHIjklMNOpqrSTUvwxYZ/edit';
  • Fill in the desired AWQL SELECT fields, respecting the report guidelines for your desired report type:
// AWQL query
var SELECT_VALUES = [
  'ExternalCustomerId',
  'AccountDescriptiveName',
  'Clicks',
  'Impressions'
];
  • Fill in the rest of the AWQL query, again respecting the report guidelines for your desired report type:
var REPORT_QUERY = 'SELECT ' + SELECT_VALUES.join(', ') + ' ' +
    'FROM   ACCOUNT_PERFORMANCE_REPORT ' +
    'WHERE  Clicks > 0 ' +
    'DURING LAST_30_DAYS';
  • (Optional) Old rows in the spreadsheet will be auto-purged after n days, so that the spreadsheet does not overflow with data. Adapt n accordingly:
var PURGE_AFTER = 30 /* days */ * (24 * 60 *  60 * 1000) /* in milliseconds */;

Deployment Instructions

After setting up the script according to the guide above, it is time to test it:

  • Make a test-run of the script in Preview mode by clicking "Preview".
  • If all goes well, you should see logging output on the script console and data in the spreadsheet.
  • If you get an error, the most likely case is that your AWQL query is invalid according to the report guidelines.

If you are happy with the script's output, delete all data in the spreadsheet and schedule the script to run hourly. This is important, as we can only process 50 accounts per run.

  • On the Scripts page in the "Actions" column, click "+ Create schedule" next to the just created script.
  • In the drop-down box next to "Frequency", choose hourly. The script will process all accounts and stop once all accounts are done.
  • Click "Save" and you are ready to go.

Possible Errors

If the reports per account take longer than 60 minutes to generate, the script will get interrupted. Simplify your AWQL query in this case.

For all other errors, check the errors section of the AdWords Scripts documentation.

License

Copyright 2014 Thomas Steiner ([email protected])

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

adwords-scripts-reporting's People

Contributors

tomayac avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.