AutomationFlowsAI & RAG › Auto-analyze Google Analytics Data with Gemini AI & Smart Gmail/telegram Routing

Auto-analyze Google Analytics Data with Gemini AI & Smart Gmail/telegram Routing

ByRully Saputra @rullysaputra15 on n8n.io

This workflow is ideal for marketing teams, growth analysts, and business owners who need regular Google Analytics insights without manually digging through data. It’s also perfect for organizations that want to ensure positive performance updates reach stakeholders quickly…

Cron / scheduled trigger★★★★☆ complexityAI-powered15 nodesGoogle Gemini ChatAgentMemory Buffer WindowGoogle AnalyticsTelegramSentiment AnalysisGmail
AI & RAG Trigger: Cron / scheduled Nodes: 15 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7183 — we link there as the canonical source.

This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "zFO2MKhe5TtfOLB9",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Google Analytics Insight",
  "tags": [],
  "nodes": [
    {
      "id": "f6917f16-25d4-4118-bc0d-1d53e4ca2da4",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "daysInterval": 7
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6cd64c8e-48d4-4853-a47e-504c43d8cb88",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        416,
        0
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "6925c157-aa0b-4838-a067-3c5eb6c45a76",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        816,
        432
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3ebc007d-f125-47b8-9b78-efe15bbed229",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        624,
        0
      ],
      "parameters": {
        "text": "={{ $json.data }}",
        "options": {
          "systemMessage": "Acting as a experience data analyst who mainly working with the analytics data. Please analyze the those google analytics report with the past history. Give the insightful and important summary. Make it concise maximum 1000 chars. The important information must give `` so user can notice easily. The result must follow the telegram messenger format. Compare with your memory as well.\n\nThink step by step."
        },
        "promptType": "define"
      },
      "typeVersion": 2.1
    },
    {
      "id": "3867152b-24bc-4755-9098-8adc0b290c17",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        752,
        160
      ],
      "parameters": {
        "sessionKey": "={{ $json.data }}",
        "sessionIdType": "customKey"
      },
      "typeVersion": 1.3
    },
    {
      "id": "0b839f21-b96c-47c7-ac2c-4797432704ad",
      "name": "Get a weekly report",
      "type": "n8n-nodes-base.googleAnalytics",
      "position": [
        208,
        0
      ],
      "parameters": {
        "metricsGA4": {
          "metricValues": [
            {
              "listName": "eventCount"
            },
            {
              "listName": "userEngagementDuration"
            },
            {},
            {
              "listName": "active7DayUsers"
            },
            {
              "listName": "active28DayUsers"
            },
            {
              "listName": "sessions"
            }
          ]
        },
        "propertyId": {
          "__rl": true,
          "mode": "list",
          "value": "483751327",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "dimensionsGA4": {
          "dimensionValues": [
            {}
          ]
        },
        "additionalFields": {}
      },
      "credentials": {
        "googleAnalyticsOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "3fb80b30-c2ff-4d1c-a810-de96348d7b41",
      "name": "Send a message to group",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1328,
        176
      ],
      "parameters": {
        "text": "=Weekly Analytics Report by Gemini \n`{{ $today.minus(7,'days').format('yyyy-MM-dd') }}` to `{{ $today.format('yyyy-MM-dd') }}`\n\n{{ $json.output }}",
        "chatId": "",
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fa35b2b5-1ea3-42f5-a1ff-b10716e22e13",
      "name": "Insight Sentiment Analysis",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        976,
        0
      ],
      "parameters": {
        "options": {
          "categories": "Positive, Negative"
        },
        "inputText": "={{ $json.output }}"
      },
      "typeVersion": 1.1
    },
    {
      "id": "605ceecc-27fe-4bf2-9315-290a82c7d6ff",
      "name": "Notify Stakeholders",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1344,
        -96
      ],
      "parameters": {
        "sendTo": "",
        "message": "={{ $('AI Agent').item.json.output }}",
        "options": {},
        "subject": "=GA Weekly Report - Positive Trends - {{ $today.minus(7,'days').format('yyyy-MM-dd') }} - {{ $today.format('yyyy-MM-dd') }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "dd9a5860-f6df-4e7e-a72d-699a772a804f",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -320
      ],
      "parameters": {
        "width": 480,
        "height": 240,
        "content": "## AI-Powered Google Analytics Insights + Sentiment Routing\nThis n8n automation runs weekly to fetch the latest Google Analytics data, generate AI-powered insights, and classify the sentiment of the report.\n\n\ud83d\udca1 Goal: Deliver actionable analytics updates automatically, ensuring positive trends are celebrated and negative trends are addressed quickly."
      },
      "typeVersion": 1
    },
    {
      "id": "edde901a-8909-4c5d-a9b2-a9fa32026123",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -224
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 176,
        "content": "## AI Agent\n\nConsume the aggregated JSON. Processing the JSON with custom prompt that should return the insightful and concise summary"
      },
      "typeVersion": 1
    },
    {
      "id": "5d0523ed-85e4-4e43-a452-6dae0954b919",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        144
      ],
      "parameters": {
        "color": 7,
        "width": 176,
        "height": 128,
        "content": "## Aggregate\n\nNormalize GA rows into a single JSON"
      },
      "typeVersion": 1
    },
    {
      "id": "80607b8d-60fc-4ece-9f7c-5d09bd826a18",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        -304
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 176,
        "content": "## Notify Stakeholders\n\nSend a message with following range date of the weekly report"
      },
      "typeVersion": 1
    },
    {
      "id": "32449586-884b-45b1-855c-8a6796c2de85",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 176,
        "content": "## Send Message\n\nBuild concise alert message for ops/marketing channel"
      },
      "typeVersion": 1
    },
    {
      "id": "e55512cb-9cea-455d-a3c1-1ae31593b1c0",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        320
      ],
      "parameters": {
        "color": 7,
        "width": 272,
        "height": 176,
        "content": "## Simple Memory\n\nSave each week's report and key metrics. Use for trend detection. You can replace with your preferred memory/database."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2e96d5f2-7cb1-405f-8c51-631bb8e7b8d6",
  "connections": {
    "AI Agent": {
      "main": [
        [
          {
            "node": "Insight Sentiment Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get a weekly report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a weekly report": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          },
          {
            "node": "Insight Sentiment Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Insight Sentiment Analysis": {
      "main": [
        [
          {
            "node": "Notify Stakeholders",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send a message to group",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This workflow is ideal for marketing teams, growth analysts, and business owners who need regular Google Analytics insights without manually digging through data. It’s also perfect for organizations that want to ensure positive performance updates reach stakeholders quickly…

Source: https://n8n.io/workflows/7183/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This n8n workflow automates the daily generation of comprehensive analytics reports from multiple websites, processes them using OpenAI's powerful language models, and then delivers the insights direc

Memory Buffer Window, Google Analytics, Agent +6
AI & RAG

This workflow is for beauty salons who want consistent, high‑quality social media content without writing every post manually. It also suits agencies and automation builders who manage multiple beauty

Telegram, Google Sheets Trigger, Agent +26
AI & RAG

This workflow was born out of a very real problem.

Output Parser Structured, OpenAI Chat, Memory Buffer Window +11
AI & RAG

Use cases are many: Manage your Gmail inbox, schedule calendar events, and handle contact details — all from one central AI-powered assistant. Perfect for freelancers managing clients, agency owners w

Agent, Gmail Tool, Google Gemini Chat +10
AI & RAG

This workflow automatically transforms your messy inbox into a neatly organized space while ensuring you never miss a critical message. It connects to your Gmail account and triggers for every new ema

Gmail Trigger, Output Parser Structured, Gmail Tool +8