Giter Club home page Giter Club logo

gads's Introduction

gads (Google Adwords Golang SDK)

Package gads provides a wrapper for the Google Adwords SOAP API. Based off of colinmutter/gads, this version was updated to support v201710 and additional functionality that was missing from the current versions.

Installation

	go get github.com/Getsidecar/gads

Usage

The package is comprised of services used to manipulate various adwords structures. To access a service you need to create an gads.Auth and parse it to the service initializer, then can call the service methods on the service object.

     authConf, err := NewCredentialsFromFile("~/creds.json")
     campaignService := gads.NewCampaignService(&authConf.Auth)

     campaigns, totalCount, err := campaignService.Get(
       gads.Selector{
         Fields: []string{
           "Id",
           "Name",
           "Status",
         },
       },
     )

Note: This package is a work-in-progress, and may occasionally make backwards-incompatible changes.

Testing

Sidecar has written integration tests in the sandbox_test.go file. All other tests were included in the original repo and won't run correctly unless you setup the JSON file to gather credentials.

To run the sandbox tests:

  1. cp .env.dist .env and fill in the credentials
  2. set -a
  3. source .env

Then to run the tests:

  1. cd v201710
  2. go test -run Sandbox

Versions

This project currently supports v201710 only. To select the appropriate version, import the specific package:

  import (
    gads "github.com/Getsidecar/gads/v201710"
  )

Original Repo Additional Documentation

Credentials setup

In order to access the API you will need to sign up for an MCC account[1], get a developer token[2] and setup authentication[3]. There is a tool in the setup_oauth2 directory that will help you setup a configuration file.

  1. http://www.google.com/adwords/myclientcenter/
  2. https://developers.google.com/adwords/api/docs/signingup
  3. https://developers.google.com/adwords/api/docs/guides/authentication

Currently, the you need to supply credentials via NewCredentialsFromParams or NewCredentialsFromFile. The credentials can be obtained from the file generated in the previous step.

For example in this CLI script, I am handling a conf file via flags:

go run cli/adgroups_awql.go -oauth ~/auth.json

NOTE: Other examples still need to be updated to support the removal of the built-in oauth configuration file flag.

about

Gads is developed by Edward Middleton

and supported by:

gads's People

Contributors

bbachtel avatar slofurno avatar rv-drassakhatsky avatar colinmutter avatar davewalk avatar williamlfish avatar emiddleton avatar rfink avatar ankush91 avatar machiel avatar chriscannon avatar mrsinham avatar zubricky avatar

Watchers

James Cloos avatar Charlie Hothersall-Thomas 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.