Shopify UTM Campaign Data Sync to Baserow - n8n Workflow

Use this powerful n8n workflow to automatically extract Shopify order UTM parameters using the GraphQL API and sync campaign tracking data directly to Baserow daily for comprehensive marketing analysis. A high-value n8n template for e-commerce.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Markdown-formatted text:
E-commerce managers needing granular UTM tracking data.
Marketing teams analyzing the effectiveness of campaigns across different channels.
Analysts who require structured data storage (Baserow) for Shopify sales.
Users looking for high-quality, pre-built n8n templates for data synchronization.

Overview

Tracking the success of marketing campaigns requires accurate attribution data. While Shopify tracks UTM parameters for customer journeys, retrieving this detailed data automatically can be challenging. This specific n8n workflow solves this by utilizing a powerful feature of n8n: direct GraphQL interaction with the Shopify Admin API.

Since the standard Shopify n8n node does not easily expose the detailed customerJourneySummary, this sophisticated n8n template uses a GraphQL n8n node to fetch yesterday's orders along with their specific UTM tags (source, medium, campaign, content). The resulting data is cleaned, filtered (only campaign-attributed orders are kept via an If n8n node), and then reliably stored in Baserow for subsequent analysis. This approach guarantees that your Baserow database is always up-to-date with essential marketing attribution details, making this an invaluable n8n workflow for data-driven teams.

How it Works

Markdown-formatted text:


  1. Scheduled Activation: The n8n workflow starts daily at 00:00 using the Schedule n8n trigger.

  2. Configuration: The Set Shopify Subdomain n8n node dynamically sets the required subdomain for the API call.

  3. Data Extraction (GraphQL): The Get orders from Shopify GraphQL n8n node executes a complex query to retrieve all orders created yesterday, specifically requesting the customerJourneySummary and associated utmParameters.

  4. Item Splitting: The Split Shopify data into n8n items n8n node processes the GraphQL response, splitting the array of order edges into individual items so that each order can be processed separately through the n8n workflow.

  5. Data Transformation: The Transform incoming data structure Set n8n node maps the deeply nested GraphQL output fields (like node.customerJourneySummary.firstVisit.utmParameters.campaign) into a simplified, flat structure (e.g., campaign, revenue) required for insertion.

  6. Conditional Check: The Check if "Campaign" is present If n8n node acts as a crucial filter. Only items where a UTM campaign value exists are allowed to proceed to the database insertion. Orders lacking campaign data follow the 'False' path to a 'No Operation' n8n node.

  7. Database Sync: Successful items are sent to the Baserow n8n node, which securely creates a new record containing the order ID, revenue, and all captured UTM parameters in the specified Baserow table. This completes the data synchronization part of the n8n workflow.

Installation Guide

Markdown-formatted text:


  1. Import the n8n template: Copy the provided JSON code and import it directly into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Shopify Subdomain: In the Set Shopify Subdomain n8n node, update the Shopify Subdomain value (you-domain) to your actual Shopify store URL prefix.

  3. Shopify API Credentials: The Get orders from Shopify n8n node requires HTTP Header Authentication. You must set up credentials with the appropriate permissions to access the Shopify Admin GraphQL API (Admin API Access token).

  4. Baserow Credentials: Set up your Baserow API Key credentials in n8n. Then, in the Baserow n8n node, specify the target Database ID, Table ID, and correctly map the incoming fields (order, campaign, content, medium, source, revenue) to your Baserow columns, as noted in the sticky note.

  5. Activate: Save and activate this powerful n8n workflow. The Schedule n8n trigger will handle daily executions.

Node Details

Markdown-formatted text:
Every day at 00:00 (Schedule Trigger n8n node):
Function: Serves as the primary n8n trigger, initiating the data retrieval process once daily.
Key Configuration: Set to run at a specific time (00:00).
Get orders from Shopify (GraphQL n8n node):
Function: Executes a complex GraphQL query to retrieve yesterday's order data, focusing specifically on nested UTM parameters found within the customerJourneySummary field. This advanced n8n node is key to bypassing limitations of the standard Shopify n8n node.
Key Configuration: Uses dynamic endpoint construction based on the Set Shopify Subdomain n8n node output. Query filters orders by created_at:{{$today.minus({days: 1})}}.
Split Shopify data into n8n items (Split Out n8n node):
Function: Deconstructs the single API response item containing many orders into multiple individual n8n items, enabling parallel processing of each order's data.
Transform incoming data structure (Set n8n node):
Function: Essential for data preparation. It extracts deep nested values from the GraphQL output and assigns them clean keys (order, campaign, revenue) for use in the Baserow n8n node. Includes fallback logic (|| "") for optional UTM parameters.
Check if "Campaign" is present (If n8n node):
Function: Flow control mechanism. Checks if the campaign field, set by the previous n8n node, exists. This ensures only campaign-attributed orders are tracked in Baserow.
Baserow (Baserow n8n node):
Function: The final action in this n8n workflow. It securely logs the filtered and formatted campaign tracking data into the target Baserow table.
* Key Configuration: Operation set to create, with direct field mappings to Baserow columns.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all
Created by
Sascha
Sascha

Featured*