Repository navigation
feat(umami): send visitor IP and declared event params as event data - #165
Merged
Merged
Conversation
The Umami server tag now sends the first ip_override address as payload.ip and the event type's declared Params as payload.data. Events without declared params send no data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
franklinkim
approved these changes
Oct 30, 2026
7 of 13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The server-side Umami tag sends requests to
/api/sendfrom the GTM server container. It has two gaps:payload.ip. Umami uses the IP of the GTM server for the session hash, the IP block list and the location lookup. Different visitors with the same user agent can share one session.payload.data. The event parameters that the event types declare do not reach Umami, so Umami cannot show event properties.Change
ip_overrideaspayload.ip. It trims the value and ignores the rest of a comma-separated list.eventParametersparameter (SIMPLE_TABLE, onenamecolumn).Serverfills it with the param names thatutils.LoadEventParamsreturns for the event type (the JSON names of theParamsfields), sorted.payload.data. It omitsundefined,nulland""values. It keeps0andfalse. No other event data goes to Umami.tag.NewUmamigets a newparams map[string]stringargument beforetriggers.docs/providers/umami.mddescribes the event data and the visitor IP.read_event_dataalready allowsanykey, so the permissions do not change.Compatibility
data, as before.payload.iprequires Umami v2.10.0 or later. Earlier versions do not read it.cf-ipcountry,cf-ipcity, ...) whenpayload.ipis set. They resolve the location from the IP with the GeoIP database. Instances without that database lose the location data from the Cloudflare headers.payload.ip(z.string().ip()in 2.x). An invalidip_overridevalue causes a400response.tag.NewUmamihas a new argument. This breaks external callers of the exported function.templates.tag) keep their template. The tag sends the neweventParametersparameter, and their template ignores it.How tested
pkg/provider/umami/server/tag/umami_test.go(list parameter, sort order, no parameter without params) andpkg/provider/umami/server/template/umami_test.go(template parameters and permissions parse as JSON, the JS setsipanddata).ip_override: " 1.2.3.4 , 10.0.0.1"givesip: "1.2.3.4"; declared params givedata: {"currency":"EUR","value":0}withoutuser_idand empty values; no declared params give nodata.make test: pass.golangci-lint run ./pkg/provider/umami/...: 0 issues. The fullmake lintreports one issue that already exists onmain(wsl_v5inpkg/provider/openaiads/server/tag/conversion.go:18).🤖 Generated with Claude Code