Tutorials
Add GA4 With a Custom Node
Wrap Google Analytics tracking logic into a reusable custom node.
A custom node is the cleanest way to keep GA4 setup reusable and easy to configure.
GA4 custom node
Use a custom node to wrap vendor-specific tracking logic.
Configured properties
Custom Node Call
Custom Nodes
customNodeId
customNodeId
ga4-custom-node
function
function
event
measurement_id
measurement_id
G-XXXXXXX
event_name
event_name
cta_click
event_params
event_params
{
"label": "{{ $.label }}"
}Recommended setup
Split the work into two flows:
- one flow that loads and configures GA4 once per page
- one flow that sends events through a reusable custom node
Why use a custom node here
GA4 often needs several settings and can include vendor-specific script logic. A custom node lets you hide that complexity behind a friendly setup form.
Suggested approach
- Create a custom node with clear input fields like measurement ID and event name.
- Use Load Script Source or Custom Script only where needed.
- In normal application flows, call that node with Custom Node Call.
What to watch out for
- Load GA only once per page.
- Keep the node inputs simple for non-technical teammates.
- Remember that Google may batch or delay its own network requests after
gtag()is called.