Plan a GTM variable change
gtm_plan_variable_upsertPlan the creation or update of a Google Tag Manager variable in a non-default workspace, then apply it separately after approval.
Instructions
PLAN (nothing is written): create or update a variable in a non-default workspace of the client's GTM container (fingerprint from gtm_get_variable for an update). Custom JavaScript variables are high risk. Apply with google_apply after the user agreed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable | Yes | The variable as a GTM API object: name, type, parameter [{type, key, value}], notes. For an update pass only the fields to change (the others are kept); output fields (path, ids, fingerprint) may be left in and must match | |
| client_id | No | Client id from clients_list. Required when several clients are registered; empty uses the only client | |
| fingerprint | No | Update only: the fingerprint returned by gtm_get_tag / gtm_get_trigger / gtm_get_variable (required; refused when stale) | |
| variable_id | No | Numeric id of the variable to update; empty creates one | |
| workspace_id | Yes | Numeric GTM workspace id (gtm_workspace_status lists them); never the Default Workspace for a change |