affrabby
Grand Guru
- Joined
- Sep 28, 2018
- Messages
- 488
Here's a full guide on how to connect Adsterra API with Google Sheets using my script. This guide will walk you through the steps to automate data fetching from Adsterra API and displaying it in Google Sheets.
Step-by-Step Guide:
1. Set Up a Google Sheet
- Create a new Google Sheet:
- Open Google Sheets, and create a new spreadsheet.
- Name the sheet something relevant, like "Adsterra Stats."
- Add Headers to Your Sheet:
- In the first row, add headers to the columns for the data you'll be collecting.For example:
- A1: Placement Sub ID
- B1: Impressions
- C1: CPM
- D1: Revenue
- E1: Clicks
- F1: CTR
- G1: Date
- This will serve as the data table where stats from the Adsterra API will populate.
- In the first row, add headers to the columns for the data you'll be collecting.For example:
2. Open Google Apps Script
- Go to the Script Editor:
- In your Google Sheet, click on Extensions → Apps Script to open the Google Apps Script editor.
- Add the Script:
- Copy and paste the script into the editor. Here is the full script, Don't forget to add your API :
- javascript
Code:function getAdsterraDailyStats() { const apiKey = "XXXXXXXXXXXXXXXXXXXXXXXXX"; // Your API key const sheet =
Last edited: