Connect with us


Adding STAT Reports to Google Sheets Using App Scripts



Adding STAT Reports to Google Sheets Using App Scripts

The author’s views are entirely his or her own (excluding the unlikely event of hypnosis) and may not always reflect the views of Moz.

The team at MacMillan Search has generated a lot of value by combining automated STAT reports with Google Sheets. From adding ranking details to other tool’s outputs, to giving the content teams up-to-date “People Also Ask” reports, the end result has proven to be a great time-saver in our week-to-week SEO workflows by reducing manual work and providing standard outputs that easily integrate with any spreadsheet.

Why did we create this script?

STAT’s wealth of keyword rankings details is very useful for enterprise SEOs to understand both the macro and micro details of their rankings. Google Sheets is one of the most common cloud-based spreadsheets platforms, and is easy to share between teams and organizations. That’s why SEOs use both of these tools regularly when analyzing keyword data.

Despite this, documentation on how to integrate STAT into Google Sheets is limited. To address this gap, we created our own script!

It’s proven useful for several reasons:

  1. Not everyone likes CSVs: We leverage the STAT reports to provide clients with direction. Having to download a CSV and open it every week isn’t for everyone. With this script, you can set a weekly ticket with a link to the spreadsheet, and review the output regularly.

  2. It saved us time: SEO is a marathon, not a sprint. When we identify an opportunity, there is ongoing work that will have us reviewing reports regularly. The weekly ticket approach to review a spreadsheet shaves some time off of each task, and over the course of the engagement, this saved time adds up.

  3. Cleaner output: Using Vlookups, Uniques, etc., you can create a summary page of this information, highlighting what clients and/or readers care about. You can also integrate this information with other data sources.

  4. Create automation without using an API: Automation, when done correctly, saves time. Using this script with triggers opens the door to automation.

How to implement this script

1) Create a report in STAT

The STAT knowledge base has a great resource on reports. The only thing we would get specific on is the naming of the report and the recipient email.


What you name your report is not as important as keeping it clear and concise. This makes scaling to other projects with similar reports cleaner and easier. You will also use this report name as one of the variables in the scripts.


We also suggest placing the company or project name at the end of the report name in parentheses (e.g. “(MacMillan Search)”). This makes it easier to find the report in your email.

Recipient email

It’s important to use a Gmail-enabled email for the account where you’ll be building the sheet. This way, Google has an easier time getting the app script to extract the CSV from the email.


For our clients, weekly data is the most useful — enough detail to spot trends, but not so much that it becomes just noise to be ignored. For reports with limited fluctuations (e.g. People Also Ask), monthly might be satisfactory.


Select “Run this report immediately” to confirm that your report works, right after creating the script. This way, you’re ready to set your triggers and let the data flow.

The rest of the settings are specific to what details you want from your report.

2) Create a Google Sheet and add the script

Create a new sheet in Google Drive under the account associated with your report’s recipient email. Then you’re ready to add the script:

1. Under the menu “Tools”, select “<> Script editor”

2. Paste the script below into the “Script editor”.

3. A few things will need to be edited to work with your data:

  • var COMPANY_NAME updated to the company or project name you used while creating the STAT Report

  • var REPORT_NAME updated to the name of your report minus the company name and parentheses

  • var SHEET_NAME updated to the name of the sheet in the spreadsheet

4. Confirm the Script works by saving it, refreshing the sheet, and when the menu “Manual Update” loads, select “Import Keywords”.

5. The first time you run this you will get an “Authorization Required” pop-up:

Select “Continue”, follow the steps, and select “Import Keywords” under the menu again.

Your spreadsheet should now be populated with all of the details from your CSV.

3) Automate the population with triggers

Setting this sheet up to automatically update as the report comes out is very easy using Apps Script “Triggers”. To set up the triggers:

1. Go back into the “Script Editor”

2. Select the “alarm” icon “Triggers”

    3. Select “Add Trigger”

    4. Select the function “importKws”

    5. Select event source “Time-driven”


    6. Select type of time-based trigger “Week Timer” for weekly reports, “Month Timer” for monthly reports, etc.

    7. In our time zone, our reports usually come out late Sunday, so we pick early Monday morning:

    8. Click “Save”

      The result is a spreadsheet that regularly updates, populated by an emailed STAT report.

      We’ve found many uses for this script — anywhere we reference rank. And, since a project might take time to get implemented, we can provide current ranking information without leveraging the API.

      We’re curious to learn how you leverage it as well. If you find the script useful, reach out to us on LinkedIn and let us know what you’re using it for.

Source link


How to Play Roulette at Top Online Casinos



How to Play Roulette at Top Online Casinos

Given that it is easily regarded as one of the most popular casino games you can play online, everybody should have a crack at roulette. However, learning how to place bets on the famous wheel-based gambling game is trickier than it sounds for those not in the know. Fortunately, we can help you get set up in no time with our handy guide to playing roulette online. Here are the steps you need to take to start playing today…

Know Your Odds and Bets

Firstly, be prepared that there are both inside bets and outside bets in roulette, and you’re going to need to familiarise yourself with them if you want to play. Some are easier to grasp than others. For instance, it is perfectly possible to find yourself playing with even money bets, like red, black, odds and evens. However, bets like corners and streets require a bit more effort. Alongside learning what each of these means, you should also be prepared to understand the probability of success and the odds of each of these bets.

Place Your Chips Carefully

Where you place your chips on the betting board is essential in roulette. Put them in the wrong spot, and you’re in trouble. For instance, corner bets require you to put your chips on the intersecting line between four numbers. Learn the precise place to put your bets down before you start doing so. By learning about chip placement ahead of time, you can avoid any mistakes when betting.

Beware of Betting Windows

You should always be wary of betting windows. In a typical RNG (random number generator) roulette game, this is unlikely to be an issue. However, as soon as you start betting in live dealer games, there will be a betting window that you’ll have to contend with. This is because there are other people playing. Be sure that your bet falls inside the betting window or you could end up running out of time.

Await the Inevitable Drop and Spin

Once you’ve identified the bets you want to make, placed your chips and done so in a timely manner, you’ll be ready to play. It is the croupier (dealer) that will ultimately decide when the game commences. Once it does, the roulette wheel will spin (if it isn’t already), and a ball will be dropped inside it. After this, you’ll have nothing to do but wait to see which pocket the ball lands in. If you’re lucky, it will land in one which is favourable to your bet.

Collecting Your Winnings

While playing roulette online, it is entirely possible to pocket winnings stretching from 1:1 (also known as even money) up to 35:1. Ultimately, the amount you can win depends on the bet you’ve made, in which pocket the balls lands in relation to that bet, and the amount you’ve bet. Finally, the total amount paid is proportional to your stake.

Source link

Continue Reading

Subscribe To our Newsletter
We promise not to spam you. Unsubscribe at any time.
Invalid email address