Setting Page Context on Your Website

Set the correct context on every site page to maximize campaign effectiveness

Page context is information you pass to Dynamic Yield about a page being viewed by a visitor to your site. The page context includes details about the page type (homepage, product page, and so on) as well as attributes (for example, if it's a product page – for which product).

🚧

Important:

You must ensure that page context is determined on every page, based on one or both of the methods described in this article. If the page context is missing, many capabilities do not work as expected. For example, page-type targeting fails, affinity profiles do not update, and recommendations are not served.

Methods

There are 2 ways to determine the page context on your site:

  • Using code: Put a short code snippet in the tag of every page, before the Dynamic Yield script.
  • Auto-detect rules: Set rules to detect the page type and fetch its attributes. Recommended for SPAs. This is supported only for e-commerce sites using the Dynamic Yield SPA flow.
    Note: Contact your technical account manager to enable auto-detect.

No need to choose only one option

You can implement different page types in different ways. For example, you can use code on your homepage and auto-detect rules for product pages.

You can even use both methods for the same page types. In this case, the context is first determined by the auto-detect rules, and the code is the fallback if the rules fail for any reason.

Get started

Both options start with going to Settings > General Settings in the navigation.