Skip to content

Generating GAQL (Google Ads Query Language) tool.

Notifications You must be signed in to change notification settings

yo8568/js-gaql-builder

Repository files navigation

GAQL Builder - javascript version

build

Generating GAQL (Google Ads Query Language) tool, this is not official library. If you want to build GAQL string much easier, you can use this tool, but it would not be validated entirely for all of posible combinations.

Please follow the building rule via official documentation.

Installation

$ npm install js-gaql-builder

Usage

Import library

// node.js or es5
const GAQLB = require('js-gaql-builder').default

// react.js or es6
import GAQLB from 'js-gaql-builder'

Syntax

 const result = new GAQLB()
  .select([
    'ad_group.id', 'ad_group_criterion.type', 'ad_group_criterion.criterion_id',
    'ad_group_criterion.keyword.text', 'ad_group_criterion.keyword.match_type'])
  .from('ad_group_criterion')
  .where('metrics.clicks > 135')
  .parameters(['include_drafts = true'])
  .orderBy('ASC')
  .limit(2)
  .toString()

Result

  SELECT
    ad_group.id,
    ad_group_criterion.type,
    ad_group_criterion.criterion_id,
    ad_group_criterion.keyword.text,
    ad_group_criterion.keyword.match_type
  FROM
    ad_group_criterion
  WHERE
    metrics.clicks > 135
  ORDER BY
    ASC
  LIMIT
    2
  PARAMETERS
    include_drafts = true

Run Test

Test

  $ npm run test

Converage

  $ npm run cov

Licence

MIT

About

Generating GAQL (Google Ads Query Language) tool.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published