Category: Google

Auto Added by WPeMatico

Google AdSense earnings report may be buggy

Google AdSense publishers have been complaining this morning that the report that shows their estimated earnings on the AdSense console overview page is wrong and significantly lower than what is expected. It seems there is some sort of bug with the report on the overview page, but the reports within the reporting tab seem to be more aligned with expected publisher earnings.

The complaints. There are a number of complaints in the AdSense forums that have concerned publishers worried that something is wrong and their AdSense earnings have dropped significantly from what they normally see on a daily or monthly basis. There is one thread that has the most detail, which can be found over here.

A top contributor, not a Google employee but a volunteer recognized by Google as someone who is helpful in the forums, wrote “Looks like there are issues with the statistics on the main dashboard page (it’s happening to my account too): go to the Reports tab which seems to be showing the accurate figures.”

Don’t panic. There is no need to panic, just yet, it seems like this is a widespread issue where many publishers are waking up to these reporting glitches. Google has yet to confirm that there is a bug but it seems like the reports are not all matching up and there may be some reporting pipeline delay.

Why we care. If you noticed your AdSense earnings are unusually low this morning from the overview page report, you are not alone. Dig into the reporting tab to confirm the estimated earnings look accurate and you can alway reach out to AdSense support for help.

We have yet to receive a confirmation from Google on the issue, but if and when we do, we will update this story.

Postscript. Google has confirmed the issue over here saying “We’re aware of a problem with AdSense affecting a majority of users. We will provide an update by Feb 23, 2022, 7:00 PM UTC detailing when we expect to resolve the problem. Please note that this resolution time is an estimate and may change. The affected users are able to access AdSense, but may not have access to the most recent data. AdSense is currently double-counting metrics when using the Sites dimension / breakdown.”


Get the daily newsletter search marketers rely on. See terms.


The post Google AdSense earnings report may be buggy appeared first on Search Engine Land.

Read More
Jason February 23, 2022 0 Comments

Google testing questions and answers in the Google Maps interface

Google is testing displaying the questions and answers feature in the Google Maps interface that it initially launched in 2017 for local panels in Google Search. Now some are able to see the questions and answers box in Google Maps local listings for businesses, although I cannot personally replicate this.

What it looks like. Allie Margeson posted a screenshot of this on Twitter:

Previously. Google only launched this officially in desktop search, on mobile search, or on Android Google Maps. This was not available in the Google Maps interface on desktop. Here is what it looks like in on desktop search:

Why we care. It is important for any business to keep tabs on the questions and answers section in the local listings because anyone can ask any question and anyone can post any answer. So you want to make sure to proactively provide accurate answers and ensure the answers given are also accurate. Now that this may also show up directly in Google Maps on desktop, it is even more important to stay on top of your questions and answers in local.

The post Google testing questions and answers in the Google Maps interface appeared first on Search Engine Land.

Read More
Jason February 18, 2022 0 Comments

Google launches Google Business Profiles calls API

Google has quietly released a new Google Business Profiles API for obtaining call history data from your Google Business Profiles programatically. The new API is available over here and is awkwardly named “My Business Business Calls API.”

New API. The new API lets you query Google to obtain your call history data that you can currently see in your Google Business Profile manager under the “calls” section. The call history section is has been around for about a year in the user interface, but now has API access.

The My Business Business Calls API manages business calls information of a location on Google, known as Google Business Profiles now. Google said to call this service, Google recommends that you use the Google-provided client libraries. If your application needs to use your own libraries to call this service, use the following information when you make the API requests.

We expect the API’s capabilities to grow over time, this is just version 1 of this specific API.

CRMs. This data can be very valuable to pull into your CRM, customer relationship management, software. To know that a lead came through Google Maps and Google Search by pulling in the call history data can be very useful. It is worth investigating what data you can get from this new API and how you can use that data to supplement the data you have in your CRM.

Other Google Business Profile APIs. Google lists a number of APIs available as well on the left hand bar of that page. They include:

  • Account Management API
  • Business Calls API
  • Lodging API
  • Place Actions API
  • Notifications API
  • Verifications API
  • Business Information API
  • Q&A API

Why we care. Here is another way of obtaining sales and lead data in a programatic manner. If you do this manually, you can now at least automate some of the data gathering by using this new API. Hopefully this data can be used to help your sales and marketing teams perform they daily tasks.

The post Google launches Google Business Profiles calls API appeared first on Search Engine Land.

Read More
Jason February 17, 2022 0 Comments

Webinar: Your guide to scoring Google 5-star reviews

Now more than ever, customers seek out information about your business online. If you don’t offer the experience your customer is looking for, your reputation may be at stake.

Discover how A&W Restaurants achieved a 25% increase in 5-star reviews on Google in six months and how you can achieve similar results or more.

To learn more on how you can boost your Google reviews, register today for “Your Guide to Scoring Google 5-Star Reviews for Multi-Location Businesses,” presented by Chatmeter.

The post Webinar: Your guide to scoring Google 5-star reviews appeared first on Search Engine Land.

Read More
Jason February 14, 2022 0 Comments

Shopify SEO Guide: How to increase organic traffic to your store

This guide was first published on May 21, 2020. It was updated to include new information on February 4, 2022.

Optimizing your Shopify store for Google, Bing and other search engines is critical for helping potential customers discover your site. Many of the tenets of search engine optimization (SEO) are based on providing users with a positive experience. The easier it is to discover and use your Shopify store, the more likely people are to shop with you.

The fundamentals covered in our SEO guide also apply to Shopify SEO, but there are some tricks involved in getting a Shopify site fully optimized for search. There are also nuances and other factors to be mindful of when evaluating the platform’s SEO capabilities.

Get the Periodic Table of SEO Factors

In this guide, we address the SEO fundamentals and technical considerations to improve your Shopify store’s search rankings to increase traffic and sales.

Shopify SEO basics

Shopify’s page editor. Shopify’s content management system (CMS) has a page editor with a simple user interface to build landing pages, collections pages, product detail pages and blog posts.

Shopify’s page editor.

The page editor allows for basic formatting options, headings, tables and the ability to edit in HTML. You can also upload photos and embed videos to the pages.

The search engine listing preview section automatically generates a page title and meta description based on the content you enter in the page details section. By default, your page title is used for the title tag and H1 and your description is used for the meta description. Site owners can overwrite these automated defaults by modifying their search engine preview section.

Page titles are an important ranking factor. They provide search engines with information about the contents of your page and they often appear as the headline for your search result.

Meta descriptions are often what appear under the title in search results. They should summarize the content of the page for prospective customers, and can help improve click-throughs to your site.

The Shopify page editor allows you to manually revise your titles and descriptions. If you’re not content with the ones automatically generated, optimize them to include the keywords you’d like to rank for and appeal to customers browsing the search results.

Analytics. Shopify sites are compatible with two very useful, free tools: Google Search Console and Google Analytics. Google Search Console helps site owners monitor and troubleshoot their site’s presence in Google search results, and provides data on the queries that are leading prospects and customers to your pages. Google Analytics shows you how people arrived at your site and behaved once they got there. Search Console and Analytics are critical tools for SEO.

To connect your Shopify store to Google Search Console, you’ll need to add a piece of code to your homepage (Shopify has a great video on this). There are two things to keep in mind when verifying your Search Console account for your Shopify store: Google will only index the current theme and only if the theme is live and not password protected (new merchants often password-protect their sites because they’re not yet ready for launch).

Setting up Google Analytics is as simple as enabling it in your Shopify site preferences, acquiring your tracking ID and pasting it into the associated field within Shopify.

[Pro Tip] Use Shopify’s URL structure to help segment your analysis

Thanks to Shopify’s strict URL structure, it’s easy to segment certain types of content in Google Search Console, Google Analytics, etc. For example, if you want to see how your products are performing, simply filter your data by URLs that contain “/products/” and voila! The same trick works for collections (/collections/), blog posts (/blogs/), and pages (/pages/).

-Kevin Wallner, founder, First Chair Digital

Domain and security. You can buy a custom domain through Shopify; the platform even has a free tool to check domain name availability and generate alternative domain names. If you don’t want a custom domain, your site’s URL will be yoursitename.myshopify.com. Having your own custom domain is much better branding, conveys more professionalism and greatly increases your chance of ranking well in searches for your business’ name.

If you opt for a custom domain, check that your .myshopify.com domain redirects to your primary domain by logging into your Shopify account and heading to Settings > Domains (within the left-hand navigation menu). Your primary domain should say “Traffic from all your domains redirects to this primary domain.” If it does not, click on “Enable redirection.” Doing this will help to ensure that search engines only show your primary domain to searchers, instead of presenting both the primary and the .myshopify.com domain.

All Shopify plans also come with an SSL certificate, which encrypts data sent between your site and its visitors. This is important because Google gives a small ranking boost to secure sites and because many browsers will display a security warning when users attempt to visit a site without an SSL certificate. You can check this one off your worry list.

Site speed. Site speed and security are Google ranking factors, and they go hand-in-hand with user experience. Slow load times may lead customers to bounce before your page loads, which means they won’t be buying from you.

Selecting a lightweight theme for your Shopify store can help you get a head start on your speed optimizations. Loading times can vary across themes, said Chris Long, director of e-commerce at Go Fish Digital, during our Shopify SEO session of Live with Search Engine Land.

His agency found that the average theme takes approximately 3.8 seconds for First Contentful Paint (FCP), makes 171 requests and weighs in at about four megabytes. If you’ve already selected a Shopify theme, those benchmarks can help you gauge whether your store is performing below or above the mean.

If you haven’t selected a theme, or are considering switching themes, Long has compiled a list of the top-performing Shopify themes according to FCP and Time to Interactive (TTI) and the late Hamlet Batista also published a list of page speed scores for numerous Shopify themes.

Shopify features a content delivery network (CDN) that can help keep page load times down no matter where in the world your customers are browsing. Even so, it’s in your best interest to compress your images (more on that below) and implement lazy loading functionality to shave down your loading times as much as possible.

Instead of loading all your images the instant a visitor lands on your page, lazy loading enables the visitor’s browser to load images as they scroll, decreasing the upfront load time. “It’s actually exceptionally easy for developers to implement in most cases,” Long said.

Being conservative with your Shopify apps (more on that below) can also help you manage page load times. And, tools such as Google’s PageSpeed Insights can help you identify more opportunities to increase site speed by suggesting different image formats and other speed optimizations.

Image optimization. Since e-commerce stores typically feature many product photos, image optimization is key. Even with Shopify’s CDN, image file size can disproportionately increase page load times.

Selecting the appropriate format to compress your images is one way to keep file sizes under control: JPEGs will generally result in smaller file sizes than PNGs, which are more suitable when you need a transparent background in your image.

Every image should have an alt attribute assigned to it. Image alt text provides search engines with more context as to what the page is about, which can improve relevance and thus rankings. Additionally, the alt text is read aloud for site visitors that rely on screen readers, so adding it will help you comply with digital accessibility standards.

The edit alt text feature for images in Shopify

From your Shopify admin, alt text can be added by navigating to the desired product detail page and clicking the desired image or media item. A media preview page will open and you can click “Add alt text” to edit the field. Once you’re done, save the alt text and exit the preview page.

Store owners can use image optimization apps (more on Shopify apps in the next section) to automate some of these tasks. TinyIMG SEO Image Optimizer has hundreds of five-star reviews and can help keep your load times down by compressing your images.

Shopify does provide an image sitemap, which helps Google find your images so that they may potentially appear in image search results and provide searchers with one more way to discover your products. However, Shopify’s image sitemap only includes one image per product and does not include additional metadata. To get more of your images indexed, Kevin Wallner, founder of First Chair Digital, recommends the Image Sitemap app, which can build, submit, monitor and update XML sitemaps for all the images in your store.

Shopify apps. One big advantage of a platform like Shopify is the app ecosystem that makes it easy to add more features and tools to your site with little to no coding. There are apps to help you manage inventory, take customer support tickets, run affiliate programs and, yes, optimize your site for search.

Shopify has dozens of SEO apps, including Yoast SEO, which offers much of the same functionality as its well-known WordPress counterpart. Yoast SEO can help you control your titles and descriptions in Google Search and social media and provide feedback on readability. It can also help you implement structured data, which can come in handy as structured data is used to power product information in image search results, which may, in turn, help you guide searchers from Google’s image results directly to your product page.

In 2021, both Google and Bing launched Shopify integrations. These integrations are actually apps (the Google Channel and Microsoft Channel apps) and they both allow merchants to include their products in Google’s and Bing’s free product listings. This is a welcome addition for Shopify retailers since these integrations make it easier for them to get greater search visibility without necessarily needing to rely on an expert. And, both apps can also be used to launch shopping campaigns, in case you want to advertise your offerings.

There are also plenty of other apps that can help you do things like add product reviews to give customers more information about what you’re selling, which search engines may use to show star ratings that can improve your clickthrough rates.

Before you load up on apps, keep in mind that they add extra code to your site. Apps that load on the user’s end, such as some that enable you to customize your store’s design, may slow the site down.

Sitemaps. Sitemaps contain information about your pages and files and are used by search engines to crawl and index your site — this process enables your pages to appear in search results. Shopify automatically generates a sitemap.xml file, with links to your pages, products, images, collections and blog posts, for all sites. After verifying your Google Search Console account, submit your sitemap to Google to help it find and index your pages.

Crawl optimization. For merchants that want to control which pages get crawled, Shopify now lets site owners edit their robots.txt files. This can be used to disallow certain URLs from being crawled, add extra sitemap URLs, block crawlers and so on.

International domains. In March 2021, Shopify launched international domains, enabling merchants to sell to more than one country using a single account. Merchants can now configure subdomains and language folders for international targeting. When you do so, Shopify automatically adds hreflang tags to your store, which can help save you time.

Local SEO

Since the onset of the COVID pandemic, more local merchants have made their way to Shopify. If your business serves a locale, ensure that you have an online presence wherever customers may go to look for businesses like yours, be it Google, Bing, Facebook or other platforms.

While your Shopify website will complement your local efforts, the range of options for local search optimization warrants numerous standalone articles. As a jumping-off point, check out our how-to guide on optimizing your Google local knowledge panel.

Technical SEO for Shopify

Search engines work by “crawling” websites, meaning that they look through a site’s code and URLs to discover each page on the site. That information is then added to the search engine’s index to be ranked and served as a result when someone conducts a relevant search.

Technical SEO refers to the optimizations that facilitate the crawling and indexing aspects of search. Technical optimizations can include your site’s architecture, URL structure and JavaScript.

Shopify enables store owners to bypass many of the technical aspects of launching an e-commerce site by providing pre-made themes with Shopify’s framework as the structure. However, that structure is rigid and in some instances, does not provide a straightforward way to make certain technical optimizations.

Being aware of the technical SEO challenges inherent to Shopify can help you find workarounds for a number of issues and inform prospective store owners about the trade-offs that come with building their store on Shopify.

Below are the most common technical SEO challenges that Shopify store owners encounter. Solutions to these issues are discussed in our Technical SEO for Shopify guide.

Duplicate pages. Collections help group products together into categories, making it easier for customers to find them. They’re also an inherent property of the Shopify framework.

When you associate a product page with a collection page (as the vast majority of merchants are likely to do), Shopify will generate a second URL for that product page. For some of the free themes, this means you’ll have two URLs for the same product. The URLs you end up with will look something like this:

  1. /collections/shirts-collection/products/blue-shirt
  2. /products/blue-shirt

Duplicate pages can split your link-building power as referrers may link to either URL. Duplicate content can also make it harder for search engines to determine which URL to index and rank. While Shopify has remedied this issue for some of its free themes, canonicalizing the duplicate, some themes may still be affected, so we’re leaving this guidance in place, just in case.

Internal linking. The duplicate pages issue mentioned above can also show up in your internal links. In the image below, Shopify uses two different links to direct customers to the same product detail page.

internal linking for face mask products
The left image shows the link for a face mask as it appears on the store’s homepage. The right image is the link for the same face mask as it appears in the recommended products section of another product page.

While internal links don’t directly play into Google’s algorithms, they do direct link equity to your product detail pages. That link equity gets diluted when it is spread across multiple links and search engines will have a harder time understanding which one is the primary URL.

Architecture issues. Shopify automatically generates the URL for your product detail pages using the following structure: myshopifystorename.com/products/product-name. Store owners can only modify that last part of the URL, where the product’s name (which is derived from the page title) appears.

Shopify search engine listing preview
Shopify automatically generates URLs for product and collection pages. Store owners can only modify the last part of the URL (indicated in green).

URLs are a minor ranking factor, so you’ll want to use descriptive words in your URLs to inform search engines about your page, but also to give potential customers an idea of what they’re clicking through to. Removing the “/products” or “/pages” URL paths gives you more space to include those descriptive keywords; unfortunately, Shopify doesn’t have that option out-of-the-box. There are, however, solutions, such as Cloudflare and their Cloud Worker interface, that can be implemented with the help of a developer, as discussed in our Technical SEO for Shopify guide.

Product schema. Schema is a type of structured data that can help search engines understand your site’s content. Search engines also use schema to generate rich snippets, which can provide your products with greater visibility in the search results.

For example, Google uses product schema in image search results to display a product’s price, its availability and star ratings.

product schema for Bombas socks, showing items in stock
Bombas, a Shopify store, uses schema to indicate that a product is in stock.

Google’s Popular Products section is another search feature that uses schema to provide potential customers with product information, although it is currently only available for apparel and fashion items.

[Pro Tip] Use schema and Google Merchant Center for additional organic visibility

With an app like Feed for Google Shopping or ShoppingFeeder, you can sync your entire product inventory with Merchant Center. Once you’re in Merchant Center, if you enable ‘Local Surfaces Across Google’ in Programs, your products can instantly appear in Maps results when people search product keywords . . . Surfaces Across Google creates a Google-hosted storefront, so you might see a decline in visitors in your Shopify analytics if customers are browsing products on Google instead; however, these visitors can be tracked in Merchant Center.

–Lachlan Wells, Berlin-based SEO consultant

Product schema is built into most Shopify themes. The default theme, “Dawn,” supports the following schema types: “Organization,” “WebSite,” “Article” and “Product.”

However, there may be additional structured data types, such as recipe or FAQ schema, that you’d like to add but are not supported by your theme. In that case, you can edit the structured data code within your theme, dynamically inject structured data using JavaScript or install a dedicated schema app. Whichever method you choose, you can verify if your pages are marked up correctly using Google’s Structured Data Testing Tool.

SEO, beyond products and category pages

Creating valuable, informative and engaging content can help increase your store’s organic visibility. Content can give search engines more information about your site and prospective customers more ways to discover your business. More visibility can mean more traffic and more sales.

The pages every store should have. It’s highly recommended that you create an “About us” and “Contact” page; these pages help potential customers get familiar with your business and enable them to get in touch with you to resolve concerns before and after they buy from you.

Additionally, a dedicated page for your shipping information, return policy, privacy policy, terms and conditions and frequently asked questions can also enable you to communicate important details and may even reduce the amount of time spent answering redundant questions. You can also add a mission statement or “Our Story” page to help distinguish your brand from others.

You can set up a blog on your Shopify store as a home for content that helps to differentiate your brand, supplement your transactional pages and earn backlinks.

Keyword research. Keyword research helps you understand how your target audience searches — for the kinds of products you sell, the types of problems they’re looking to solve and other queries that are relevant to your business. You can then use these words to inform your content strategy and optimize your pages.

There are a number of keyword research tools that help indicate how popular queries are, seasonal trends and related terms. Google Trends analyzes search query interest, which can be filtered by time and geographic region, displays related queries and allows you to compare interest between different keywords. You can also examine the auto-suggested queries that populate in the search bar on Google, Bing and Amazon to get more keyword ideas.

Google Ads and Microsoft Advertising offer in-depth keyword tools that include monthly search volume and competition estimates and suggested bid amounts. Google Keyword Planner and Microsoft Keyword Planner are designed for advertisers, but they are both free to use and provide a wealth of information.

You’ll also want to evaluate what the search results look like for the keywords you’re researching. The “People also ask” box and the “Searches related to” section can supplement your keyword research.

Take a look at the search results and features present on the page to get an idea of what search engines are surfacing for that set of terms. Are the results filled with news articles, signaling an informational intent, or are they businesses selling products similar to yours? If it’s the latter, you have a higher chance of ranking for those keywords.

Related: Common Shopify SEO Pitfalls and how to avoid them

E-commerce content ideas. Providing your audience with pertinent content can help them get more value from your products or services while also signaling relevance to search engines. Here are a few content ideas that might help you get started:

  • How-to’s and tutorials can inform your customers about how your products or services work. Consider creating a video to demonstrate these points; you can then upload it to YouTube and embed it on your blog post or product detail page to encourage visitors to shop with you.
  • Behind-the-scenes content can bolster your branding and give customers a reason to shop with you over competitors. For example, if you sell vegan cookie dough, you could create a video that demonstrates how you test new recipes to teach customers about your process while getting them excited for upcoming flavors.
  • Case studies can separate your business from a crowded field of competitors. If you’re selling tie-dye t-shirts, for example, you could create a video detailing how your shirts’ colors hold up against competing brands, wash after wash.

Looking for more ways to optimize and market your Shopify store? Check out these resources:

The post Shopify SEO Guide: How to increase organic traffic to your store appeared first on Search Engine Land.

Read More
Jason February 5, 2022 0 Comments

Functions for Core Web Vitals Tactics with Cloudflare’s HTMLRewriter

Our Guide to A/B Testing for Core Web Vitals explained a series of small steps with two services and a browser extension to write tests for frontend code tactics. Thirty years ago, we would copy a page’s raw source to run find-and-replace operations until we could manage a facsimile of a page put in a web-enabled folder to demonstrate the same kinds of recommendations.

We don’t have to do that anymore.

Setting up a reverse proxy and writing software for conducting SEO twenty years ago was limited to a small set of companies that built and hosted the infrastructure themselves. Cloudflare now provides us with a turnkey solution. You can get up and running using a free account. To change frontend code, use Cloudflare’s HTMLRewriter() JavaScript API.

The code is relatively easy to comprehend.

With Core Web Vitals, it’s the immediacy, the perceived need and the rapidity of being able to cycle through varying tests that ultimately shows value and really impresses. The fundamental platform is available to you through the steps outlined in our guide. We’ll write functions for making commonplace changes so that you can begin testing real tactics straight away.

HTMLRewriter()

If you’ve been following along, you may know our script provides the option to preload an element that you can specify in a request parameter for LCP. We return a form when the value is missing, just to make it easy to add your reference. There is also a placeholder for something called importance, which we’ll be addressing as well. What’s important is to understand what we’re going to do.

The HTMLRewriter() API gives us the ability to use jQuery-style element selectors to attach to HTML elements in raw page source to run JavaScript from that foothold. You’ll be able to modify elements, a whole group of elements or even the base document in powerful ways. You can edit a page’s title, for example. In production, your edit becomes the title and is what gets indexed at Google and Bing.

One complication you will encounter is that you can only edit raw source, not a hydrated Document Object Model (DOM). One quick way to view raw source is with the browser’s built-in view-source functionality. With Firefox, view-source highlights validation errors in red, for example. Even when browsers “fix” broken HTML, this can usually be fixed with our Worker.

Working inside DevTools, the “Sources” tab provides access to raw source. Use preference settings to always “pretty print” source, which will format it so you can scan the code to look for optimizations. Another preference tip is a setting to bypass cache when DevTools is open. This workflow will help you as you go so your optimizations don’t result in reference errors.

Element Selectors

When you spot something you want to fix with HTMLRewriter(), you’re going to need to narrow changes and isolate the element to avoid altering more code than you intend. Use the most exclusive selector possible, which can be very easy when elements have unique IDs. Otherwise, find a tell-tale sign, such as a reference to a unique location in href or src attributes.

You will find the ability to use wildcards and “command mode” vim-style regular expressions matching attribute values. You can also supply more than one criteria, even with the same attribute name. Use your vim powers to narrow matches to single elements, or match a group of elements with broader expressions. Logic can then separate concerns between changes.

Example matching wildcard “fonts.g” prefetch link elements to remove those for: fonts.googleapis.com.

.on(`link[rel="dns-prefetch"][href*="fonts.g"]`, removeEl())

Example showing two matches for the href attribute, narrowing it a single file among many.

.on('link[href^="https://example.com/static/version"][href$="/print.css"]', unblockCSS())

The first example above uses that wildcard match where the string “fonts.g” can appear anywhere in the href attribute of link elements. It’s an example for a broad match that might attach to more than one link element for an appropriate action, like removing the element(s) that match, if any.

The second example from above shows how you can select a particular link element that starts with a string, and ends with another string, but which can have anything between. This is useful for selecting a single element that is part of a build system whereby there may be a versioning token directory for browser cache-busing that is dynamically named.

Link elements

Link elements are multifaceted by virtue of their several attributes. Thus, they can serve a number of purposes. Not to be confused with links (as in anchors), link elements are typically where you start looking for quick-hitting performance strategies. Some preload and preconnect link elements may be actually getting in the way or maybe entirely unnecessary.

You only get maximum six hosts to connect simultaneously. Your first strategy will be to make the most of them. Try removing all priority hint link element statements and test the result. If timings go the wrong way, then add them back one at a time and test the real impact of each. You’re going to need to learn how to read the WebpageTest waterfall chart in-depth.

Following this, tactics go to resource loading, which also involves link elements pretty heavily, but not exclusively. At this point, we want to look at scripts as well. The order in which resources load can affect things very negatively. Our testbed is perfect for trying various tactics gleaned from reading the waterfall chart. Keep the console drawer of DevTools open to check for errors as you work.

Removing elements

Removing elements is exceptionally simple to do. Once you’ve selected an element, or a group of them, the next field in HTMLRewriter().on() statements is where you write a script block. You can do this in place with curly braces. You can reference a named function. Or you can build a new class instance for an object defined earlier, which in this context, may be over-engineering.

When you encounter sample Worker code you may see class initializers. All that’s really needed to remove and element is the following function. Anything done with a named class object can be done with a plain function (object) using less code, for fewer bugs, with more readable syntax and far more teachable. We’ll revisit class constructors when we delve into Durable Objects.

element: (el) => { el.remove(); }

In a nutshell, this block defines a variable “el” in reference to the element instance and the code block calls the built-in remove() element method, which you will find detailed in the corresponding documentation. All HTMLRewriter() element methods are available to you for use with instances of your element matches. Removing elements is one of the simpler ones to comprehend.

Unblocking render blocking resources

Unblocking script elements is much easier than unblocking stylesheet resources. As luck would have it, we have a boolean attribute for signaling the browser that we want to asynchronously load a script or defer it altogether (for when there is idle time). That’s ideal! Stylesheets, on the other hand, need a little “hack” to get them unblocked — they requires some inline Javascript.

Essentially, we turn a stylesheet link element reference into preload to unblock it. But that changes the nature of the link element to one where the style rules will not get applied. Preload downloads resources to store them in local cache, ready for when needed, but that’s it. DevTools warns you when a resource is preloaded and not used expediently — that’s when you know you can remove it!

Preloading and then using an onload attribute to run JavaScript to change it back from preload to stylesheet is the CSS “hack” to unblock what otherwise is a naturally render blocking resource. Using JavaScript’s this keyword allows you to change its properties, including the rel attribute (and the onload attribute itself). The pattern has a backfill for non-JavaScript sessions, as well.

Here is our unblockCSS() function which implements the strategy using ready-made element methods.

const unblockCSS = () => ({
element: (el) => {
el.removeAttribute('media');
el.setAttribute('rel', 'preload');
el.setAttribute('as', 'style');
el.setAttribute('onload', "this.onload=null;this.rel='stylesheet';this.media='all'");
el.after(`
<noscript><link rel="stylesheet" href="${el.getAttribute("href")}"></noscript>
`, { html: true }); }});

Select the link element stylesheet references that are render blocking and call this function on them. It allows the browser to begin downloading the stylesheet by preloading it. Once loaded, the rel attribute switches back to stylesheet and the CSS rules get immediately applied. If style problems occur after this change, then one or more sheets need to load in normal request order.

The function acts as a reusable code block. Toggle your element selections using HTMLRewriter() and test the difference unblocking CSS sheets one at a time, or in groups, depending on your approach. Utilize the tactic to achieve an overall strategy unblocking as much as you can. However, always remember to look for problems resulting from changes to CSS and Script resources.

Script priorities

The order in which you load styles can botch the design. Unexpectedly fast-loading stylesheet rules will overwrite ones more sluggishly loaded. You also have to watch while loading scripts in alternate order so that they get evaluated and are resident in memory when the document is evaluated. Reference errors can cascade to dozens or hundreds of script errors.

The best way to check for problems is to watch the console drawer and simulate slow network connections. This can exaggerate problems to the point they should be evident in DevTools. If script resources are processed using more powerful CPUs and load over cable modem speed, or faster, it is possible you’ll miss a critical error. Requests get nicely spaced out, as well.

Here is our function changing, or adding, async and defer attributes.

const makeAsyncJS = () => ({
element: (el) => {
el.removeAttribute("defer");
el.setAttribute("async", "async");
}
});

const makeDeferJS = () => ({
element: (el) => {
el.removeAttribute("async");
el.setAttribute("defer", "defer");
}
});

If a script doesn’t originally have async or defer, it’s harmless to run the removeAttribute() element method for a more reusable code block. You can safely disregard this if you’re working quickly on a one-off project where you might be writing this inline rather than calling a function you defined previously in the script.

Alt attributes for SEO

As mentioned, our Guide to A/B Core Web Vitals tactics was, by design, meant for us to have a fully functioning Edge Computing testbed up and running to demonstrate content with future SEO for Developers articles and future events. During our SMX West event last year (2021), we demonstrated using Cloudflare Workers for a website, achieving Lighthouse fireworks (scoring 100 across all its tests).

There are lots of things which need to be in place to get the fireworks. One important aspect is that all images must have valid alt attributes. The test can detect when the text in in alt attributes are “nondescript,” or present, but empty. You need words that depict what’s in the associated image. One way to do that might be to parse the file name from the src attribute.

Here is a function that extracts text from img src attributes to power alt text from filenames with hyphens.

const img_alt = element.getAttribute('alt');
const img_src = element.getAttribute('src');
if (!img_alt) {
element.setAttribute('alt', img_src.replace('-', ' '));
}

In a nutshell, this will look for the condition on images where there is no alt attribute value. When there’s a likelihood its src attribute filename is hyphenated, it will replace hyphens with spaces to formulate what may be a suitable value. This version won’t work for the majority of cases. It doesn’t replace forward slashes or the protocol and domain. This merely serves as a starting point.

Why we care

Having a testbed for trying out various Core Web Vitals Performance Optimization tactics is incredibly impressive to site owners. You should have this capability in your agency arsenal. A slight Google rankings boost with good scores is both measurable and largely achievable for most sites through tactics we will discuss and demonstrate. Tune in for a live performance March 8-9th.

SEO technicians have long recommended performance improvements for search engine ranking. The benefit to rankings has never been clearer. Google literally defined the metrics and publishes about their effect. We have Cloudflare Workers to implement Edge SEO remedies, as demonstrated here with alt attributes for images. Our reverse proxy testbed by virtue of Cloudflare sets the stage for rich communication with developers.

The post Functions for Core Web Vitals Tactics with Cloudflare’s HTMLRewriter appeared first on Search Engine Land.

Read More
Jason February 3, 2022 0 Comments

Evolving Core Web Vitals tactics using Cloudflare and WebpageTest

In our guide to Core Web Vitals tactics using Cloudflare and WebpageTest, we outlined basic requirements for using Cloudflare as a reverse proxy for testing tactical HTML changes with WebpageTest. Our version of the test is simplified from Patrick Meenan’s original concept, which uses HTMLRewriter() to select an element and modify code.

We’re going in-depth with this tutorial, but if you’re just looking for the Cloudflare Worker script, you can find it here.

Our first installment noted that it won’t keep up with changes at Search Engine Land. The LCP was hard-coded and we would need it to interact with a dynamic page and its values. While WebpageTest has, at the time of publication, the most well-thought-out waterfall chart and more details than you can imagine, it isn’t the fastest way to get results.

Lighthouse from the Command Line

Running the Lighthouse CLI (Command Line Interpreter) program with --extra-headers options needed for the test allows us to also simulate standard settings for Core Web Vitals the way we did with WebpageTest. You’ll need to work from a terminal emulator.

The easiest way to install Lighthouse is with NPM (Node Package Manager). Once installed, run the following statement:

$ lighthouse https://sel.deckart.workers.dev
--extra-headers "{"x-host":"searchengineland.com", "x-bypass-transform":"false"}"
--form-factor=mobile
--throttling.cpuSlowdownMultiplier=4
--only-categories=performance
--view

The evolution of our Testbed

Our aim is to demonstrate an evolution from an original concept for a testbed to a project suitable for our future events and articles. The testbed should not be confined to running performance evaluations; that’s just where we’ll start. But, it has to work fairly well for a number of situations with websites and this can prove pretty difficult. We’ll supply methods to help.

For example, sites often use relative paths to asset resources rather than absolute (with HTTP protocol and all). We’ll supply a block to match these so HTML will generally work. After applying this, when things still don’t work, switching troublesome references between the test and test subject hostnames often does the trick, even for CORS policy violations.

That’s where the beauty of Cloudflare’s HTMLRewriter() really shines. Site-wide assets are usually loaded as page HEAD child elements. With flexibility matching like jQuery, even similar syntax, we can select child elements of HEAD when necessary. You can use XPath selectors and regular expressions. Let’s keep it simple and look for relative paths that start with “/” for src or href attributes:

return new HTMLRewriter()
  .on('link', {
    element: el => {
      link_href = el.getAttribute('href');
      if (link_href && link_href.startsWith('/')) {
        el.setAttribute('href', 'https://' + host + link_href);
      }
    }
  })
  .on('script', {
    element: el => {
      script_src = el.getAttribute('src');
      if (script_src && script_src.startsWith('/')) {
        el.setAttribute('src', 'https://' + host + script_src);
      }
    }
  })
  .on('img', {
    element: el => {
      img_src = el.getAttribute('src');
      if (img_src && img_src.startsWith('/')) {
        el.setAttribute('src', 'https://' + host + img_src);
      }
    }
  })

We’re leveraging the power (and cost effectiveness) of Edge Computing to conduct seriously useful tests. Modify the x-host request header to load different sites in the testbed and open DevTools. Transformations may not be needed, but your mileage will vary. Frontend experience gives you a feel for it.

Comment blocks like switches will fail and require a little experimentation (which may be all you need). For example, some asset references may be spelled without HTTP colon. You would need to write another conditional to check for paths where href or src starts with “//” and then modify the selected element value in the script. Try to end up with no console errors the actual site doesn’t have.

Lighthouse gives you LCP

It’s relatively easy to retrieve LCP references using Lighthouse, PageSpeed Insights or WebpageTest. Presuming the LCP qualifies for preload, like when it’s not a <div> or a <p>, and when it isn’t already getting preloaded, provide our script the href value by URL ‘query param’ structure (or return HTML with a form) to test for changes to a page’s LCP timing with preload.

Most technical SEO practitioners are handy at modifying request query parameters to process different things in server-side programs, like Google search results. Using the same interface, our script will preload the LCP using the path you apply in the “lcp” parameter value and passes it to a function called addPreloadAfter() for interpolating HTML for the test.

async function handleRequest(request) {
  const { searchParams } = new URL(request.url);
  let lcpHref = searchParams.get("lcp");

  return new HTMLRewriter()
    .on('title', addPreloadAfter(lcpHref))
  .transform(newResponse);
}

The addPreloadAfter() function takes our “lcpHref” value from searchParams.get() and processes it as “href” to build HTML.

const addPreloadAfter = (href) => ({
  element: (el) => {
    el.after(`<link rel="preload" href="${href}" />`, { html: true });
  }
});

Notice the option “html: true”? This is an option setting Cloudflare requires for safety when using Workers with HTMLRewriter() API methods that write HTML. You are going to want to learn its capabilities and constraints for coding your own tests.

Cloudflare’s KV

If we’re ever going to do anything remotely interesting, we need a way to store persistent data between script executions. Luckily, Cloudflare also offers a neat little data storage mechanism called KV that we can bind with our Workers to store a small data ‘value‘ field, accessible by its ‘key.’ It’s surprisingly easy to comprehend and implement. To demonstrate how to use it we’ll write a quick little hit counter.

const counter = await KV.get("counter");

if (!host || counter > 1000) {
  return new Response('hit limit exceeded or x-host missing', {status: 403});
} else {
  await KV.put("counter", parseInt(counter) + 1);
}

Find the KV navigation menu item under Workers.

Add a KV Namespace and counter variable with zero for a starting value

Once you’ve created a Namespace (“SEL” is used in the example above), use the KV dashboard UI to create your first Key (‘counter‘ in the above case) and assign a starting value. Once set up, navigate back to the Worker dashboard for the interface required to bind our new KV Namespace with Cloudflare Workers so they can access Keys and the associated stored Values.

Bind KV Namespaces to Workers

Choose the Worker you want to bind with and click its Settings menu to find the submenu for Variables (directly under General). Notice you can define environment variables, Durable Object Bindings (which we’ll explore in a future installment), and finally KV Namespace Bindings. Click Edit Variables and add the Variable you want to use in script.

In the following case, you can see our redundantly named ‘KV‘ variable that we’ll be using in the associated Worker script, the one we navigated from. Our use of ‘KV‘ was named for illustrative purposes. Select it from the dropdown, save it, and you’ll immediately be able to use your variable in the script. Create as many scripts and KV Namespaces combinations as you like.

KV Namespace bindings.
KV Namespace Bindings.

The trick is remembering to bind a Variable you want used in the Worker. It’s so flexible that you can feel free to munge about and make a mess at first. You’ll probably be able to organize it into something cohesive at a later date, which is exactly what you want for being able to prototype applications or author Microservices for use in your applications.

Once you’ve gotten your KV service and starting values set up, navigate back to the Worker and open the built-in “Quick Edit.” Replace what’s there with this updated gist, which includes the hit counter, and everything else written about in this post. Click “Save and Deploy” and you should have the service up and running at your publicly available, Workers demo URL.

Why we care

Our original guide was meant to whet your appetite, get you excited to start and excited for more valuable learning. In order to supply that, we have a free platform and code combination that is simple enough to understand on its own, coupled with a process that should be easy enough to follow and achieve a test result.

Standardizing website testing to demonstrate SEO to developers shouldn’t require understanding code when you can copy and paste script into Cloudflare, follow steps and test certain SEO tactics. Core Web Vitals tests are about as reliable as we’re going to get for improving RUM (Real User Metrics) performance scores for a boost in rankings, given how metrics dependent it is.

The post Evolving Core Web Vitals tactics using Cloudflare and WebpageTest appeared first on Search Engine Land.

Read More
Jason January 24, 2022 0 Comments

Google Business Profiles sets waiting period for new owners and managers

Google updated its Google Business Profile, formerly Google My Business, help documents to say that when you add a new owner or manager to a business profile, those new users may have to wait seven days prior to being able to manage all the features of the profile.

New limits. These new limits are documented over here but I found them via Ben Fisher’s blog, where it says.

When a new owner or manager is added to an existing Business Profile, they must wait for 7 days before they can manage all the features of the profile. During this 7 day period, the new owner or manager gets an error if they try any of the following:

  • Delete or undelete a profile.
  • Remove other owners or managers from a profile.
  • Transfer primary ownership of a profile to themselves or a third user.
  • An existing owner or manager tries to transfer primary ownership of the profile to a new owner or manager still in their first 7 days.

If the new owner or manager deletes their account within the first 7 days, they’re removed from the profile. If they undelete their account, they must be added to the profile again.

Why we care. So if you added new owners and/or managers to a Google Business Profile and that user cannot manage all the features for that business listing, then this is why. It is a new limitation Google is making, maybe to increase security and prevent fraud or hack attempts.

The post Google Business Profiles sets waiting period for new owners and managers appeared first on Search Engine Land.

Read More
Jason January 12, 2022 0 Comments

Google launches ‘Shops’ section in mobile search results

Google has launched a “Shops” section in the mobile search results, a company spokesperson has confirmed to Search Engine Land. The Shops section shows three retailers (but can be expanded to show up to ten) based on their organic search rankings and is available on mobile devices for select shopping-related queries in the U.S.

The Shops section in the mobile search results. Image: Khushal Bherwani.

Tip of the hat to Khushal Bherwani for bringing this to our attention.

Google’s statement. “We recently launched Shops, a new module available on mobile devices for select US-English shopping-related queries,” a Google spokesperson told Search Engine Land, “We launched this to help present more seller options to users on Search. This feature currently shows 3 shops and users can then expand to see up to 10 merchants depending on availability. The selection of results shown and their order are based on organic search ranking.”

Another milestone for Google’s organic shopping efforts. Over the last two years, Google has expanded its shopping-related results from being a paid product to also offering plenty of visibility opportunities organically, beginning with the introduction of free product listings in April 2020.

The company has also introduced a “deals” section in the search results and launched Shopping integrations for Shopify, WooCommerce and GoDaddy, among other e-commerce platforms.

Why we care. The Shops section is another area in the search results where retailers might potentially appear, which can increase awareness for their brands and drive traffic. However, since the Shops section is based on organic search ranking, retailers who don’t already rank well may not be able to reap its benefits.

As Google continues to add support for organic shopping features, it only becomes more important for merchants to ensure their sites are optimized both for traditional search results and shopping-related features.

Non-shopping results may also appear in the same results page as the Shops section (in the case of the screenshot above, there is a listing for a tutorial on how to fix a broken bike chain). The addition of more shopping features may potentially push non-shopping-related results further down the page, which can affect clickthroughs.

From an industry perspective, Google’s buildout of organic e-commerce features supporting both users and merchants speaks to the rise of digital commerce and its role in the company’s strategy.

The post Google launches ‘Shops’ section in mobile search results appeared first on Search Engine Land.

Read More
Jason January 6, 2022 0 Comments

Google Merchant Center allows retailers to save product filters

The ability to save product filters has been spotted in Google Merchant Center. We’ve reached out to Google for more details about this feature but have not received a response at the time of publication.

A screenshot of product filters in Google Merchant Center. Image: Kirk Williams.

Tip of the hat to Kirk Williams of ZATO Marketing for bringing this to our attention.

Why we care

This nifty, albeit minor, update can save marketers some time that might otherwise be spent fumbling through data to find what they’re looking for. Being able to save product filters enables marketers to more quickly analyze different product categories, such as clearance items, for example.

More Google Merchant Center news

The post Google Merchant Center allows retailers to save product filters appeared first on Search Engine Land.

Read More
Jason December 29, 2021 0 Comments