Lookup table missing default value
Lookup table variable has no default value configured, returning undefined for unmatched inputs.
Summary
- rule_id —
lookup-no-default - purpose — Detect Lookup Table variables that return
undefinedwhen input doesn't match any row - effect — Tags depending on the variable receive
undefinedsilently, which can break firing conditions or send malformed data - layer — container
- reversibility — non-destructive
What fires this
The rule filters all container variables where type === 'smm' (GTM's internal type for Lookup Table variables) and lookupTable is present. It flags any variable where lookupTable.hasDefault is false. Each flagged variable is reported with its name, input source, and entry count. The rule emits one issue per container with all affected variables grouped together.
Why it matters
A Lookup Table with no default returns undefined for any input that doesn't match a row. Tags that use that variable as a trigger condition, a parameter value, or a conversion ID can fire incorrectly, send blank fields, or fail without any visible error. The breakage is hard to detect in preview mode because it only appears for inputs not present in your test data. Adding a default — even an empty string or a sentinel like "unknown" — makes the failure mode explicit and testable.
Before / after
Lookup Table variable DL - Page Category maps URL path patterns
to category names. No default row is set.
/blog/post-123 → matches "blog"
/careers/senior-engineer → no match → returns undefined
The GA4 event fires with page_category: undefined.
Lookup Table variable DL - Page Category maps URL path patterns
to category names. Default value is set to "other".
/blog/post-123 → matches "blog"
/careers/senior-engineer → no match → returns "other"
The GA4 event fires with page_category: "other".
Remediation
- Open the GTM container and navigate to Variables.
- Open each variable listed in the rule output.
- Scroll to the bottom of the Lookup Table configuration.
- Enable "Set default value."
- Enter a value appropriate to the variable's downstream use: an empty string,
"unknown", or a clearly invalid sentinel for conversion ID variables. - Save and publish the container.
- Confirm that tags receiving this variable no longer evaluate to
undefinedfor unmatched inputs.
Metadata
- Severity
- medium
- Tier
- optimization
- Category
- quality
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
See also
- Quality rules — other rules in this category
- Health score — how this rule contributes to the score
- Rules catalog — browse all rules
Examples
curl https://developer.tagmanifest.com/v1/evaluate-rule \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rule_id":"lookup-no-default","url":"https://example.com"}'
User: Run lookup-no-default on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "lookup-no-default",
"url": "https://example.com"
}
}