Skip to content

Object Identity

View MD

Object Identity is the cornerstone of the Luigi’s Box feedback loop.

The “Identity” is a unique string (numerical or textual) used to unambiguously identify a specific item in your catalog — whether it is a product, category, brand, or article.

Object identity controls two critical processes in Luigi’s Box: Updates and Pairing.

Object identities serve as primary keys in our database. When you use the Indexing APIs to send data, we use the identity to decide whether to create a new item or update an existing one.

flowchart TD
A["Incoming item with ID 123"]
A --> B{"Does ID 123 exist?"}
B -- Yes --> C["Update existing item"]
B -- No --> D["Create new item"]

The trap of mutable IDs

If you use a mutable value (like a URL) as an ID, you risk creating duplicates.

  • Day 1: You send Product A with ID url-1. (Created)
  • Day 2: You change the URL. You send Product A with ID url-2. (Created as Duplicate)
  • Result: You now have two versions of the same product. The history is split, and search relevance suffers.

“Pairing” is the process of matching a user’s action (Analytics) to a specific item in the data you indexed (Catalog).

For the AI to learn from user behavior, the ID sent in the analytics event must match the ID provided in the product feed exactly.

flowchart LR
A["Analytics event"]
B["Product feed"]
C{"Pairing check"}
D["Learning signal"]
E["Signal ignored"]
A -- "Sends ID 123" --> C
B -- "Sends ID 123" --> C
C -- Match --> D
C -- Mismatch --> E

Common pairing errors

Catalog IDAnalytics IDResultReason
1234512345MatchPerfect alignment.
12345SKU_12345FailPrefix mismatch.
12345https://site.com/p/12345FailSending URL instead of ID.

Historically, it was common to use URLs as object identities. However, because URLs often change (e.g., SEO updates, category restructuring), this causes data loss. When a URL changes, the product effectively becomes a “new” item, losing all historical ranking and behavioral data.

If you are currently using URLs as IDs, we strongly recommend migrating to immutable IDs (like SKUs).

The migration involves three steps:

We need to ensure the AI doesn’t lose its memory.

  • Option A (ID exists in data): If your current feed already contains the new ID in a separate field, we can rebuild models internally.
  • Option B (Mapping File): If not, provide us with a CSV mapping file (Column A: Old URL, Column B: New ID). We will use this to transfer the historical data.

You must stop sending URLs in your tracking events.

  • Events API: Update your backend calls to send the new ID.
  • DataLayer/Script: You must expose the new ID in your frontend code so our script can grab it. See the Product Identification guide.
  • Content Updates API: You must delete the old objects (by URL) and send the new objects (by ID).
  • Feeds: We will manage the reindex for you by reprocessing the full feed.

A valid Identity must be:

  • Unique across all object types (a Category cannot have the same ID as a Product).
  • Immutable (it never changes for the lifetime of the object).
  • Consistent (the same string is used in both the Catalog Feed and the Analytics layer).