Traffic direction

Global E-Commerce: Solving the Region-Specific Content Balancing Act

Mike Buhot profile picture

Mike Buhot

12 August 2024 · 4 min read

In today's global marketplace, e-commerce businesses face a critical challenge: how to effectively deliver region-specific content without compromising search engine visibility, advertising capabilities, or analytics accuracy. This balancing act between localisation and technical performance can make or break a brand's international success. At Alembic, we recently tackled this complex issue for a global e-commerce brand, uncovering valuable insights and solutions that are widely applicable across the industry.

The E-Commerce Landscape: A Web of Complexities

Many e-commerce businesses operate multiple domains tailored to different geographical regions, primarily serving the same content but differentiated by pricing and marketing collateral. This approach, while beneficial for localisation, can introduce a host of technical challenges that impact SEO, digital marketing, and analytics accuracy.

In solving this problem for one of our customers we encountered three critical issues that are common in the e-commerce industry:

  1. Product pages in Google search results not matching the customer’s region.
  2. Google Merchant Center account issues preventing product placements in the Google Shopping tab.
  3. Inaccurate analytics for paid digital marketing campaigns, leading to skewed conversion and bounce rate measurements.

These issues can significantly hamper a brand's ability to effectively market to customers in different regions, directly impacting bottom-line results.

Unravelling the Root Cause: The Pitfalls of Automatic Redirection

Upon investigation, we found that the root of these problems lay in the implementation of automatic redirection based on the geolocation of the user's IP address. This feature, intended to enhance user experience, was causing a cascade of issues:

  1. Search engine crawlers (typically US-based) were being redirected to US pages, resulting in unindexed pages for other regions.
  2. Google Merchant Center detected price and currency discrepancies between the product data feed and the product pages, leading to products from non-US regions not being shown in Google Shopping. If not rectified, this may have led to suspension of the Google Merchant Center account.
  3. Analytics scripts were double-tracking customers - once on the default site prior to IP geolocation, and again after redirection.
  4. Users experienced a flash of incorrect regional content before the appropriate content loaded.

Solution 1: Harnessing the Power of hreflang Tags

Our first step in addressing these issues was to implement hreflang tags. These tags are crucial for sites serving multiple regions or languages, as they indicate to search engines that a page has regional variants.

We added hreflang tags to the <head> of all pages, providing geo-targeting for various regions. This solution ensures that customers see the appropriate regional pages in search results, effectively solving the SEO visibility issue.

<link rel="alternate" hreflang="en-us" href="https://www.example.com/us/product"/>
<link rel="alternate" hreflang="en-au" href="https://www.example.com/au/product"/>
<!-- Additional tags for other regions -->

Solution 2: Reimagining the Redirection Strategy

The client-side redirection based on an external API call was at the heart of many issues. We designed an alternative strategy that maintains user experience while allowing search engine crawlers unrestricted access.

  1. Leveraging CDN Capabilities: The architecture of the application included a Content Delivery Network (CDN), Amazon CloudFront, that cached server-rendered pages, with a high cache hit rate. We enabled IP GeoLocation headers to be included in each request from the CDN to the origin server, which would render the GeoLocation into the response. The GeoLocation header was incorporated into the cache key used by the CDN, so that high cache hit rates could be maintained with correct GeoLocation included. The asynchronous client-side API call to GeoLocate the user could then be removed.
  2. User-Agent String Check: We implemented a check for known crawler user agent strings, such as "Googlebot" and "Storebot-Google". This allows these crawlers to access all pages without redirection, solving the indexing issues. Given the high number of distinct User-Agent strings, this value could not be incorporated into the CDN cache key, instead the value was read client-side from the navigator.userAgent property.
  3. Inline Synchronous Script: While all other scripts on the page are loaded asynchronously to minimise impact on page performance, the redirection script is run synchronously before any others, operating only on data already rendered into the page. This prevented any flash of content being shown or analytics being recorded while the customer was on the wrong regional variant of the page.

Solution 3: Refining Analytics Tracking

To address the analytics discrepancies, we implemented a more robust tracking solution:

  1. We ensured that analytics scripts only fire after the appropriate redirection has occurred.
  2. We took the opportunity to migrate the client from the obsolete Universal Analytics to the newer Google Analytics 4.0 system. The move to an event-based analytics system, rather than the page-view based system gave us more precision in emitting analytics events reflecting the customers intent to search, view, add to bag and checkout.

The Impact: Transforming E-Commerce Operations

The results of these targeted solutions were immediate and significant:

  1. Improved SEO: Regional pages began appearing correctly in Google search results, expanding the brand's reach in various markets.
  2. Restored Google Shopping Capabilities: With the currency discrepancy resolved, the ability to run Google Shopping ads was restored across all markets.
  3. Enhanced Analytics Accuracy: Data analysts reported a significant improvement in geo-location accuracy. The percentage of users incorrectly tracked on the wrong regional sites decreased dramatically. Particularly the bounce-rate metric was reduced, after being artificially high due to tracking the user on the page prior to redirecting.
  4. Improved User Experience: The elimination of content flashing during redirection resulted in a smoother browsing experience for users.

Key Takeaways for E-Commerce Developers and Technical Leaders

This project underscored several key points that are widely applicable in the e-commerce industry:

  1. The Power of Root Cause Analysis: While sweeping changes like complete site restructures might seem necessary, a deeper analysis often reveals more targeted and cost-effective solutions.
  2. The Importance of SEO Considerations in International E-commerce: Simple oversights in implementing geolocation can have far-reaching consequences for search visibility and ad capabilities.
  3. The Complexity of Analytics in Multi-Region Sites: Ensuring accurate analytics tracking across multiple domains or localised pages on a single domain and with geolocation redirects requires careful implementation.
  4. The Balance Between User Experience and Technical Requirements: While geolocation-based redirects can enhance user experience, they need to be implemented in a way that doesn't hinder search engine crawlers or create analytics discrepancies.

Navigating the Future of E-Commerce

The challenges we addressed in this project are increasingly common in the e-commerce world, particularly for brands operating on a global scale. As e-commerce continues to evolve, developers and technical leaders must stay vigilant about how seemingly small technical details can have significant business impacts.

By approaching these challenges methodically, it's possible to implement targeted solutions that resolve complex issues without resorting to costly and time-consuming overhauls. The key lies in thorough analysis, well-implemented SEO strategies, and a holistic view of how technical decisions impact business outcomes.

Mike Buhot profile picture

WRITTEN BY

Mike Buhot

Hi, I’m Mike! I'm a functional programming enthusiast. When I'm not building awesome software I'm probably enjoying the outdoors with my kids or trying a new low-and-slow barbeque recipe.

ElixirConf US 2024

Elixir

ElixirConf US 2024: Alembic speakers to catch

Ben Melbourne profile picture

Ben Melbourne

26 August 2024 – 2 min read

Igniter

Ash Framework Consulting

Igniter - Rethinking code generation with project patching

Zach Daniel

Zach Daniel

16 July 2024 – 8 min read

Want to read more?

The latest news, articles, and resources, sent to your inbox occasionally.