GithubHelp home page GithubHelp logo

mavericks08 / facebook_ads_bigquery_etl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snegireff/facebook_ads_bigquery_etl

0.0 1.0 0.0 11 KB

ETL based on google cloud function to save facebook ads statistics in google bigquery

License: Other

Python 100.00%

facebook_ads_bigquery_etl's Introduction

Facebook ads to google bigQuery ETL

ETL based on cloud function (google cloud) that retrieves data from the Facebook Insight API:

AdsInsights.Field.account_id, AdsInsights.Field.campaign_id, AdsInsights.Field.campaign_name, AdsInsights.Field.adset_name, AdsInsights.Field.adset_id, AdsInsights.Field.ad_name, AdsInsights.Field.ad_id, AdsInsights.Field.spend, AdsInsights.Field.impressions, AdsInsights.Field.clicks, AdsInsights.Field.actions, AdsInsights.Field.conversions

And Currency exchange rate from currencylayer.com.

ETL uploads this data to Google Bigquery every day.

Getting Started

These instructions will get you a copy of the project up and running on your google cloud project for development and testing purposes.

Installing

Tutorial

A step by step series of examples that tell you how to get a development env running

Create new pubsub topic:

gcloud pubsub topics create facebook_run

Publish cloud function:

gcloud functions deploy get_facebook_data --runtime python37 --trigger-topic facebook_run --timeout=540 --memory=1024MB

Create scheduler for facebook ads ETL:

PROJECT_ID = your google cloud PROJECT_ID DATASET_ID = for example "facebook" TABLE_ID = for example "fb_stat" ACCOUNT_ID = your facebook account id without act_

APP_ID, APP_SECRET, APP_TOKEN = from apps developers.facebook.com

gcloud beta scheduler jobs create pubsub facebook --time-zone "Europe/Kiev" --schedule "0 5 * * *" --topic facebook_run --message-body "get_facebook" --attributes project_id=PROJECT_ID,dataset_id=DATASET_ID,table_id=TABLE_ID,account_id=ACCOUNT_ID,app_id=APP_ID,app_secret=APP_SECRET,access_token=ACCESS_TOKEN

Create scheduler for currency converter:

gcloud beta scheduler jobs create pubsub converter --time-zone "Europe/Kiev" --schedule "0 5 * * *" --topic facebook_run --message-body "get_currency" --attributes project_id=PROJECT_ID,dataset_id=DATASET_ID,table_id=TABLE_ID,api_key=API_KEY,from_currency=USD,to_currency=UAH

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

facebook_ads_bigquery_etl's People

Contributors

snegireff avatar

Watchers

James Cloos 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.