Giter Club home page Giter Club logo

ads-platform-tools's Introduction

ads-platform-tools

Tools and utilities for the Twitter Ads Platform.

Also useful, see https://github.com/twitterdev/ton-upload for using the TON API.

Installation

Clone the repository:

$ git clone https://github.com/twitterdev/ads-platform-tools.git
$ cd ads-platform-tools/

If using the Python tools, install the following packages:

$ pip install -r python/requirements.pip

Usage

The following examples assume ads-platform-tools/ is the working directory.

hash_tailored_audience_file

Sample tools to hash data for tailored audience uploads, in either Python or Perl. Details on these normalization rules can be found here or here.

Data types supported:

  • MOBILEDEVICEID
  • IDFA
  • ADID
  • ANDROID
  • EMAIL
  • PHONE
  • TWITTERID
  • TWITTERSCREENNAME

Python:

$ python python/hash_tailored_audience_file.py --type EMAIL --infile path/to/emails_source.txt --outfile path/to/emails_hashed.txt

Perl:

$ perl perl/hash_tailored_audience_file.pl EMAIL path/to/emails_source.txt

hash_mact_device

Sample script to debug the HMAC hashing of MACT device_ids. Input is a single, unhashed normalized device_id and output will include both the hashed device id and the hashed extra device id.

Python:

$ python python/hash_mact_device.py --env prod --value abc123456789

fetch_stats

Sample script implementing best practices for pulling ads analytics for an advertiser account.

Python:

$ python python/fetch_stats.py -a abc1

Params:

-a abc1   # the :account_id to run the stats fetcher on
-s        # pull segmented stats
-v        # output avg query costs
-vv       # output stats API calls made

Sample output:

Best practices stats check for :account_id abc1
-----------------------------------------------
Current time:   2015-04-16 02:32:16.815510
Start time:     2015-04-09 02:00:00
End time:       2015-04-16 01:59:59
-----------------------------------------------
Pre-filtered data:          2
Funding instruments:        1
Pre-filtered data:          15381
Campaigns:                  67
Pre-filtered data:          14768
Line items:                 37
Pre-filtered data:          11518
Promoted Tweets:            33
    fetching stats for 37 line items
    fetching stats for 33 promoted tweets
-----------------------------------------------
Total Stats Queries:        4
Total Stats Request Cost:   2780
Queries Rate Limited:       0
-----------------------------------------------
Time elapsed:           11.44861

ads-platform-tools's People

Contributors

andypiper avatar augbog avatar garethpaul avatar jaakko-sf avatar juanshishido avatar ryankicks avatar tvdhedia avatar

Watchers

 avatar  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.