Skip to main content

What context influences

Contextual information affects multiple aspects of the search experience: Relevance scoring: The platform adjusts relevance scores for products related to cart items or purchase history, surfacing complementary or similar items more prominently. Facet selection: Layers intelligently selects which facets (filters) to display based on the customer’s browsing context and previous interactions. Sort order optimization: Customer behavior patterns influence default sorting, showing more relevant products first. Geographic personalization: Layers applies location-aware merchandising rules and product availability based on the customer’s region. Intent understanding: Prior searches and click behavior inform how new queries are interpreted, improving semantic understanding over time. Customer segmentation: Customer profile data (order history, spending patterns, loyalty status) enables personalized experiences for different customer segments. Marketing attribution: UTM parameters and campaign information help track the effectiveness of marketing efforts and can influence product recommendations. Channel-specific behavior: Shopping channel information enables different merchandising rules, sort orders, and analytics segmentation for web vs mobile app visitors.

Implementation notes

  • Contextual information is processed in real time on each request
  • No personally identifiable information (PII) is required; all data is behavioral and anonymous
  • Sort orders and merchandising rules always take precedence over contextual adjustments
  • Missing or incomplete contextual data won’t break functionality; the platform gracefully degrades to non-personalized results
  • For headless implementations, validate your contextual data structure matches the expected format to ensure proper personalization

Privacy considerations

The Layers platform is designed with privacy in mind:
  • Device IDs are anonymous browser identifiers, not tied to personal information
  • Contextual data is used only for search personalization and is not shared with third parties
  • Raw User-Agent strings are never recorded in analytics events. Layers derives a coarse device type (mobile, tablet, desktop, or bot) and records that instead
  • Analytics events record only the validated context fields described in the context data structure. Layers drops unrecognized keys before recording. Raw click identifiers (marketing.clickIds) are not recorded; only the derived clickSource is kept
  • Customer IDs are Shopify’s numeric customer identifiers. They are stored encrypted at rest and in transit, pseudonymized before being sent to observability tooling, and visible in raw form to your dashboard users in search request logs, LayersQL, and MCP
  • Geographic data is limited to city-level granularity, never precise coordinates

See also