Developers

Google Sheets and Looker Studio

Put Sporetag numbers in Google Sheets with one formula that refreshes by itself, then chart them in Looker Studio.

Every list in the read API has a CSV feed. Google Sheets reads a feed with one formula and refreshes it by itself, and Looker Studio charts any sheet. That is the path today.

A Sporetag connector for Looker Studio (when shipped) will let you pick a site and a report inside Looker Studio, with no sheet in between.

CSV feeds are on paid plans: Solo, Studio, Agency and Custom.

1. Make a key for one site

Open Settings, then API. Under Reads, pick the site, name the key (for example "Sheets") and press Make a key. Copy it.

A feed address holds the key, and Google fetches it from its own servers. Anyone who sees the formula can read that site. A key for one site keeps that small, and Revoke stops it at once.

2. Find the site id

The site's dashboard address ends with it: sporetag.com/app/s/8fK2pQ has the id 8fK2pQ.

3. Add a feed to Google Sheets

In an empty sheet, click cell A1 and paste a formula. Put your site id and key in.

Visitors per day for the last 90 days:

Text
=IMPORTDATA("https://sporetag.com/api/v1/sites/8fK2pQ/timeseries?period=90d&format=csv&key=st_rk_...")

Top sources this month:

Text
=IMPORTDATA("https://sporetag.com/api/v1/sites/8fK2pQ/breakdown/source?period=mtd&format=csv&key=st_rk_...")

More feeds, all with &format=csv&key=st_rk_... at the end:

FeedAddress after https://sporetag.com
Totals for a range, one row/api/v1/sites/SITE_ID/stats?period=30d
Per day, hour or month/api/v1/sites/SITE_ID/timeseries?period=90d&interval=day
Top pages/api/v1/sites/SITE_ID/breakdown/page?period=30d
Campaigns/api/v1/sites/SITE_ID/breakdown/campaign?period=30d
Countries or devices/api/v1/sites/SITE_ID/breakdown/country?period=30d
Goals/api/v1/sites/SITE_ID/goals?period=30d
Sales credited by campaign/api/v1/sites/SITE_ID/attribution?period=30d&by=campaign
Ad spend and ROAS by campaign/api/v1/sites/SITE_ID/ads?period=30d&level=campaign
Short link clicks/api/v1/links?period=30d

Money feeds have one currency column. Add &currency=EUR to pick it; by default it is the one with the most money.

Google Sheets refreshes these formulas on its own, about once an hour. Put each feed on its own tab, so they never overlap.

4. Chart it in Looker Studio

  1. In Looker Studio, create a report and choose Add data.
  2. Pick Google Sheets, then your sheet and the tab with the feed.
  3. Keep Use first row as headers on and press Add.
  4. Check that date reads as a date: in the data source, set its type to Date if Looker Studio did not.

Charts update when the sheet does.

Good to know

  • Feed numbers are the same as the dashboard's: whole days in the site's time zone. Add &timezone=America/New_York to read them in another.
  • A feed holds up to 1,000 rows.
  • Each refresh counts toward the key's 120 requests a minute.
  • If a feed stops, the cell shows an error. A revoked key or a plan change is the usual reason.

Something missing or wrong? Email hello@sporetag.com.