Parameters with inconsistent hardcoded vs dynamic values
The same parameter is used with both hardcoded strings and GTM variables across different tags.
Summary
- rule_id —
ga4-param-hardcoded-values - purpose — Detect GA4 event parameters that mix hardcoded string values and
{{variable}}references across tags - effect — Inconsistent parameter values across tags; data quality drift when hardcoded values fall out of sync
- layer — container
- reversibility — non-destructive
What fires this
The rule reads all GA4 event tags via getGA4EventTags() and indexes each parameter name against its value type. A value is dynamic if it starts with {{; any non-empty string that does not is hardcoded. When any parameter name appears with both types across different tags, the rule fires. Only the tags using hardcoded values for that parameter are included in the affected list. The rule returns one issue per scan; all mixed parameter names are listed in the issue detail.
Why it matters
When the same parameter is hardcoded in one tag and variable-driven in another, the two tags diverge whenever the underlying value changes. The variable-driven tag picks up the new value; the hardcoded tag does not. This produces split event data and silent quality issues that are difficult to trace in GA4 reporting. The pattern usually signals an incomplete migration: a developer replaced hardcoded values in some tags but not all.
Before / after
// Tag A — GA4 Event: purchase
"eventParameters": [
{ "name": "currency", "value": "USD" }
]
// Tag B — GA4 Event: add_to_cart
"eventParameters": [
{ "name": "currency", "value": "{{DLV - currency}}" }
]
// Tag A — GA4 Event: purchase
"eventParameters": [
{ "name": "currency", "value": "{{DLV - currency}}" }
]
// Tag B — GA4 Event: add_to_cart
"eventParameters": [
{ "name": "currency", "value": "{{DLV - currency}}" }
]
Remediation
- Open the issue detail to identify which parameter names are mixed and which tags carry hardcoded values.
- For each flagged tag, open the tag in GTM and locate the hardcoded parameter value.
- Confirm the variable used in the other tag resolves to the correct value in the same context.
- Replace the hardcoded value with the matching
{{variable}}reference. - Repeat for every flagged tag and parameter combination.
- Publish the updated container and verify parameter values in GA4 DebugView.
Metadata
- Severity
- low
- Tier
- info
- Category
- ga4
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
See also
- GA4 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":"ga4-param-hardcoded-values","url":"https://example.com"}'
User: Run ga4-param-hardcoded-values on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "ga4-param-hardcoded-values",
"url": "https://example.com"
}
}