The usual argument for server-side tagging is performance or cookie durability. For a healthcare organisation the better argument is control. Once events arrive at your own server container, you decide, in one place, which events go to which platform and which fields travel with them. That only happens if you write the rules. A server container that passes on everything it receives is a proxy, not a filter.
This article is for analysts and engineers who already have a server container running and need to design the filtering layer. If you are still building the container, start with Google's Cloud Run setup guide first. For the consent model that sits above these rules, see server-side tracking and consent mode for healthcare. Here the question is narrower: how do you make sure an ad platform sees only what you have approved?
The two filtering tools
The server container gives you two separate mechanisms, and good rule sets use both.
Triggers decide whether a tag fires at all. A tag attached to a trigger such as "event name equals generate_lead" will not fire for page_view. This is the control for which events reach a platform.
Transformations decide what data a tag can see. Google's transformations documentation describes them as controls that run after the client has built the event data object and before tags read it. There are three types:
- Allow parameters: exposes only the parameters you list. Parameters not explicitly defined are discarded, including parameters Google tags need, so you must check your tags first.
- Exclude parameters: removes the parameters you list so tags cannot use them.
- Augment event: changes the value of existing parameters or adds new ones, using a fixed value or a variable.
Each transformation has Affected Tags, which can be all tags (the default), tag types or individual tags, and Matching Conditions, which control when it runs. Without conditions it always runs. The default order of execution is Allow, then Augment, then Exclude, and you can assign a priority to change it.
Design principle: allow-list for ad platforms
For the GA4 tag, an exclude approach is often enough. You trust your own analytics property more than a third-party ad pixel, and you still want the full parameter set for analysis. For advertising tags (Google Ads conversion, Meta, LinkedIn, anything else) use an allow-list.
An allow-list reverses the default. A new parameter added by a developer next year does not reach the ad platform until someone adds it to the list. In a healthcare context that is the right direction of failure.
Decide the permitted fields for each platform on one page:
| Platform tag | Permitted events | Permitted parameters |
|---|---|---|
| Google Ads conversion | generate_lead, call_click | event name, conversion value if used, click ID, timestamp |
| Meta tag | generate_lead only | event name, event ID for deduplication |
| LinkedIn or others | The one conversion you pay to optimise | event name |
| GA4 | Full approved taxonomy | All approved parameters, minus excluded fields |
The precise parameter names depend on each tag template. Check what each template reads and what happens if a parameter is missing. Google's transformation documentation notes that transformations affect only tags that fire, and that a transformation which removes required fields can stop a tag from firing. Test, do not assume.
A worked rule set
This is a hypothetical rule set for a multi-specialty hospital. Names are illustrative; adapt them to your tracking plan.
Rule 1: Allow parameters, affected tag: the Meta tag. Allow only the event name, an event ID for deduplication, a timestamp and the click identifier your tag template requires. Everything else, including page URL, page title, referrer and department, is discarded for this tag.
Rule 2: Exclude parameters, affected tag: all advertising tags. Remove page_title, search_term, doctor_id, form_type and step_name. This is a second layer. If someone later edits Rule 1 carelessly, the sensitive fields are still removed.
Rule 3: Augment event, affected tags: all tags. Overwrite page_location with a sanitised value from a server-side variable that strips the query string except an allow-list (utm_source, utm_medium, utm_campaign, utm_content, gclid). A tag that reads page_location then receives a clean URL.
Rule 4: Exclude parameters, matching condition: consent state. Google's own example removes custom dimensions when the gcs value shows analytics storage is denied. Mirror that idea: when the consent signal says advertising consent is denied, exclude user-level fields and let only anonymous measurement pass.
Rule 5: Event gating with triggers. The Meta tag fires only on generate_lead. The Google Ads conversion tag fires on generate_lead and call_click. No ad tag fires on page_view or doctor_profile_view.
Together, the effect is that a page view on a department page never leaves your server for an advertising platform, and a lead event carries only an identifier and a timestamp.
Remarketing and sensitive audiences
Some platforms use page views to build remarketing audiences. Google's personalised advertising policy lists health among sensitive interest categories and says advertisers promoting in these categories cannot use advertiser-curated audiences, including Customer Match. Filtering does not make an otherwise prohibited audience acceptable. It is a way to make sure the data never reaches a platform that you do not want building such audiences. Our post on healthcare remarketing strategies covers what is still available.




