💎
Headless Docs
Version 0.2.0
Version 0.2.0
  • Overview
  • Change Log
  • Next.js Steps
    • Requirements
    • Determine Page Methods
      • Route Hashing Method
      • Cookies Method
    • Install Middleware
    • Add Intelligems Provider
    • Read User Context
      • Route Hashing Method
      • Cookies Method
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Gatsby Steps
    • Requirements
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Pack Digital Steps
    • Requirements
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Examples
    • Content Testing
  • Reference
    • Middleware Objects
      • IgMiddlewareConfig
      • IgMiddlewareHandler
    • Providers
      • Next.js
      • Gatsby
    • Components
      • Price Components
    • Hooks
      • Price Hooks
      • Track Hooks
      • Experiment Hooks
      • Test Group Hooks
      • Cart & Checkout Hooks
Powered by GitBook
On this page
  • Requirements
  • Considerations
  • Pros
  • Cons
  1. Next.js Steps
  2. Determine Page Methods

Route Hashing Method

The Route Hashing method determines User Context and saves it as a route hash.

Requirements

  1. This method works only on pages that follow a blob pattern, i.e. products/:slug, and use getStaticProps (i.e., PDP pages).

  2. getStaticPaths must return fallback: 'blocking' . This is required to build page new Test Group combinations live.

Routes without a blob pattern that use getStaticProps must be converted to use getServerSideProps. i.e., the home, cart, and search pages.

Why? The Route Hasing Method won’t work on /index because the internal route would be converted to a hashed route, such as /eyJhIjoiYiIsInVybFBhdGgiOiIvIn0.

However, this hashed route doesn’t exist as far as Next.js is concerned and would redirect to a nonexistent page on the site.

Considerations

Pros

  1. Speed. Pages using the method will be cached internally by Next.js. For example, two users in the same Test Group will be redirected directly to the cached page.

Cons

  1. The number of cached pages will grow exponentially based on the number of active Tests and Test Groups per test, per route. For example, a site with 3 Experiments with 3 Test Groups each will have 27 possible Test Group permutations per route.

  2. Additional hosting costs due to additional page builds and caching may occur. Verify build and hosting limits with your hosting provider.

PreviousDetermine Page MethodsNextCookies Method