Connect with us

SEO

A Complete Guide to App Store Optimization (ASO)

Published

on

A Complete Guide to App Store Optimization (ASO)

A mobile strategy is critical to your business presence, considering the saturation of mobile devices.

This is where app store optimization (ASO) comes into play.

In this article, you’ll learn:

  • What is app store optimization?
  • How does app store optimization work?
  • How do you optimize for Google Play & Apple App Store?

Whether you are new to app store optimization or simply keen to refine your approach to ASO, this post shares practical insights that are proven to maximize app store success.

What Is App Store Optimization?

Downloads, usage, and in-app spending continue to rise, but many users prefer to use a select few apps more consistently.

Discoverability has never been harder, but the rewards of locking in loyal users are bigger than ever – so maximizing visibility in app stores is crucial.

Advertisement

App store optimization (ASO) describes the process of optimizing the listing pages for your mobile app in app stores like Google Play and Apple’s App Store.

You may come across alternative phrases like “app store marketing” or “mobile app SEO,” but they all refer to the same thing.

The goal is to maximize the visibility (and downloads) of your app for relevant searches – basically, SEO for your mobile app rather than your website.

In many ways, the optimization process for ASO is very similar to SEO; in others, not so much.

Ultimately, ASO aims to maximize app installs while product development works on monetization, engagement, retention, etc.

An effective app store optimization strategy keeps new users coming in while your development team (hopefully) keeps existing ones active and spending.

Advertisement

With the right retention rates, app store optimization acquires the new users you need to drive meaningful growth.

The goal of ASO is nearly always app downloads, but supplemental goals can include items such as:

  • Increased brand exposure.
  • Positive app reviews and ratings.
  • More frequent and increased volumes of app reviews.
  • Audience engagement.
  • Additional marketing channel diversification.

How Does App Store Optimization Work?

If you’re new to app store optimization, it might help to think of it as SEO for your mobile app.

Except, rather than optimizing a website to show in search engines, you’re optimizing your mobile app listings for the relevant app stores.

In this sense, you could argue ASO is more like optimizing a Google Business Profile to show in Maps and local results.

The other key difference is you’ve got two major mobile app stores to optimize for: Google Play and Apple’s App Store.

These aren’t the only two app stores worth considering, especially if you’re developing apps for other devices (TVs, games consoles, etc.), but they are the biggest – by far.

Advertisement

According to Statista insights from Q3 2022, here are the top three app stores based on the number of available apps:

  • Google Play: 3.55 million.
  • Apple App Store: 1.64 million.
  • Amazon Appstore: 0.48 million.

As a result, most ASO guides focus on optimizing app listings for Google Play and Apple App Store. Aside from being the top two platforms, the optimization process is a little different for each.

This is mostly due to each app store having its own algorithm – much like different search engines.

In practice, most app store algorithms are more alike than they are different. So, the basic principles of app store optimization apply to all of them. However, some stores may use the odd ranking signal that others don’t.

To keep this guide simple, we’ll start by running through the most common ranking signals for app stores, in general.

Then, we’ll take a closer look at Google Play and Apple App Store to see how they’re different.

Organic Optimization: Your ASO Foundation

The key ingredient missing from many ASO marketing delivery approaches is organic search optimization and integration of app stores within the broader organic marketing mix.

Advertisement

There is more overlap between ASO and SEO than direct competition between the two.

The integration of these areas, and the application of consistent focus on ASO, can support numerous search marketing gains.

You may be surprised to discover that many of the traditional search engine optimization tactics that work for search engine performance, such as Google and Bing, can also be directly applied to ASO.

Examples of this include:

  • App name, title, and URL optimization.
  • Keyword research for ASO.
  • App rating and reviews generation and handling.
  • Deep linking within mobile apps.
  • Indexation of Apps in Google search engine results pages (SERPs).
  • Click-through rate (CTR) optimization.

The biggest marketing mistake, however, when it comes to integrating SEO and ASO is overlooking the role of the website in driving volumes of referral visits directly to your store page and app downloads section.

Your website should be seen as the driving force behind leading people throughout the information-seeking and buying funnel from your main online entity (your website) through to an engaged, ready-to-buy/download audience (your app store).

As content levels are limited within the app stores themselves, the more you can leverage your website content to increase app awareness and discovery to build external app authority and visibility, the greater the value, traffic, and downloads your app will receive.

Advertisement

The Most Important App Store Ranking Factors

Like search engines, app stores don’t reveal the details of their algorithms to the public.

That being said, the following seven ranking factors are key, functional components of all major app stores:

  • App name or title.
  • App descriptions (including keywords).
  • Installs.
  • Engagement.
  • In-app purchases and events.
  • User reviews.
  • Updates.

You can break these ranking factors into three categories: discovery, conversion, and validation.

Discovery signals help app stores connect your app with relevant searches. This includes your app name /title, description, keywords, and other contextual signals.

Conversion signals tell app stores that your listing compels users to download your app – a strong indicator that your listing should show for more relevant searches.

Finally, you’ve got validation signals (engagement, in-app purchases/events, reviews, reports/flags, etc.). These help app stores determine whether users get a positive experience after installing your app.

Positive validation signals (strong engagement, positive reviews, etc.) are an even stronger indicator that app stores should show your app to similar users.

Advertisement

What Do Users Want From An App Store Listing?

Optimizing your app listing for visibility is one thing; getting users to actually download your app is something else entirely.

The catch-22 here is that installs directly impact your ranking in app stores.

The more people install your app, the higher it should rank. This, in turn, should result in more installs, higher rankings once again – and so forth.

So, what are the key factors on your mobile app page that determine whether users hit the install button?

  • App icon: On most app stores, your app icon is the most visually prominent element on results pages and recommendation lists.
  • App details: This includes your app name/title and, usually, some short descriptive text explaining the purpose of your app.
  • App rating: Most platforms show the average rating/review score for your app in search results and at the top of your app listing page.
  • App description: With Google Play and the App Store, users can see a brief description on your listing page and they can click to see the full description – so that first sentence or two is crucial.
  • Visuals: This includes any feature images, screenshots, and demo videos that you can add to your listing, showcasing the key benefits and user experience of your app.
  • User reviews: Unless users are already familiar with your app, they’re probably going to browse through some reviews from existing users.

Here, you can see this in action.

Screenshot from Google Play, February 2024App Store Optimization Elements for ASO

Much like SEO, app store optimization is a careful balance of optimizing to maximize visibility in app stores while prioritizing the needs of your users.

Google Play Vs. App Store: Key Differences

Google Play and the App Store are more similar than different when it comes to app store optimization.

Firstly, the ranking factors are very similar, and the differences are mostly technical – for example, Google and Apple handle keywords differently.

Advertisement

Here’s a quick summary of the main ranking factors for Google Play and the App Store.

App Store Google Play
Listing Listing
App name App title
Subtitle Short description
Long description
Keywords (app name, keyword field) Keywords (all inputs), incl. keyword density
Ratings & reviews Ratings & reviews
Listing CTR Listing CTR
App performance App performance
Downloads Downloads
Engagement Engagement
Uninstall rate Uninstall rate
In-app purchases In-app purchases
Updates Updates

As you can see, there’s not much of a difference here – in fact, most of your time will be spent on things like specifications for icons, videos, and other assets for each app listing.

As a general rule, Apple is more strict with its developer guidelines and it’s usually harder to get an app approved for the App Store.

So, if you’re promoting iOS and Android apps, optimizing your listings for Apple’s guidelines will often satisfy both app stores while maintaining consistency and reducing workload.

Now, let’s take a closer look at app store optimization for Google Play and, then, the App Store.

App Store Optimization For Google Play

To give your app listing the best possible start, you’ll want to dedicate the most time to the following nine elements:

Advertisement
  • App title.
  • App category.
  • App descriptions.
  • App icon.
  • Feature graphic.
  • Screenshots.
  • Promo video.
  • App rating and reviews.
  • Google Play Android Vitals.

We’ll take a closer look at optimizing each of these elements, but always refer to official Google guidelines while managing app listings for Google Play.

App Title

Optimizing your app title for Google Play will feel familiar if you’re used to optimizing website titles for search.

You want to start with the product/branded name of your app and then include a brief description – in no more than a few words – using your primary keyword.

Google Play SearchScreenshot from Google Play, February 2024Google Play Search

You can use up to 30 characters in your app title, but try to keep it as short and punchy as possible.

Prioritize accuracy over keyword targeting and highlight the key benefits of using your app.

App Category

Selecting the right category for your app is essential for matching with relevant searches.

For example, let’s say you’re promoting a heart rate monitoring app. In this case, “Health and Fitness” is the most appropriate category.

Google Play example 2Screenshot from Google Play, February 2024Google Play example 2

When users specifically search for “heart rate monitor,” the keywords in your title are a stronger signal.

However, your app category can help your app show for more general searches like “health and fitness apps” or “productivity apps.”

Advertisement

Crucially, users can also browse categories in the Google Play store to discover new apps without searching.

Google Play Categories ExampleScreenshot from Google Play, February 2024Google Play Categories Example

For more info on selecting the right app category for Google Play, take a look at this Play Console Help page.

Short & Long Descriptions

In Google Play, your app listing includes two descriptions: A short description that shows under the About this app preview and a full description that users can reveal by clicking on the arrow highlighted below.

Google Play Descriptions - ExampleGoogle Play Descriptions - Example

You can use up to 80 characters for your short description and 4,000 characters for your full description.

In your short description, try to describe the core functionality of your app in the most compelling way possible.

Accuracy is key here, but you want to convince users to install your app – so highlight the most attractive benefits.

Your full description provides a more in-depth summary of what your app offers.

Advertisement

Remember that most people won’t click through to read the full description, and those who do are looking for information, not a sales pitch.

You’ll find Google’s official guidelines for creating app descriptions under the “App descriptions” section of this Play Console Help page.

App Icon

App icons show on the left side of search listings in Google Play and the top-right of app listing pages.

Google Play App Icon ExampleGoogle Play App Icon Example

These are the most prominent elements on app store results pages.

Ideally, you want an app icon that either visually describes the role of your app or leverages your brand image as a differentiator.

Designing a unique icon is more challenging if your app has a specific purpose and many competitors – e.g., a heart monitoring app.

Advertisement

Google Play example 3Google Play example 3

If this applies to your app, use design principles like contrast to make your listing stand out from other results.

Notice how Pulse App’s Heart Rate Monitor app stands out from the other listings above?

This is thanks to a combination of simple iconography with strong contrast, using a black background to stand out from the white Google Play results page.

Compare this to the REPS app, which uses similar iconography without a black background, and the Bodymatter app, which uses a black background but a more complex design.

Google Codelabs has an excellent tutorial on designing and previewing app icons. It includes best practices and tips for making an icon that stands out on results pages and the latest Android features, such as adaptive icons.

Feature Graphic And Promo Video

Feature graphics show on your app listing page and can also show for branded searches, paid ads, or recommendation sections on Google Play.

Advertisement

Until recently, you could only use images as featured graphics, but you can now use promo videos in their place.

Google Play Feature Screenshot from Google Play, February 2024Google Play Feature

This is one of the most visible assets on your Google Play listing, so use feature graphics to capture attention and showcase the best of your app.

Google suggests:

“Use graphics that convey app or game experiences, and highlight the core value proposition, relevant context, or story-telling elements if needed.”

You’ll find more guidance on creating feature graphics under the Preview assets section of this Play Console Help page.

App Screenshots

App screenshots show in the same horizontal panel as feature graphics on your app listing page.

They’re designed to showcase the best features of your apps while showing users what the in-app experience looks like.

Google Play Screenshot ExampleScreenshot from Google Play, February 2024Google Play Screenshot Example

You can include descriptive text in your screenshots to emphasize the key benefits of your app’s most important features.

Keep things descriptive, though.

Advertisement

Google prohibits the inclusion of performative or ranking text in screenshots, such as “app of the year” or “most popular…” and promotional information like “10% off” or “free account.”

If your app supports multiple languages, you’ll need to provide screenshots for each language version, including any translated descriptive text.

See the screenshots section of this Play Console Help page for more info.

App Ratings & Reviews

App ratings show prominently in results and at the top of the app listing pages in Google Play. Besides this, you’ve also got a prominent Ratings and reviews section as the largest element on your listing page.

Google Play Rating ReviewsScreenshot from Google Play, February 2024Google Play Rating Reviews

Aside from being a ranking factor, app ratings and reviews are one of the biggest trust factors that help users choose which apps to install.

You don’t need perfect review scores but a positive (3.5+ stars) is a great asset for rankings and installs.

Your review profile also allows users to view the feedback left by others – and how you respond. Once again, how you deal with user problems is often more important than the scores or feedback itself.

Advertisement

You’ll need a framework in place for generating regular reviews and replying to them, engaging with reviewers, and solving user issues.

Your replies are also visible, so avoid generic responses – show new, potential users how good you are at dealing with problems.

In fact, don’t take inspiration from Google’s own support team for Google One. Privacy is great, but the tone of the reply below is more dismissive than helpful, and the exact same response appears throughout replies.

Google Play Review ExampleScreenshot from Google Play, February 2024Google Play Review Example

This feedback can also help you develop a stronger product, and users often edit their reviews, following updates or resolved tickets.

Always remember: Long-term revenue is the goal, which starts with quality app experiences, engagement, and retention.

Google Play Android Vitals

Google provides an extensive toolkit for optimizing your mobile app. Its Android vitals initiative sets out the most important usability metrics that affect the visibility of your app on Google Play.

If you’re used to optimizing websites for search, this will sound a lot like Google’s Core Web Vitals.

Advertisement

The principle Android vitals is similar in terms of performance affecting your search ranking, but this is a far more extensive initiative than Core Web Vitals, as it stands.

Android vitals are broken into two key components:

Core vitals

All other vitals

To maximize the visibility of your app in Google Play, keep the user-perceived crash rate below 1.09% across all devices and 8% per device, with the user-perceived ANR rate below 0.47% across all devices and 8% per device.

Google Play Bad Behaviour ExampleScreenshot from developer.android.com, February 2024Google Play Bad Behaviour Example

Take a look at the official Android vitals documentation page for more information.

App Store Optimization For App Store

For the App Store, we’ve also got nine key elements to optimize, but they’re not quite the same as Google Play:

Advertisement
  • App name.
  • App subtitle.
  • Categories.
  • Keywords.
  • Description.
  • App icon.
  • App previews.
  • Screenshots.
  • App ratings and reviews.

One of the key differences here is how the two platforms handle keywords. While Google analyzes your whole listing for keywords, Apple provides a single field for you to add keywords.

Again, always refer to official Apple documentation when optimizing listings for the App Store.

App Name

In the App Store, your app name simply provides a recognizable and memorable name for your mobile app.

You don’t need to worry about keywords or descriptive text here – that comes later.

App Store NameScreenshot from App Store, February 2024App Store Name

For now, concentrate on coming up with an app name that’s easy to remember and spell while somewhat describing what your app does.

Apple offers the following advice:

“Choose a simple, memorable name that is easy to spell and hints at what your app does. Be distinctive. Avoid names that use generic terms or are too similar to existing app names.”

You can use up to 30 characters for your app name in the App Store, but try to keep it as short and punchy as possible.

App Icon

As with most app stores, the app icon is one of the most prominent elements as users browse the iOS app store. Apple provides extensive design guidelines for app icons and it’s more strict than most.

Advertisement
App Store IconScreenshot from App Store, February 2024App Store Icon

So, if you’re promoting your app across the App Store, Google Play, and any other platforms, you might want to start with Apple first. In most cases, this makes it easiest to maintain a consistent design across all platforms.

Generally speaking, the same design principles apply. Keep it simple and impactful with intelligent use of iconography, color, and contrast.

Look at your competitors and try to come up with something that stands out from the other apps your target audience is likely to see.

Subtitle

Your app subtitle provides a brief description below the app name. Use this to highlight the purpose and benefits of your app in the most compelling way possible.

App Store SubtitlesApp Store Subtitles

This is your first opportunity to excite potential users about your app, so try to make an impression here. You’ve only got 30 characters to work with, which means punchy subtitles tend to do best.

You’ll want to test and refine your subtitles over time, paying close attention to CTRs and installs as you try different variations.

Categories

As with Google Play, categories are key for discoverability in the App Store.

Advertisement

You can assign primary and secondary categories for iOS apps to help users find your app; the primary category has the strongest weight. – so choose the most relevant one.

App Store Categories Screenshot from App Store, February 2024App Store Categories

Apple provides extensive guidance for choosing app categories. Make sure you follow Apple’s guidance because selecting the wrong categories violates the App Store guidelines.

In some cases, you may find multiple categories that match your app.

For example, if you’re running a photo-sharing social media app, you could select either Photo & Video or Social Networking as your primary category.

In such cases, Apple suggests considering the following:

  • Your app’s purpose: Your primary category should be the one that best describes your app’s main function or subject matter.
  • Where users look for an app like yours: Understanding your audience will help you identify the category in which they will likely look for your app. Will they consider your app more of a social network or a photography app?
  • Which categories contain the same type of apps as yours?: Research how similar apps are categorized — users may already know to visit these categories to find this type of app.

If multiple categories accurately reflect the purpose of your app, you’re unlikely to run into any violation issues.

At this point, it’s more a question of which category matches the search and everyday use of your app – not only to maximize visibility but also to set the right expectations for users who install your app (think engagement and retention).

Keywords

While Google Play looks for keywords throughout your app listing (similar to how Google Search analyses web pages), the App Store provides a dedicated keywords field.

Advertisement

You can use up to 100 characters to add keywords (separated by commas – no spaces) to help users discover your app. Apple offers the following advice for choosing keywords:

“Choose keywords based on words you think your audience will use to find an app like yours.

Be specific when describing your app’s features and functionality to help the search algorithm surface your app in relevant searches.”

Apple also recommends considering “the trade-off” between ranking well for less common terms versus ranking lower for popular terms.

The most popular keywords may generate a lot of impressions and traffic, but they’re also the most competitive, which can impact CTRs and installs.

App Description

Your app description should provide a short, compelling – and informative – description of your app, highlighting its main purpose and benefits.

Similar to Google Play, you can use up to 4,000 characters in your app description, but users can only see the first two lines (and most of the third) without clicking to see more.

Advertisement

Apple suggests the following:

“Communicate in the tone of your brand, and use terminology your target audience will appreciate and understand. The first sentence of your description is the most important — this is what users can read without having to tap to read more.”

App Store Description ExampleScreenshot from App Store, February 2024App Store Description Example

If you want to update your app description, you’ll have to resubmit your app listing, so it’s important to try and get this right and only make considered changes.

You can also add up to 170 characters of promotional text to the top of your app description.

Crucially, you can change this text at any time without having to resubmit your app listing, making this a great place to share the latest news and info about your app – such as limited-time sales, the latest features, or fixes from the last update.

App Previews

App previews are the App Store equivalent of promo videos.

You can add up to 30 seconds of footage to illustrate the key benefits of your app and the experience of using it.

App Store App PreviewScreenshot from App Store, February 2024App Store App Preview

Again, Apple has strict guidelines and specifications for app previews – make sure you tick all the right boxes.

As with most things, if you’re listing your app in the App Store and Google Play, getting your app preview approved for the App Store first should mean you can use the same format for Google Play – as long as you include footage from the Android version of your app.

Advertisement

Screenshots

You can add up to 10 screenshots to your app listing for the App Store.

If you don’t have an app preview, the first one to three screenshots will show in search results, so make sure these highlight the core purpose of your app.

App Store ScreenshotScreenshot from App Store, February 2024App Store Screenshot

In your remaining screenshots, you can focus on the main features or benefits of using your app.

Try to stick to one feature or benefit per screenshot to communicate each purpose clearly.

App Ratings & Reviews

Once again, app ratings and reviews are important for maximizing visibility and installs in the App Store.

If anything, user reviews are more prominent in the App Store than Google Play, but we can’t say whether this has any meaningful impact on downloads.

App Store ReviewsScreenshot from App Store, February 2024App Store Reviews

The same general principles apply here: try to develop a regular stream of reviews and manage a positive app rating.

Again, you don’t need perfect scores, but you do need to respond to user reviews and address potential issues.

Advertisement

Prioritize negative reviews and respond as quickly as possible with responses that deal with issues – avoid generic, unhelpful responses.

Extra App Store Optimization Tips

App store optimization is an ongoing process that needs ongoing attention. Getting your listings approved for app stores is only the beginning.

Maximizing visibility and – more importantly – revenue from your mobile apps requires a complete product development strategy.

Here are some final, additional tips to help you drive long-term success from app store optimization:

  • Know your KPIs: Don’t get distracted by the wrong metrics and KPIs – know what you’re optimizing for and center every decision around your business goals.
  • Prioritize user experience: Visibility is one thing, but you’re not going to maximize it or take full advantage of it if people uninstall your app or rarely use it – so make sure quality product development and UX design are at the heart of your ASO strategy.
  • A/B test key app store elements: Test and optimize the most important elements on your app listings to increase visibility, CTRs, installs, and retention (descriptions, videos, screenshots, reviews, etc).
  • Master each app store’s analytics system: Google Play and the App Store both provide capable (albeit in different ways) analytics systems to help you improve visibility, revenue, and product quality – so make full use of them.
  • Promote your app with ads: Both Google and Apple provide dedicated ad systems for their respective app stores to get your app in front of more eyes.
  • Promote your apps outside of app stores: Use other marketing channels to promote your apps – social media, app directory websites, app review websites, affiliate marketers, tech publications, etc.
  • Localize your app listings: App stores can connect you with global audiences, but only if you optimize your listings for each target language and location (this is called localization) – with translated text, screenshots, videos, etc.

Conclusion

The mobile app industry still shows growth despite smartphone penetration being way past saturation.

Smartphones aren’t the only devices in people’s lives anymore, either.

Apple Vision Pro launched with over 600 compatible apps, opening another space for mobile experiences beyond the confines of traditional smartphones.

Advertisement

App store optimization (ASO) will become more complex as new devices and app stores emerge.

However, the rewards will also grow, and the companies already mastering ASO for today’s app stores will be first in line to benefit as emerging technologies bring new opportunities.

More Resources:


Featured Image: Billion Photos/Shutterstock

Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address

SEO

How to Use Keywords for SEO: The Complete Beginner’s Guide

Published

on

How to Use Keywords for SEO: The Complete Beginner’s Guide

In this guide, I’ll cover in detail how to make the best use of keywords in three steps:

  1. Finding good keywords: keywords that are rankable and bring value to your site.
  2. Using keywords in content and meta tags: how to use the target keyword to structure and write content that will satisfy readers and send relevance signals to search engines.
  3. Tracking keywords: monitoring your (and your competitors’) performance.

There’s really a lot you can do with just a single keyword, so at the end of the article, you’ll find a few advanced SEO tips.

Once you know how to find one good keyword, you will be able to create an entire list of keywords.

1. Pick relevant seed keywords to generate keyword ideas

Seed keywords are words or phrases that you can use as the starting point in a keyword research process to unlock more keywords. For example, for our site, these could be general terms like “seo, organic traffic, digital marketing, keywords, backlinks”, etc.

There are many good sources of seed keywords, and it’s not a bad idea to try them all:

Advertisement
  • Brainstorming. This involves gathering a team or working solo to think deeply about the terms your potential customers might use when searching for your products or services.
  • Your competitors’ website navigation. The labels they use in their navigation menus, headers, and footers often highlight critical industry terms and popular products or services that you might also want to target.
  • Your competitors’ keywords. Tools like Ahrefs can help you discover which keywords your competitors are targeting in their SEO and paid ad campaigns. I’ll cover that in a bit.
  • Your website and promo materials. Review your website’s text, especially high-performing pages, as well as any promotional materials like brochures, ads, and press releases. These sources can reveal the terms that already resonate with your audience.
  • Generative AI. AI tools can generate keyword ideas based on brief descriptions of your business, products, or industry (example below).

Here’s what you can ask any generative AI for, whether that’s Copilot, ChatGPT, Perplexity, etc.

Next, paste your seed keywords into a tool like Ahrefs Keywords Explorer to generate keyword ideas. If you’re using Ahrefs, you can go straight into Keywords Explorer, get AI suggestions there, and start researching right away.

Using Keyword Explorer's AI feature to generate keyword ideas.Using Keyword Explorer's AI feature to generate keyword ideas.

Next, make sure you’ve set up the country in which you’ll want to rank and hit “Search”.

1715273766 703 How to Use Keywords for SEO The Complete Beginners Guide1715273766 703 How to Use Keywords for SEO The Complete Beginners Guide

After hitting the “Search” button, go to the Matching terms report. You will see a big list of keywords.

Matching terms report in Ahrefs.Matching terms report in Ahrefs.

The list you’ll get will be quite raw — not all keywords will be equally good and the list will likely be too big to manage. Next steps are all about refining the list because we’ll be looking for target keywords — the keywords that will become the topic of your content.

2. Refine the list and cluster

The next step is to refine your list using filters.

Some useful basic filters are:

  • KD (Keyword Difficulty): how difficult it would be to rank on the first page of Google for a given keyword.
  • Traffic potential: traffic you can get for ranking #1 for that keyword and other relevant keywords (based on the page that currently ranks #1).
  • Lowest DR (Domain Rating): plug in the DR of your site to see keywords where another site with the same DR already ranks in the top 10. In other words, it helps to find “rankable” keywords.
  • Target: one of the main use cases is excluding keywords you already rank for.
  • Include/Exclude: see keywords that contain specific words to increase relevancy/hide keywords with irrelevant words.

For example, here’s how to find potentially rankable keywords with traffic potential above 300 monthly visits. Go to the Matching terms report in Keywords Explorer and set filters: keyword difficulty filter (KD) to your site’s Domain Rating, Traffic potential, and Volume filters to a minimum of 300.

Using filters to find the best keywords.Using filters to find the best keywords.

Clustering is another step to refine your list. It shows you if there is another keyword you could target to get more traffic (aka parent topic). At the same time, it shows which keywords most likely belong on the same page.

For example, here are some clusters distilled from low-competition topics about marketing.

Clustering keywords by parent topic. Clustering keywords by parent topic.

Pro tip

Take keyword trends into account when choosing keywords.

For example, the keyword “is affiliate marketing legit” is at 8.8k monthly search volume right now, but based on our forecast in Keywords Explorer (the orange part of the chart), if it continues its current growth rate it should be more than triple next year.

Advertisement
Keyword forecasting feature. Keyword forecasting feature.

The graphs will also show you if the search volume is affected by seasonality (fluctuations in search volume throughout different times of the year).

Identifying keyword seasonality on a search volume graph.Identifying keyword seasonality on a search volume graph.

4. Identify search intent and determine value for your site

Before investing time in content, make sure you can give searchers what they want and that the keywords will attract the right kind of audience.

To identify the type of page you need to create to satisfy searchers, look at the top-ranking pages to see what purpose they serve (are they more informational or commercial), or simply use the Identify intents AI feature in Keywords Explorer.

Identify intents AI feature in Ahrefs.Identify intents AI feature in Ahrefs.

So, for example, if the top-ranking pages are ecommerce pages and you’re not offering products on your site, it’s going to be very hard to rank.

Then, ask yourself if visitors attracted by a keyword will be valuable to your business — whether they’re likely to subscribe to your newsletter or make a purchase. At Ahrefs, we use a business potential score to evaluate this.

Business potential score. Business potential score.

Finally, if a keyword checks all boxes, add it to a keyword list.

Adding a keyword to a list in Ahrefs.Adding a keyword to a list in Ahrefs.

Now you’ve got a list of relevant, valuable target keywords with traffic potential ready for content creation. You can repeat the process as many times as you like with different seed keywords or different filters and find new ideas.

There’s one more great source of keywords — competitors.

5. Enrich the list with your competitors’ keywords

In this step, we’ll do a content gap analysis to find keywords your competitors already rank for, but you don’t.

First, let’s find your competitors.

Advertisement
  1. Enter your domain in Ahrefs’ Site Explorer and go to the Organic competitors report.
  2. Select the most relevant competitors and click on Copy (this copies URLs — we’ll use them in another tool).
Organic competitors report in Ahrefs.Organic competitors report in Ahrefs.

Next, we’ll see which keywords you’re missing.

  1. Go to Ahrefs’ Competitive Analysis tool, paste the previously copied URLs, enter your domain on top and hit Show keyword opportunities.
Competitive analysis tool in Ahrefs.Competitive analysis tool in Ahrefs.
  1. In the Content gap report, use filters to refine the report.
  2. Select keywords and add them to your list.
Content gap report in Ahrefs.Content gap report in Ahrefs.

Pro tip

If you stumble across two similar keywords there’s an easy way to determine if they belong on the same page.

  • Enter the keyword in Keywords Explorer.
  • Scroll to SERP overview, click Compare with, and enter the keyword to compare with.
SERP overview feature in Ahrefs.SERP overview feature in Ahrefs.
  • Fewer common results and low SERP (Search Engine Result Page) similarity mean separate pages should target the two keywords.
SERP overview feature in Ahrefs showing SERP similarity score. SERP overview feature in Ahrefs showing SERP similarity score.

Once you have your target keyword, you can include it in relevant places in your on-page content, including:

  • Key elements of search intent (content type, format, and angle).
  • URL slug.
  • Title and H1.
  • Meta description.
  • Subheadings (H2 – H6).
  • Main content.
  • Anchor text for links.

And, just so we’re on the same page, the target keyword is the topic of the content and the main keyword you’ll be optimizing for and tracking later on.

Use the target keyword to determine the search intent

Search intent is the reason behind the search. Understanding it tells you what users are looking for and what you need to deliver in your content.

To identify search intent, look at the top-ranking results for your target keyword on Google and identify the three Cs of search intent:

  • Content type – What is the dominating type of content? Is it a blog post, product page, video, or something else? If you’ve done that during the keyword research phase (highly recommended), only two elements to go.
  • Content format – Some common formats include how-to guides, list posts, reviews, comparisons, etc.
  • Content angle – The unique selling point of the top-ranking points, e.g., “best,” “cheapest,” “for beginners,” etc. Provides insight into what searchers value in a particular search.

For example, most top-ranking pages for “avocado seed” are blog posts serving as how-to guides for planting the seed. The use of easy and simple angles indicates that searchers are beginners looking for straightforward advice.

Dominating intent on a SERPDominating intent on a SERP

Use the target keyword in the URL slug

A URL slug is the part of the URL that identifies a specific page on a website in a form readable by both users and search engines.

If you look at the URL of the page you’re on, that will be the last part, “how-to-use-keywords-seo”.

Advertisement
https://ahrefs.com/blog/how-to-use-keywords-seo

Google says to use words that are relevant to your content inside page URLs (source). Usually, the easiest way to do that is to set your target keyword in the slug part of the URL.

Example of a user-friendly URL slugExample of a user-friendly URL slug

Use the target keyword in the title and match it with the H1 tag

A title tag is a bit of HTML code used to specify the title of a webpage.

<title>How to Use Keywords for SEO: A-Z Guide For Beginners</title>

The H1 tag is an HTML heading that’s most commonly used to mark up a web page title.

<h1>How to Use Keywords for SEO: A-Z Guide For Beginners</h1>

Both are very important to Google and searchers. Since they both indicate what the page is about, you can just match them, like I did in this article.

Titles help Google understand the context of a page. What’s more, even a slight improvement to your title can improve your rankings.

Higher ranking just by changing the title of a page. Higher ranking just by changing the title of a page.
My colleague Chris Haines made a small change in the tile and jumped 3 positions.

Google advises focusing on creating good titles, which should be “unique to the page, clear and concise, and accurately describe the contents of the page” (source). It’s hard to think of a better way to accurately describe the contents other than using the target keyword.

If it makes sense for the title, aim for an exact match of the keyword. But if you need to insert a preposition or break the phrase, this won’t make Google think your page is less relevant. Google understands close variations of the keyword really well, so there’s no need to stuff in similar keywords, misspellings, etc.

To illustrate, my old article on how to see keywords that Google Analytics won’t show ranks #1 for many variations of the phrase in the title.

Advertisement
Article header - example of using target keyword in the title. Article header - example of using target keyword in the title.
Keyword variations of the target keyword. Keyword variations of the target keyword.

Use the keyword in meta description

However, don’t write meta descriptions solely for Google; Google rewrites them more than half of the time (study) and doesn’t use them for ranking purposes. Instead, focus on crafting meta descriptions for searchers.

These descriptions appear in the SERPs, where users can read them. If your description is relevant and compelling, it can increase the likelihood of users clicking on your link.

Including your target keyword in the meta description is usually natural. For instance, consider the description of the article mentioned earlier. Incorporating the keyword into the sentences simply provides a comprehensive way to describe the issue.

Example of a meta description. Example of a meta description.

Use the target keyword to find secondary keywords

Secondary keywords are any keywords closely related to the primary keyword that you’re targeting with your page.

You can find them through your primary keyword and use them as subheadings (H2 to H6 tags) and talking points throughout the content. Here’s how.

Go to Keywords Explorer and plug in your target keyword. From there, head on to the Related terms report and toggle between:

  • Also rank for: keywords that the top 10 ranking pages also rank for.
  • Also talk about: keywords frequently mention by top-ranking articles.
Also rank for and also talk about reports in Ahrefs. Also rank for and also talk about reports in Ahrefs.

Now, to know how to use these keywords in your text, just manually look at the top ranking pages and see how and where they cover the keywords.

For example, looking at one of the top articles for “digital marketing”, we can see right away that some of the most important aspects are the definition, a template and importance. You can use the free Ahrefs SEO Toolbar to break down the structure of any page instantly.

Content structure displayed in Ahrefs SEO Toolbar. Content structure displayed in Ahrefs SEO Toolbar.

Another place you can look for inspiration is the People Also Ask Box in the SERPs. Use it to find words and subtopics that may be worth adding to the article.

People Also Ask box in Google SERPs.People Also Ask box in Google SERPs.

Pro tip

Optimizing an existing article?

Advertisement

Use the Content Gap tool to find subtopics you may be missing. The tool shows keywords that your competitors’ pages rank for, and your page doesn’t.

  • Go to Keywords Explorer and enter your target keyword.
  • Scroll down to the SERP overview, select a few top pages, and click Open in Content Gap.
Accessing content gap via a shortcut in Keywords Explorer. Accessing content gap via a shortcut in Keywords Explorer.
  • In Content Gap, click on Targets and add the page you’re optimizing in the last field.
Content gap tool in Ahrefs Site Explorer. Content gap tool in Ahrefs Site Explorer.

Use primary and secondary keywords in the main content

To rank high on search engines, it’s important to include your keywords in your text. Even though Google is good at understanding similar words and variations, it still helps to use the specific keywords people might search for. Google explains that in their short guide to how search works:

The most basic signal that information is relevant is when content contains the same keywords as your search query. For example, with webpages, if those keywords appear on the page, or if they appear in the headings or body of the text, the information might be more relevant.

When writing, it’s important to incorporate keywords naturally. Start your content with the most relevant information that people are likely to search for. This ensures that key points are immediately visible to your readers and search engines.

Close variations of the target keyword included naturally in the intro.
Close variations of the target keyword included naturally in the intro.
Close variations of the target keyword included naturally in the intro.

If you have a secondary keyword that’s less critical but still relevant, consider giving it a dedicated section. This approach allows you to explore the topic in detail, rather than briefly mentioning it at the end of your content.

Secondary keywords included in subheadings. Secondary keywords included in subheadings.
Secondary keywords included in subheadings.

However, avoid overemphasizing the frequency of your keywords. Effective SEO involves more than just repeating keywords. If SEO were simply about keyword density, it would be straightforward, but such strategies don’t lead to long-term success and can make your content feel spammy.

For instance, if ‘content strategy’ is a central theme of your discussion and you mention it only once, Google might perceive your content as incomplete. On the other hand, stuffing your article with the term ‘content strategy’ more than necessary won’t outperform your competitors and could potentially lead to your site being flagged as spam.

Use the target keyword in link anchor text and/or surrounding text

The anchor text or link text is the clickable text of an HTML hyperlink.

Google uses anchors to understand the page’s context. There even seems to be a consensus that anchor text is a ranking factor, although, according to our study, it is likely a weak one.

Advertisement

In situations like these, it’s just best to stick with Google’s advice:

Good anchor text is descriptive, reasonably concise, and relevant to the page that it’s on and to the page it links to. It provides context for the link, and sets the expectation for your readers. (…)

Remember to give context to your links: the words before and after links matter, so pay attention to the sentence as a whole.

So use the target keyword in the anchor text and or surrounding text but keep it natural — add only on pages that are related to the page you’re linking to and use text that will help the readers understand where and why you’re linking.

1715273771 346 How to Use Keywords for SEO The Complete Beginners Guide1715273771 346 How to Use Keywords for SEO The Complete Beginners Guide
For example, on this page about “content optimization” there’s a link including “featured snippets” in the anchor, which is also the target keyword of the page linked to.

Rank tracking refers to monitoring the positions of a website’s pages in search engine results for specific keywords.

It’s pretty much an automated process; everything can be handled by a tool like Ahrefs’ Rank Tracker. No need to check rankings manually and note them down in a spreadsheet.

If you have a keyword list ready, all you need to do is add that list to Rank Tracker.

Advertisement
Adding keywords to a rank tracking list.Adding keywords to a rank tracking list.

The keywords will appear in Rank Tracker’s Overview report.

Rank Tracker’s Overview report. Rank Tracker’s Overview report.

Another way to add keywords is to hit Add keywords in the top right corner (best for adding single keywords or importing a list from a document).

Adding single keywords or keywords from a list.Adding single keywords or keywords from a list.

Now to compare your performance against competitors, just go to the Competitors report. The metric I recommend tracking is SOV (Share of Voice). It shows how many clicks go to your pages compared to competitors.

Share of Voice metric in Ahrefs. Share of Voice metric in Ahrefs.

One of the key advantages of SOV is that it accounts for fluctuations in search volume trends. Therefore, if you notice a decrease in traffic but maintain a high SOV, it indicates that the drop is due to a decrease in the overall popularity of the keywords, not a decline in your SEO effectiveness.

But not only can you track your competitors’ keywords, you can also monitor them. Use a tool like Ahrefs Alerts to get notifications whenever your competitors started working for a new keyword.

Just to go Alerts tool in Ahrefs and fill in the details.

Alerts feature in Ahrefs. Alerts feature in Ahrefs.

There’s even more you can do with keywords and a bit more you should know to avoid some common mistakes.

1. Use keywords to find guest blogging opportunities

Guest blogging is the practice of writing and publishing a blog post on another person or company’s website.

It’s one of the most popular link building tactics with a few other benefits like exposure to a new, targeted audience.

Advertisement

Here’s how to find relevant, high-quality sites to pitch:

  1. Go to Ahrefs’ Content Explorer.
  2. Enter a broad keyword or phrase related to your niche.
  3. Select In title from the drop-down menu.
  4. Run the search.
Finding guest post opportunities using Ahrefs' Content ExplorerFinding guest post opportunities using Ahrefs' Content Explorer

Next, refine the list by applying these filters:

  • Domain Rating (DR) from 30 to 60.
  • Click the One page per domain filter.
  • Click the Exclude homepages filter.
  • Click the Exclude subdomains filter.
Narrowing down Content Explorer's results using filters
Narrowing down Content Explorer's results using filters

Finally, click on the Websites tab to see potential websites you could guest blog for.

Using the "Websites" tab to find the best guest blogging opportunities.
Using the "Websites" tab to find the best guest blogging opportunities.

2. Use keywords to find internal link opportunities

Internal links take visitors from one page to another on your website. Their main purpose is to help visitors easily navigate your website, but they can also help boost SEO by aiding the flow of link equity.

Finding new internal link opportunities is also a time-consuming process if done manually, but you can identify them in bulk using Ahrefs’ Site Audit. The tool takes the top 10 keywords (by traffic) for each crawled page, then looks for mentions of those on your other crawled pages.

Click on the Internal link opportunities report in Site Audit.

Internal link opportunities tool in Ahrefs.Internal link opportunities tool in Ahrefs.

You’ll see a bunch of suggestions on how to improve your internal linking using new links. The tool even suggests exactly where to place the internal link.

Ahrefs' Site Audit showing where to add internal link
Ahrefs' Site Audit showing where to add internal link

3. Use keywords to find link building opportunities

Link building is the process of getting other websites to link to pages on your website. Its purpose is to boost the “authority” of your pages in the eyes of Google and help your pages rank.

A good place to start is to pull up the top-ranking pages for your target keyword and research where they got their links from.

Put your keyword into Keywords Explorer and scroll down to the SERP overview. You’ll see the top-ranking pages and their number of backlinks (and linking domains).

Backlinks to the top-ranking pages for "best productivity apps".Backlinks to the top-ranking pages for "best productivity apps".

Once you click on any of the backlink numbers, you’ll be redirected to a list of backlinks of a given page in Site Explorer.

Backlinks report in Site Explorer.Backlinks report in Site Explorer.

From that point, the typical process involves identifying sites with the highest potential to boost your SEO and contacting their owners if you think they’d be willing to link to your content. We’re covering the details of this process and everything else you need to know to start with link building in this guide.

4. Avoid common keyword pitfalls

Four big don’ts of using keywords.

Advertisement
  • Don’t use the same keyword excessively on a page. Repeating a keyword too frequently within a single page can lead to keyword stuffing, which is treated as spam by Google.
  • Don’t use the same focus keyword across multiple pages. Each page on your website should have a unique focus keyword. Using the same keyword across multiple pages can lead to keyword cannibalization, where pages compete against each other in search results.
  • Don’t sacrifice quality content for keyword usage. While keywords are essential for SEO, prioritize high-quality, informative content above all else. Don’t make your content read unnatural or too long by cramming in keywords. This won’t help you rank and will decrease content quality.
  • Don’t use keywords just for the sake of using them. This means two things. First, don’t target keywords not related to your website or business — this will only bring you useless traffic. Second, don’t try to hit some keyword frequency goal which is often suggested by content optimization tools by just mentioning the keyword without any substance — SEO doesn’t work that way anymore.

Final thoughts

This article focused on general SEO for text-based content. For using keywords in other types of content and SEO, see these guides:

Got questions or comments? Find me on X or LinkedIn.



Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
Continue Reading

SEO

Google Launches New ‘Saved Comparisons’ Feature For Analytics

Published

on

By

Businessman analyzes page data

Google announced a new tool for Analytics to streamline data comparisons.

The ‘saved comparisons’ feature allows you to save filtered user data segments for rapid side-by-side analysis.

Google states in an announcement:

“We’re launching saved comparisons to help you save time when comparing the user bases you care about.

Learn how you can do that without recreating the comparison every time!”

Google links to a help page that lists several benefits and use cases:

“Comparisons let you evaluate subsets of your data side by side. For example, you could compare data generated by Android devices to data generated by iOS devices.”

“In Google Analytics 4, comparisons take the place of segments in Universal Analytics.”

Saved Comparisons: How They Work

The new comparisons tool allows you to create customized filtered views of Google Analytics data based on dimensions like platform, country, traffic source, and custom audiences.

These dimensions can incorporate multiple conditions using logic operators.

For example, you could generate a comparison separating “Android OR iOS” traffic from web traffic. Or you could combine location data like “Country = Argentina OR Japan” with platform filters.

These customized comparison views can then be saved to the property level in Analytics.

Advertisement

Users with access can quickly apply saved comparisons to any report for efficient analysis without rebuilding filters.

Google’s documentation states:

“As an administrator or editor…you can save comparisons to your Google Analytics 4 property. Saved comparisons enable you and others with access to compare the user bases you care about without needing to recreate the comparisons each time.”

Rollout & Limitations

The saved comparisons feature is rolling out gradually. There’s a limit of 200 saved comparisons per property.

For more advanced filtering needs, such as sequences of user events, Google recommends creating a custom audience first and saving a comparison based on that audience definition.

Some reports may be incompatible if they don’t include the filtered dimensions used in a saved comparison. In that case, the documentation suggests choosing different dimensions or conditions for that report type.

Why SEJ Cares

The ability to create and apply saved comparisons addresses a time-consuming aspect of analytics work.

Advertisement

Analysts must view data through different lenses, segmenting by device, location, traffic source, etc. Manually recreating these filtered comparisons for each report can slow down production.

Any innovation streamlining common tasks is welcome in an arena where data teams are strapped for time.

How This Can Help You

Saved comparisons mean less time getting bogged down in filter recreation and more time for impactful analysis.

Here are a few key ways this could benefit your work:

  • Save time by avoiding constant recreation of filters for common comparisons (e.g. mobile vs desktop, traffic sources, geo locations).
  • Share saved comparisons with colleagues for consistent analysis views.
  • Switch between comprehensive views and isolated comparisons with a single click.
  • Break down conversions, engagement, audience origins, and more by your saved user segments.
  • Use thoughtfully combined conditions to surface targeted segments (e.g. paid traffic for a certain product/location).

The new saved comparisons in Google Analytics may seem like an incremental change. However, simplifying workflows and reducing time spent on mundane tasks can boost productivity in a big way.


Featured Image: wan wei/Shutterstock



Source link

Advertisement
Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
Continue Reading

SEO

Automate Multi-Site Reporting With Google Sheets And GSC API

Published

on

By

Illustration of a modern workspace setup with a desktop showing Google Sheets, a mobile device with documents, a calculator, and a target with arrows on a yellow background.

Working in SEO leads to interesting challenges that I’m sure you’ve all faced at one point.

You’re a master of flexibility and managing tedious tasks. I’ve recently found myself dealing with 100+ top-tier sites.

Working with global companies, it’s quite the puzzle to:

  • Wrangle data for 100+ sites.
  • Keep tabs on every site’s performance.

And, since some of these sites compete against each other on the first page of Google, it’s quite possible that Site 1’s traffic drops but Site 2 captures the loss.

Checking one site’s Google Search Console (GSC) is easy, but it’s intense with hundreds of sites at a global scale.

What Can You Do?

I devised a Google Sheets Apps Script that connects to GSC’s API to transform global reporting from an arduous task that can take days – or weeks – into one that takes a few minutes.

Advertisement

After creating the script, I can easily put in a date range and pull each site’s:

  • Clicks and impressions.
  • Keywords.
  • Average rankings.
  • Etc.

Since we manage hundreds of sites, it’s not uncommon for users to end up on one of our sites to make their purchase, as mentioned above.

In the grand scheme of things, the bigger picture is more important than an individual site’s performance.

What I’m going to show you is my 10-step process to create a script that pulls clicks and impressions and then compares it all year over year (YoY).

10-Step Process To Create A Google Sheets Apps Script For Reporting On Hundreds Of Sites

Step 1: Creating Your Google Sheets

Screenshot from author, April 2024

Your first step is to create your original Google Sheets file. You can do this by following these steps:

  • Go to Google Drive.
  • Navigate to the folder where you want to place the files.
  • Right-click on the background
  • Select > Google Sheets > Blank Spreadsheet.

You’ll want to rename the file. I called mine “Global Search Console Reporting.”

step 1 name google sheets fileScreenshot from author, April 2024

Your file is now set up, and you’re ready for the next step.

Step 2: Setting Up Your Google Sheet

A blank sheet isn’t useful and won’t make sense to users until you add some headers in Row 1. Headers that I recommend adding, in this order and bolding, are:

  • Website.
  • Niche.
  • Clicks.
  • Impressions.
  • YoY Clicks.
  • YoY Impressions.
  • Clicks % Difference.
  • Impressions % Difference.

Your file should now look something like this:

step 2 add column headersScreenshot from author, April 2024

Your next step is to create a Google Cloud Project, which is also fairly simple and straightforward.

Step 3: Create A Google Cloud Console Data Project

Creating your project should be free because Google provides a $300 credit to try out its platform. If you haven’t used Google Cloud, you can find it at https://console.cloud.google.com/.

Advertisement

You can now follow these steps:

  • Tap Select Project > New Project.
  • Enter Project Name (example: “My GSC Data Project”).
  • Tap Create.
step 3 google console projectScreenshot from author, April 2024
  • Click Select Project.
  • Select your Project.

step 3 select project

  • Click the top Search bar.
  • Type “Google Search Console API.
  • Select “Google Search Console API.”
  • Click Enable.

step 3 search console api

Step 4: Create Apps Scripts In Google Sheets

In this step, we will work on integrating the Apps Script into the Google Sheet that you created previously. You’ll need to open the Sheet and follow these steps:

  • Tap Extensions > Apps Script.

step 4 create apps script

I’m not going to go into the details on how the script works, but you can copy this code:

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Or DocumentApp or FormApp.
  ui.createMenu('Search Console')
    .addItem('Fetch Data', 'menuItem1')
    .addToUi();
}

function menuItem1() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var lastRow = sheet.getLastRow(); // Find the last row with data in column A

  // Clear cells C2:F151 before processing data
  sheet.getRange("C2:F151").clearContent();

  for (var i = 2; i <= lastRow; i++) { var siteProperty = sheet.getRange(i, 1).getValue(); var startDateValue = sheet.getRange('M1').getValue(); var endDateValue = sheet.getRange('M2').getValue(); var timeZone = SpreadsheetApp.getActiveSpreadsheet().getSpreadsheetTimeZone(); var format = "yyyy-MM-dd"; // Calculate dates for last year var lastYearStartDate = new Date(startDateValue); lastYearStartDate.setFullYear(lastYearStartDate.getFullYear() - 1); var lastYearEndDate = new Date(endDateValue); lastYearEndDate.setFullYear(lastYearEndDate.getFullYear() - 1); var startDate = Utilities.formatDate(lastYearStartDate, timeZone, format); var endDate = Utilities.formatDate(lastYearEndDate, timeZone, format); // Fetch data for the previous year var previousYearResponse = requestSearchConsoleAPI(siteProperty, startDate, endDate); // Fetch data for the current year (unchanged) startDate = Utilities.formatDate(new Date(startDateValue), timeZone, format); endDate = Utilities.formatDate(new Date(endDateValue), timeZone, format); var currentYearResponse = requestSearchConsoleAPI(siteProperty, startDate, endDate); // Process and write data for both years processAndWriteData(sheet, i, previousYearResponse, currentYearResponse); } } function processAndWriteData(sheet, row, previousYearResponse, currentYearResponse) { // Check if response is not defined or null and has at least one row if (previousYearResponse && previousYearResponse.length > 0) {
    var previousYearClicks = 0;
    var previousYearImpressions = 0;

    previousYearResponse.forEach(function(row) {
      previousYearClicks += row.clicks;
      previousYearImpressions += row.impressions;
    });

    sheet.getRange(row, 5).setValue(previousYearClicks); // Write to column D (index 5)
    sheet.getRange(row, 6).setValue(previousYearImpressions); // Write to column E (index 6)
  } else {
    Logger.log('No data found for previous year in row: ' + row);
  }

// Process and write data for the current year
  if (currentYearResponse && currentYearResponse.length > 0) {
    var currentYearClicks = 0;
    var currentYearImpressions = 0;

    currentYearResponse.forEach(function(row) {
      currentYearClicks += row.clicks;
      currentYearImpressions += row.impressions;
    });

    sheet.getRange(row, 3).setValue(currentYearClicks); // Write to column C (index 3)
    sheet.getRange(row, 4).setValue(currentYearImpressions); // Write to column D (index 4)
  } else {
    Logger.log('No data found for current year in row: ' + row);
  }
}



function requestSearchConsoleAPI(siteProperty, startDate, endDate) {

  try {
    const oauthToken = ScriptApp.getOAuthToken(); // Correctly call the method
    const siteUrl = siteProperty;
    const url="https://www.googleapis.com/webmasters/v3/sites/" + encodeURIComponent(siteUrl) + '/searchAnalytics/query';
    const payload = {
      startDate: startDate,
      endDate: endDate,
      type: 'web'
    };

    const headers = {
      'Authorization': 'Bearer ' + oauthToken,
      'Content-Type': 'application/json'
    };
    const options = {
      'method': 'post',
      'contentType': 'application/json', // Consistent content type
      'headers': headers,
      'payload': JSON.stringify(payload),
      'muteHttpExceptions': true
    };

    const response = UrlFetchApp.fetch(url, options);
    const responseCode = response.getResponseCode();
    const contentText = response.getContentText(); // Get response text for logging

  Logger.log('Response Code: ${responseCode}'); // Use backticks
  Logger.log('Response Content: ${contentText}'); // Use backticks


  if (responseCode === 200) {
    const json = JSON.parse(contentText);
    Logger.log(json); // This will log the actual JSON response
    return json.rows; // Adjust this line based on the actual structure of your API response
  } else {
    // Correctly use backticks here for template literals
    const errorMessage="Error fetching data: ${responseCode} - ${contentText}";
    Logger.log(errorMessage);
    throw new Error(errorMessage);
  }

  } catch (e) {
    Logger.log('Error: ${e.toString()}');
    return null;
  }
}

And then go back to your Apps Script project and do the following:

  • Press CTRL + A to select all.
  • Press CTRL + V to paste in the code you copied.
  • Tap OK.
  • Click Save project.
  • Tap Run.

*Note: If you are receiving a Bad Request error from Google with too many redirects, this is because you have multiple accounts logged in. Try in a browser with only one Google account logged in.

step 4 save run apps scriptScreenshot from author, April 2024

You’ll be requested to Review permissions and will need to select the Google Account associated with your Google Search Console.

Google will give you a warning because the app isn’t verified, so simply tap on the “Advanced” setting and then “Go to Untitled project (unsafe).”

step 4 unsafe appScreenshot from author, April 2024

Finally, you can complete this step by tapping or clicking on the Allow button.

Step 5: Set Up The Access Credentials

I know there’s a lot of back-and-forth going on between Sheets and Google Cloud Console, but it’s an unfortunate necessity at this point. Now, we will be setting up Access Credentials, which will require you to go back to the Google Cloud Console.

Advertisement

Note: You must have enabled the Google Search Console API from the previous step.

Your screen should look something like this:

step-5 oauth concent screenScreenshot from author, April 2024

You’ll need to:

  • Tap Credentials > Create Credentials.
  • Tap OAuth client ID > Configure Consent Screen.

step 5 create credentials oauth

  • Click External.
  • Tap Create.
  • Enter “My GSC Data” as the App name.
  • Add your Support email (your email used for GSC).
  • Add your Developer contact information (the email you used for GSC).
  • Tap Save and continue.
  • Tap ADD OR REMOVE SCOPES.
  • Check 2 of the Google Search Console API scopes (might be on page 2).

step 5 add gsc api scope

  • Click Update.
  • Click Save and Continue.
  • Now click Add Users.

step 5 add users

  • You can add multiple users, preferably those that have access to GSC.
  • Save and Continue.

Step 6: Set Up Google Cloud Project For GSC Data

While we’re still on the Google Cloud Project, you’ll want to click the hamburger icon and go to Cloud overview > Dashboard:

step 6 cloud dashboardScreenshot from author, April 2024

You’ll notice that it says “Project number,” which you should select and Copy by pressing CTRL + C.

Switch back to your Apps Script tab and tap Project Settings:

step 6 app settingsScreenshot from author, April 2024

Go to the section titled Google Cloud Platform (GCP) Project, paste the project number (CTRL +  V) into the text box, and click Set project.

Step 7: Rename Your Google Apps Script

You’ll now want to rename your Apps Script by going to Project History like this:

step 7 project name

You’ll then:

  • Click Untitled project at the top of the screen.
  • Enter “My GSC Data Project Script.”
  • Click on Rename.

Step 8: Edit Google Apps Manifest File For Code.gs Script

You’re still staying inside of your script, and we’re going to go back to Project Settings just as we did before.

This time, you’ll want to click Show “appsscript.json” manifest file in editor to make sure there’s a checkmark next to it.

Advertisement

Next, click on Editor and navigate to the appsscript.json, which you can see below:

step 8 edit appscript jsonScreenshot from author, April 2024

You’ll want to delete everything in the appsscript.json file and paste in the following script:

{
  "timeZone": "America/New_York",
  "dependencies": {
  },
  "exceptionLogging": "STACKDRIVER",
  "oauthScopes": [
    "https://www.googleapis.com/auth/webmasters",
    "https://www.googleapis.com/auth/script.external_request",
    "https://www.googleapis.com/auth/spreadsheets",
    "https://www.googleapis.com/auth/spreadsheets.currentonly"
  ]
}

Once you’ve added the code, you can click on your Code.gs file and tap Save, and then Run. You’ll be prompted to review permissions, and you’ll need to select your appropriate account to continue using.

After a few prompts, you’ll be asked to allow your app “My GSC Data,” and execution will begin.

Step 9: Adjust The Dates For Website Data Analysis

In the Google Sheets file, you’ll want to add the following under:

  • L1: Start Date.
  • L2: End Date.

Note: The start and end dates should be specified in M1 and M2. For example, you can input:

Note: The date format may differ based on your system settings and location.

Step 10: Set Conditional Formatting For Non-Empty Cells Less Than Zero

Everything is set up, but you should add some conditional formatting to make it look better. We’re going to focus on the “Clicks % Difference” and “Impressions % Difference” columns:

Advertisement
step 10 clicks impressionsScreenshot from author, April 2024

Select the rows under the headers “Clicks % Difference” and “Impressions % Difference” and click on Format > Conditional formatting. Under Format rules, you’ll want to select Less than.

In the “Value or formula” text area, you can add 0.

What this does is that if it’s less than 0, we’ll be changing the color to red since it’s in the negative and traffic has been lost. You can do this by clicking on the paint can and changing it to red before clicking done.

If you want to change a positive increase in traffic to green, you’ll add another rule for Greater than and add the 0 value.

Here are the formulas to use in G2 and H2 (you can replicate them for each row; just click and drag down for the other rows):

=IFERROR(IF(AND(C2<>"",E2<>""), (C2-E2)/E2, ""),"")
=IFERROR(IF(AND(D2<>"",F2<>""), (D2-F2)/F2, ""),"")

Now, you have an easy way to run reports on multiple sites at once.

That’s It, You Have Your Global Report

In column A, input your Google Search Console properties; if it is a domain property, add it as sc-domain:example.com or a URL property as https://example.com

Advertisement

To run or refresh the report, use the special menu Search Console > Fetch Data:

final step run

*Note: This script supports about 150 domains, but if you need more, you can adjust the row #14 in your AppScripts file:

sheet.getRange("C2:F151").clearContent();

Using this very tutorial, you’ll have an easy time turning days of gathering data and running reports into a few minutes. You can even expand the scripts to perform other calculations or gather more data for your report.

Check out my other tutorial on Integrating ChatGPT With Google Sheets.

Automating your reports is a great way to streamline tedious tasks, and I hope it makes your job a little easier.

More resources: 


Featured Image: 200dgr /Shutterstock

Advertisement

Source link

Keep an eye on what we are doing
Be the first to get latest updates and exclusive content straight to your email inbox.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
Continue Reading

Trending

Follow by Email
RSS