UTM链接创建器和二维码生成器,附带定时Google Analytics报告
中级
这是一个Product, AI, Marketing领域的自动化工作流,包含 14 个节点。主要使用 Set, Code, Gmail, Airtable, HttpRequest 等节点,结合人工智能技术实现智能自动化。 UTM链接创建器和二维码生成器,附带定时Google Analytics报告
前置要求
- •Google 账号和 Gmail API 凭证
- •Airtable API Key
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
使用的节点 (14)
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"id": "SJrqDqTBIAyaZQkq",
"meta": {
"instanceId": "73d9d5380db181d01f4e26492c771d4cb5c4d6d109f18e2621cf49cac4c50763",
"templateCredsSetupCompleted": true
},
"name": "UTM链接创建器和二维码生成器,附带定时Google Analytics报告",
"tags": [],
"nodes": [
{
"id": "5efbd956-51b6-4f94-aebc-07e3e691f7eb",
"name": "OpenAI 聊天模型1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-180,
480
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "95QGJD3XSz0piaNU",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "a1acd323-ed07-41b4-a51e-614afe361893",
"name": "窗口缓冲区内存",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
0,
480
],
"parameters": {
"sessionKey": "={{ $json.timestamp }}",
"sessionIdType": "customKey",
"contextWindowLength": 200
},
"typeVersion": 1.3
},
{
"id": "c3c2b5fa-c294-4306-a050-dccd592477fa",
"name": "Google Analytics",
"type": "n8n-nodes-base.googleAnalyticsTool",
"position": [
160,
480
],
"parameters": {
"metricsGA4": {
"metricValues": [
{
"listName": "sessions"
}
]
},
"propertyId": {
"__rl": true,
"mode": "list",
"value": "404306108",
"cachedResultUrl": "https://analytics.google.com/analytics/web/#/p404306108/",
"cachedResultName": "East Coast Concrete Coating"
},
"dimensionsGA4": {
"dimensionValues": [
{},
{
"listName": "sourceMedium"
}
]
},
"additionalFields": {}
},
"credentials": {
"googleAnalyticsOAuth2": {
"id": "sVZ61SpNfC2D1Z7V",
"name": "Google Analytics account"
}
},
"typeVersion": 2
},
{
"id": "cbc7b539-2fa6-493b-a66c-13db8d8d420c",
"name": "创建UTM链接并发送至数据库",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-440,
-80
],
"parameters": {},
"typeVersion": 1
},
{
"id": "5358f2cc-bdb0-4e9b-a6b9-93418f83db02",
"name": "为链接设置UTM参数",
"type": "n8n-nodes-base.set",
"position": [
-220,
-80
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "28d0a36d-5b03-4b74-9941-ef0e1aab86bf",
"name": "website_url",
"type": "string",
"value": "https://ecconcretecoating.com/"
},
{
"id": "1a2ee174-4684-4246-813f-b67285af48b8",
"name": "campaign_id",
"type": "string",
"value": "12246"
},
{
"id": "e15a846d-6e37-4fbf-a9f4-b3fce3441295",
"name": "campaign_source",
"type": "string",
"value": "google"
},
{
"id": "f15e2bb1-08a6-48c4-8458-b753864e9364",
"name": "campaign_medium",
"type": "string",
"value": "display"
},
{
"id": "548900ab-aa2c-498f-bbd9-a787306e72db",
"name": "campaign_name",
"type": "string",
"value": "summerfun"
},
{
"id": "fd8d1bd4-a75d-4c49-b795-8fda7c377b66",
"name": "campaign_term",
"type": "string",
"value": "conretecoating"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "45daf73a-01c2-40ab-8546-7fdd489e2a1c",
"name": "使用参数创建UTM链接",
"type": "n8n-nodes-base.code",
"position": [
40,
-140
],
"parameters": {
"jsCode": "const items = $input.all();\nconst updatedItems = items.map((item) => {\n const utmUrl = `${item?.json?.website_url}?utm_source=${item?.json?.campaign_source}&utm_medium=${item?.json?.campaign_medium}&utm_campaign=${item?.json?.campaign_name}&utm_term=${item?.json?.campaign_term}&utm_content=${item?.json?.campaign_id}`;\n item.json.utmUrl = utmUrl;\n return item;\n});\nreturn updatedItems;\n"
},
"typeVersion": 2
},
{
"id": "a621984d-eea5-464d-9be3-e620e779abd5",
"name": "将UTM链接提交到数据库",
"type": "n8n-nodes-base.airtable",
"position": [
280,
-200
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appIXd8a8JeB9bPaL",
"cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL",
"cachedResultName": "Untitled Base"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblXyFxXMHraieGCa",
"cachedResultUrl": "https://airtable.com/appIXd8a8JeB9bPaL/tblXyFxXMHraieGCa",
"cachedResultName": "UTM_URL"
},
"columns": {
"value": {
"URL": "={{ $json.utmUrl }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "URL",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "URL",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "upsert"
},
"credentials": {
"airtableTokenApi": {
"id": "0ApVmNsLu7aFzQD6",
"name": "Airtable Personal Access Token account"
}
},
"typeVersion": 2.1
},
{
"id": "19074462-d719-4fdf-bc59-d6b2ecd1ce20",
"name": "使用提交的二维码链接创建二维码",
"type": "n8n-nodes-base.httpRequest",
"position": [
280,
-20
],
"parameters": {
"url": "=https://quickchart.io/qr?text={{ $json.utmUrl }}&size=300&margin=10&ecLevel=H&dark=000000&light=FFFFFF\n",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "a8c22bb2-f8eb-4e5f-b288-9c25e0aeb648",
"name": "向市场经理定时发送Google Analytics报告",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-460,
280
],
"parameters": {
"rule": {
"interval": [
{}
]
}
},
"typeVersion": 1.2
},
{
"id": "268c110c-2b7c-4450-b5b0-5d5326eac17f",
"name": "Google Analytics数据分析代理",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-100,
280
],
"parameters": {
"text": "={{ $json.timestamp }}",
"options": {
"systemMessage": "\"You are an advanced data analytics AI specializing in executive reporting. Your task is to analyze the provided dataset and generate a structured executive summary that highlights key insights, trends, and actionable takeaways. Structure your summary in the following format:\n\nOverview – Briefly describe the dataset and its significance.\nKey Performance Indicators (KPIs) – Highlight the most important metrics and compare them to previous periods if applicable.\nTrends & Insights – Identify patterns, growth areas, declines, and anomalies.\nOpportunities & Recommendations – Provide strategic recommendations based on the insights.\nConclusion – Summarize the key takeaways concisely.\n*Ensure the tone is professional, clear, and tailored for executives who require quick, data-driven insights without unnecessary details.\""
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "1b012731-e67b-4e0d-95b7-a7f587754a05",
"name": "向市场经理发送摘要报告",
"type": "n8n-nodes-base.gmail",
"position": [
300,
280
],
"webhookId": "a9b88615-c7e2-4b56-891a-98f4d6b34220",
"parameters": {
"sendTo": "john@marketingcanopy.com",
"message": "={{ $json.output }}",
"options": {},
"subject": "Google Analytics Metrics Summary Report"
},
"credentials": {
"gmailOAuth2": {
"id": "pIXP1ZseBP4Z5CCp",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "9da758e1-8aed-446b-a074-8fee5405583f",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
-280
],
"parameters": {
"width": 500,
"height": 400,
"content": "创建带有UTM参数的营销链接。轻松存储到数据库,同时生成并准备好二维码。"
},
"typeVersion": 1
},
{
"id": "92f5df8d-88ca-4b58-b544-c0b2d3578a73",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-380
],
"parameters": {
"color": 4,
"width": 580,
"height": 540,
"content": "代码节点使用UTM参数创建URL。"
},
"typeVersion": 1
},
{
"id": "408af10c-4b0e-4d94-b02d-5d887fb150c3",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-540,
180
],
"parameters": {
"color": 5,
"width": 1340,
"height": 460,
"content": "安排带有媒介/来源的Google Analytics报告以跟踪UTM链接表现。更新报告字段以适应您的业务需求。您可以跟踪流量、转化和其他互动指标。"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "6e6641fd-a59c-49e9-af43-1b2b9b458544",
"connections": {
"Google Analytics": {
"ai_tool": [
[
{
"node": "Google Analytics Data Analysis Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "Google Analytics Data Analysis Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "Google Analytics Data Analysis Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Set UTM Parameters For Link": {
"main": [
[
{
"node": "Create UTM Link With Parameters",
"type": "main",
"index": 0
}
]
]
},
"Submit UTM Link To Database": {
"main": [
[]
]
},
"Create UTM Link With Parameters": {
"main": [
[
{
"node": "Create QR Code With Submitted QR Link",
"type": "main",
"index": 0
},
{
"node": "Submit UTM Link To Database",
"type": "main",
"index": 0
}
]
]
},
"Create UTM Link & Send To Database": {
"main": [
[
{
"node": "Set UTM Parameters For Link",
"type": "main",
"index": 0
}
]
]
},
"Google Analytics Data Analysis Agent": {
"main": [
[
{
"node": "Send Summary Report To Marketing Manager",
"type": "main",
"index": 0
}
]
]
},
"Send Summary Report To Marketing Manager": {
"main": [
[]
]
},
"Schedule Google Analytics Report To Marketing Manager": {
"main": [
[
{
"node": "Google Analytics Data Analysis Agent",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
中级 - 产品, 人工智能, 营销
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Pinterest分析与AI内容建议自动化
使用Pinterest API自动化Pinterest分析与AI驱动的内容建议
Code
Gmail
Airtable
+7
13 节点Marketing Canopy
人工智能
自动化博客撰写与社交媒体推广代理
使用GPT-4、Perplexity和WordPress自动化SEO博客创建+社交媒体
Set
Code
Gmail
+21
79 节点LukaszB
设计
自动化新闻到简报AI代理v13
AI新闻研究团队:24/7简报自动化,含Perplexity引用
Set
Code
Gmail
+15
37 节点Derek Cheung
产品
博客WordPress复制销售
使用GPT-4、Perplexity AI和WordPress自动化SEO博客内容创建
Set
Code
Notion
+16
39 节点LukaszB
人工智能
用于 WordPress 的 AI 博客内容撰写器与图片生成器
基于GPT Image 1和Perplexity的WordPress自动化博客内容创建器
Set
Code
Notion
+16
41 节点LukaszB
人工智能
使用AI、ElevenLabs、PIAPI Shotstack/Creatomate生成视频并发布到YouTube
使用AI、ElevenLabs、PIAPI Shotstack/Creatomate生成视频并发布到YouTube
If
Set
Code
+16
79 节点Immanuel
人工智能
工作流信息
难度等级
中级
节点数量14
分类3
节点类型12
作者
Marketing Canopy
@johnmarketingcanopyA results-driven Six Sigma Green Belt with 5 years of experience specializing in marketing process optimization, AI-powered data automation, and performance analytics. Adept at leveraging machine learning models, predictive analytics, and automation tools to enhance marketing efficiency, streamline workflows, and maximize ROI.
外部链接
在 n8n.io 查看 →
分享此工作流