Command line batch job that run java runtime environment to extract and load marketing data using Facebook Marketing API, Google Analytics API, Mailchimp API, Google Webmasters API, Google Sheets API, Mysql, Postgresql, Clickhouse, etc
Clone or download & extract this repository https://github.com/jrosell/marketing-data-connectors.git
Decide what connectors you will use and comment/uncomment run.sh (Linux/Mac) or run.bat (Windows) what you need or not, and see detailed connectors setup section.
$ cd your-absolute-file-path
$ chmod u+x ./run.sh
$ ./run.sh
> cd your-absolute-file-path
> run.bat
$ crontab -e
0 8 * * * /your-absolute-file-path/run.sh
On facebook, Create an app or add Marketing API product to an existing one: https://developers.facebook.com/apps/
You need to generate a access_token and you need to know your ad_account_id.
Enable APIs Google Analytics Reporting API v3 on https://console.cloud.google.com/apis/library/analytics.googleapis.com
Add google_service_account_email as user with read permisions on you GA View. Write down viewId.
Change ga.csv with your google_service_account_email, google_key_file_p12 and google_ga_view
You should have a service account and its p12 file. Enable Google Search Console API on https://console.cloud.google.com/apis/library/webmasters.googleapis.com
Add google_service_account_email as user with Restricted or Full permisions on your Google Search Console Property. Write down siteUrl
Change gw.csv with your google_service_account_email, google_key_file_p12 and siteUrl
See FB_Campaigns, GA_Campaigns, Mailchimp_Campaigns and GW_SearchAnalytics connector setup first.
You should have a service account and its p12 file. Enable APIs Google Sheets API on https://console.cloud.google.com/apis/library/sheets.googleapis.com
Open or create a new Google Spreadsheet and write down its file id.
See FB_Campaigns, GA_Campaigns, Mailchimp_Campaigns and GW_SearchAnalytics connector setup first.
You should have mysql server database with its user and password.
Change mysql.csv with your mysql "host", "port", "database", "username" and "password"
See FB_Campaigns, GA_Campaigns, Mailchimp_Campaigns and GW_SearchAnalytics connector setup first.
You should have Postgresql server database with its schema, user and password.
Change postgresql.csv with your Postgresql "host", "port", "database", "schema", "username" and "password"
See FB_Campaigns, GA_Campaigns, Mailchimp_Campaigns and GW_SearchAnalytics connector setup first.
You should have Clickhouse server database with its user and password.
Change clickhouse.csv with your Clickhouse "host", "port", "database", "username" and "password"