Créer un rapport de trafic LLM hebdomadaire avec Google Analytics, IA et Gmail
Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 13 nœuds.Utilise principalement des nœuds comme Code, Gmail, Aggregate, GoogleAnalytics, ScheduleTrigger. Utiliser Google Analytics, GPT-5 et Gmail pour créer un rapport hebdomadaire de trafic LLM
- •Compte Google et informations d'identification Gmail API
- •Clé API OpenAI
Nœuds utilisés (13)
Catégorie
{
"id": "EOcBeSjghx5s9AWj",
"meta": {
"instanceId": "b597f3db206729fea79938d01afc341ae2811ad29d941b24c1597c0110c58f12",
"templateCredsSetupCompleted": true
},
"name": "Create a weekly LLM traffic report using Google Analytics, AI, and Gmail",
"tags": [],
"nodes": [
{
"id": "d9633143-8490-4bdf-a74d-ef76b4bdd296",
"name": "Créer un rapport de trafic",
"type": "@n8n/n8n-nodes-langchain.openAi",
"position": [
1072,
0
],
"parameters": {
"modelId": {
"__rl": true,
"mode": "list",
"value": "gpt-5",
"cachedResultName": "GPT-5"
},
"options": {},
"messages": {
"values": [
{
"content": "=Please create a report of the following traffic\n\n {{ $json.data.toJsonString() }}"
},
{
"role": "system",
"content": "=You are a virtual assistant. Your job is to take the list of traffic numbers provided and generate a weekly report that will be sent by email. Use the following structure:\n\n<structure>\n## Top sources\nShow a table with top sources of traffic. The columns should be | # | Source / Medium | Sessions |\n</structure>\n\nAdhere to the following rules:\n- Only return the body text of the email.\n- Return the body text without any additional commentary or remarks\n- The report should be formatted to comply with HTML used in emails."
}
]
}
},
"credentials": {
"openAiApi": {
"id": "R5mcnwXQyAqWYNFn",
"name": "OpenAi account - SOAX"
}
},
"typeVersion": 1.8
},
{
"id": "596de87f-3356-4e6b-87fb-d08ea6f28d1b",
"name": "Chaque semaine...",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-80,
0
],
"parameters": {
"rule": {
"interval": [
{
"field": "weeks",
"triggerAtDay": [
1
]
}
]
}
},
"typeVersion": 1.2
},
{
"id": "9d573408-4d0d-4534-a2c6-be09cb89460e",
"name": "Obtenir les sessions par source et support",
"type": "n8n-nodes-base.googleAnalytics",
"position": [
224,
0
],
"parameters": {
"returnAll": true,
"metricsGA4": {
"metricValues": [
{
"listName": "sessions"
}
]
},
"propertyId": {
"__rl": true,
"mode": "id",
"value": "=put id here"
},
"dimensionsGA4": {
"dimensionValues": [
{
"listName": "sourceMedium"
}
]
},
"additionalFields": {}
},
"credentials": {
"googleAnalyticsOAuth2": {
"id": "1igLahLYGVAhtJYv",
"name": "Google Analytics account - SOAX"
}
},
"typeVersion": 2
},
{
"id": "610f9a66-61e3-47ce-baf4-d53432240b77",
"name": "Filtrer les domaines de référencement connus des entreprises d'IA",
"type": "n8n-nodes-base.code",
"position": [
528,
0
],
"parameters": {
"jsCode": "const regex = /^.openai.*|.*copilot.*|.*chatgpt.*|.*gemini.*|.*gpt.*|.*neeva.*|.*writesonic.*|.*nimble.*|.*outrider.*|.*perplexity.*|.*google.*bard.*|.*bard.*google.*|.*bard.*|.*edgeservices.*|.*astastic.*|.*copy.ai.*|.*bnngpt.*|.*gemini.*google.*$/i;\n\n// Filter items\nreturn items.filter(item => {\n // Adjust the property you want to match against, e.g. `item.json.source`\n const value = item.json.sourceMedium || \"\";\n return regex.test(value);\n});"
},
"typeVersion": 2
},
{
"id": "d8c1d626-5a9e-4ee1-9d94-99d1cf33b1fd",
"name": "Combiner les éléments",
"type": "n8n-nodes-base.aggregate",
"position": [
832,
0
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData"
},
"typeVersion": 1
},
{
"id": "3f1f25d7-46c3-4af7-916d-b856bf1b8e05",
"name": "Envoyer le rapport",
"type": "n8n-nodes-base.gmail",
"position": [
1424,
0
],
"webhookId": "853478aa-74d6-4824-a7fb-1fbd3fdcfb54",
"parameters": {
"sendTo": "youremail@example.com",
"message": "={{ $json.message.content }}",
"options": {
"appendAttribution": false
},
"subject": "=LLM traffic report for week {{ $now.minus(1,'week').format('W') }} - {{ $now.minus(1,'week').format('dd MMMM yyyy') }} to {{ $now.format('dd MMMM yyyy') }}"
},
"credentials": {
"gmailOAuth2": {
"id": "r36hIUr5SXLnTlQK",
"name": "Gmail account"
}
},
"typeVersion": 2.1
},
{
"id": "baa2f522-9202-4387-b3c2-7c8f59c1d7f7",
"name": "Note adhésive",
"type": "n8n-nodes-base.stickyNote",
"position": [
-176,
-464
],
"parameters": {
"color": 7,
"width": 272,
"height": 704,
"content": "## Scheduled trigger\nRun workflow every week"
},
"typeVersion": 1
},
{
"id": "abd6b671-da94-40d6-8f16-f4255354b335",
"name": "Note adhésive 1",
"type": "n8n-nodes-base.stickyNote",
"position": [
128,
-464
],
"parameters": {
"color": 7,
"width": 272,
"height": 704,
"content": "## Get sessions by source / medium\nGet last weeks sessions by source / medium\n\nAdd your Google analytics ID to the node to make it work. You can find it in the admin panel under `property -> property details`. In the top right you'll see your property ID"
},
"typeVersion": 1
},
{
"id": "97f8d38d-5a3e-4420-9dc0-3619e4fa9a82",
"name": "Note adhésive 2",
"type": "n8n-nodes-base.stickyNote",
"position": [
432,
-464
],
"parameters": {
"color": 7,
"width": 272,
"height": 704,
"content": "## Filter for LLM traffic\nIn this node we're filtering our traffic for known LLMs such as ChatGPT, Gemini, perplexity, etc\n\nFeel free to add your own to the list"
},
"typeVersion": 1
},
{
"id": "890c7ab2-651d-425f-b029-712a0816a200",
"name": "Note adhésive 3",
"type": "n8n-nodes-base.stickyNote",
"position": [
736,
-464
],
"parameters": {
"color": 7,
"width": 272,
"height": 704,
"content": "## Combine items\nHere we combine all items into one list so we can pass it on to the LLM"
},
"typeVersion": 1
},
{
"id": "7b1c3630-7bc9-41e0-836e-df8b2051860d",
"name": "Note adhésive 4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1040,
-464
],
"parameters": {
"color": 7,
"width": 272,
"height": 704,
"content": "## Generate report\nHere we ask an LLM to generate a simple traffic report for us and style in using email-friendly HTML"
},
"typeVersion": 1
},
{
"id": "66c8ed41-5330-4cc2-b137-0b8404ce6650",
"name": "Note adhésive 5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1344,
-464
],
"parameters": {
"color": 7,
"width": 272,
"height": 704,
"content": "## Send report\nFinally, we send the report to an email address.\n\nWe use a function in n8n to get last weeks week number, the start date, and the end date"
},
"typeVersion": 1
},
{
"id": "6d241bf3-1b46-4280-be37-4da55119bc49",
"name": "Note adhésive 6",
"type": "n8n-nodes-base.stickyNote",
"position": [
-544,
-464
],
"parameters": {
"color": 7,
"width": 336,
"height": 704,
"content": "## Overview\n\nGet a weekly report on website traffic driven by large language models (LLMs) like ChatGPT, Perplexity, and Gemini. This workflow helps you track how these tools bring visitors to your site. A weekly snapshot helps you make better content and marketing decisions.\n\n## How it works\n\n- Pull weekly sessions from Google Analytics by source/medium\n- Use regex to find traffic from LLMs\n- Combine the filtered sessions and generate a short report with AI\n- Email the report to you\n\n## Setup\n\n1. Connect your OpenAI API key, Google Analytics access, and email credentials (for example, Gmail via Google Cloud Console).\n2. Configure your Google Analytics and email nodes to read and send data.\n3. Update the code node to filter sessions based on LLM referral URLs."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "4cdce158-749d-4fd1-acb4-cf45cdc7d403",
"connections": {
"d8c1d626-5a9e-4ee1-9d94-99d1cf33b1fd": {
"main": [
[
{
"node": "d9633143-8490-4bdf-a74d-ef76b4bdd296",
"type": "main",
"index": 0
}
]
]
},
"596de87f-3356-4e6b-87fb-d08ea6f28d1b": {
"main": [
[
{
"node": "9d573408-4d0d-4534-a2c6-be09cb89460e",
"type": "main",
"index": 0
}
]
]
},
"d9633143-8490-4bdf-a74d-ef76b4bdd296": {
"main": [
[
{
"node": "3f1f25d7-46c3-4af7-916d-b856bf1b8e05",
"type": "main",
"index": 0
}
]
]
},
"9d573408-4d0d-4534-a2c6-be09cb89460e": {
"main": [
[
{
"node": "610f9a66-61e3-47ce-baf4-d53432240b77",
"type": "main",
"index": 0
}
]
]
},
"610f9a66-61e3-47ce-baf4-d53432240b77": {
"main": [
[
{
"node": "d8c1d626-5a9e-4ee1-9d94-99d1cf33b1fd",
"type": "main",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Création de contenu, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Robin Geuens
@robingeuensHi, I'm Robin. I'm a veteran marketer of 7 years and love automation. If you have any questions about automation feel free to reach out to me on LinkedIn: https://www.linkedin.com/in/rgeuens/
Partager ce workflow