{
  "id": "DEmOnEbgsR5bEoAH",
  "name": "Daily paid acquisition intelligence report",
  "tags": [
    {
      "id": "ZLNp4q7bLInAPzlr",
      "name": "Databox MCP",
      "createdAt": "2026-02-12T05:49:19.149Z",
      "updatedAt": "2026-02-12T05:49:19.149Z"
    },
    {
      "id": "OITWk9JNRp1srhj6",
      "name": "Paid Ads",
      "createdAt": "2026-02-26T16:50:04.993Z",
      "updatedAt": "2026-02-26T16:50:04.993Z"
    },
    {
      "id": "fjJWe0P5GkqnbIXj",
      "name": "Automation",
      "createdAt": "2026-02-12T05:49:19.177Z",
      "updatedAt": "2026-02-12T05:49:19.177Z"
    }
  ],
  "nodes": [
    {
      "id": "51b9a6e9-5a6f-4815-9c7a-43fb276e0bee",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 1680,
        "height": 400,
        "content": "## Daily Paid Acquisition Intelligence Report via Databox MCP\n\nGet a daily intelligence briefing on your paid acquisition performance. Three specialized AI agents run in sequence: Agent 1 analyzes website behavior, Agent 2 analyzes paid channel performance across all connected platforms, and Agent 3 runs cross-channel correlation analysis - surfacing insights like cost per quality visit, channel efficiency rankings, and concrete budget reallocation recommendations.\n\n### How it works\n`Schedule Trigger` - `Agent 1: Website Analysis (Databox MCP)` - `Agent 2: Paid Acquisition Analysis (Databox MCP)` - `Agent 3: Correlations + Recommendations` - `HTML Email Report`\n\n### What you need\n- Databox account with website analytics and at least one paid ads platform connected - Free plan available: https://databox.com/?ref=n8n\n- OpenAI API key\n- Gmail account\n\n### Supported Data Sources\nGoogle Analytics - Google Ads - Facebook Ads - LinkedIn Ads - TikTok Ads - YouTube Ads - Microsoft Ads - Reddit Ads - And 100+ more - https://databox.com/integrations"
      },
      "typeVersion": 1
    },
    {
      "id": "82c15713-2ebc-4b54-8d9d-f05c91200446",
      "name": "Sticky Note 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        448
      ],
      "parameters": {
        "color": 4,
        "width": 440,
        "height": 772,
        "content": "## 1 - Schedule\n\n### What this section does\nTriggers the workflow every day at 8 AM and captures today's date so all three agents use consistent reporting windows.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Change the schedule (optional)\n- Click the \"Every Monday 8 AM\" node\n- Click on the Cron Expression field\n- Modify the schedule (e.g., change to daily, weekly on different day, or custom time)"
      },
      "typeVersion": 1
    },
    {
      "id": "312cd311-e63a-4ca2-897e-dc69564ecfb1",
      "name": "Sticky Note 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        448
      ],
      "parameters": {
        "color": 6,
        "width": 1204,
        "height": 772,
        "content": "## 2 - AI Agents + Databox MCP Setup\n\n### What this section does\nThree agents run in sequence:\n- **Agent 1 - Website Analyst**: fetches sessions, bounce rate, pages per session, goal completions from your website analytics source\n- **Agent 2 - Paid Acquisition Analyst**: fetches spend, CPC, CTR, ROAS and impressions for every connected paid platform\n- **Agent 3 - Correlation Analyst**: receives both outputs, finds cross-channel patterns, ranks channel efficiency, and writes the final HTML report (no MCP calls needed)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### What you need to do\n1. Click each **OpenAI Chat Model** node and add your API key\n   - You can replace with an **Anthropic Chat Model** node\n2. Click each **Databox MCP Tool** node - set Authentication to `OAuth2` - authorize with your Databox account\n3. Ensure at least one paid ads platform and a website analytics source are connected in Databox"
      },
      "typeVersion": 1
    },
    {
      "id": "cf0ecb3b-06b4-4e6a-853d-fb4a01d85df8",
      "name": "Sticky Note 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        448
      ],
      "parameters": {
        "color": 5,
        "width": 492,
        "height": 772,
        "content": "## 3 - Email Report Output\n\n### What this section does\nFormats the correlation analysis as a styled HTML email and delivers it to the configured recipient every morning.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### What you need to do\n- Click the **Send Email** node and add your **Gmail credential**\n- Update the **To** field with the recipient email address\n- **Optional**: Add a Slack node after Prepare Email for an additional Slack notification"
      },
      "typeVersion": 1
    },
    {
      "id": "184c61e2-e4b9-496d-90fc-1d2fcfce9a15",
      "name": "Every Day 8 AM",
      "type": "n8n-nodes-base.scheduleTrigger",
      "notes": "Triggers every day at 8 AM - adjust the cron expression to change frequency",
      "position": [
        80,
        704
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 8 * * *"
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e7a6fbb9-ce74-49a1-a21b-e883e008d388",
      "name": "Get Current Date",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        272,
        704
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "8cb84507-2f08-45eb-940e-bee02b6f06a3",
      "name": "Website Analysis Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        608,
        704
      ],
      "parameters": {
        "text": "=Today's Date: {{ $json.formattedDate }}\n\nFetch website performance data from Databox for the last 7 days compared to the previous 7 days. Calculate the exact date ranges based on today's date.\n\nFocus on: traffic volume, engagement quality (bounce rate, pages per session, session duration), and conversion metrics (goal completions, conversion rate).",
        "options": {
          "systemMessage": "You are a website analytics specialist. Fetch website performance data from Databox via MCP and produce a structured plain-text analysis.\n\nSTEP-BY-STEP:\n1. Call list_accounts to get the account ID.\n2. Call list_data_sources to find connected website analytics sources (Google Analytics, GA4, Adobe Analytics, etc.).\n3. For each website analytics source found, fetch these metrics for both the last 7 days and the previous 7 days:\n   - Sessions or Users\n   - Bounce Rate\n   - Pages per Session\n   - Average Session Duration\n   - Goal Completions or Conversions\n   - Conversion Rate\n4. Calculate week-over-week (WoW) percentage change for each metric.\n\nOUTPUT FORMAT:\nProduce a structured plain-text summary (NOT HTML) with:\n- Data source name\n- Sessions/Users: current value, WoW change %\n- Bounce Rate: current value, WoW change %\n- Pages per Session: current value, WoW change %\n- Avg Session Duration: current value, WoW change %\n- Goal Completions: current value, WoW change %\n- Conversion Rate: current value, WoW change %\n- 2-3 short observations about website behavior patterns\n\nIf no website analytics source is connected, output: \"No website analytics data available.\"\nDo NOT produce HTML - output plain text only."
        },
        "promptType": "define"
      },
      "retryOnFail": false,
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "17afd3f1-7697-46bf-a303-7a91ba14b4c8",
      "name": "Databox MCP Tool",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        752,
        896
      ],
      "parameters": {
        "options": {},
        "endpointUrl": "https://mcp.databox.com/mcp",
        "authentication": "mcpOAuth2Api"
      },
      "credentials": {
        "mcpOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7843456d-dba3-484c-8982-f76640ac7ce6",
      "name": "Paid Acquisition Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        704
      ],
      "parameters": {
        "text": "=Today's Date: {{ $('Get Current Date').item.json.formattedDate }}\n\nWebsite analysis from Agent 1:\n{{ $json.output }}\n\nNow fetch paid acquisition performance data from Databox for the same period (last 7 days vs previous 7 days). Focus on all connected paid advertising platforms - fetch spend efficiency (CPC, CTR, ROAS), volume metrics (impressions, clicks), and conversion data per platform.",
        "options": {
          "systemMessage": "You are a paid acquisition analyst. Fetch paid channel performance data from Databox via MCP and produce a structured plain-text analysis.\n\nSTEP-BY-STEP:\n1. Call list_accounts to get the account ID.\n2. Call list_data_sources to find all connected paid advertising platforms (Google Ads, Facebook Ads, LinkedIn Ads, TikTok Ads, Microsoft Ads, Reddit Ads, Snapchat Ads, Pinterest Ads, X/Twitter Ads, YouTube Ads).\n3. For EACH connected paid platform, fetch these metrics for both the last 7 days and the previous 7 days:\n   - Spend or Cost\n   - Clicks\n   - CPC (Cost Per Click)\n   - CTR (Click-Through Rate)\n   - Impressions\n   - ROAS or Conversions\n4. Calculate WoW percentage change for each metric on each platform.\n5. Calculate aggregated totals across all platforms: total spend, total clicks, total impressions, total conversions, average CPC, average CTR.\n\nOUTPUT FORMAT:\nProduce a structured plain-text summary (NOT HTML) with:\n- For EACH connected platform: name, spend, clicks, CPC, CTR, impressions, ROAS/conversions with WoW changes\n- Aggregated totals across all platforms with WoW changes\n- 2-3 short observations about paid performance patterns\n\nIf no paid ads platforms are connected, output: \"No paid advertising data available.\"\nDo NOT produce HTML - output plain text only."
        },
        "promptType": "define"
      },
      "retryOnFail": false,
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "e6de4884-bf7c-45f1-a5c8-3481b9ed5f5b",
      "name": "Correlation Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1328,
        704
      ],
      "parameters": {
        "text": "=Today's Date: {{ $('Get Current Date').item.json.formattedDate }}\n\nWEBSITE ANALYSIS (from Agent 1):\n{{ $('Website Analysis Agent').item.json.output }}\n\nPAID ACQUISITION ANALYSIS (from Agent 2):\n{{ $json.output }}\n\nUsing ONLY the data above (do not call any external tools), produce a complete daily intelligence report as an HTML email body. Structure it as follows:\n\n1. Executive Summary - 2-3 sentences on the single most important cross-channel finding\n2. Website Performance - table with key metrics and WoW changes\n3. Paid Acquisition - per-platform tables with spend, clicks, CPC, CTR, ROAS and WoW changes\n4. Correlation Analysis - the unique insight layer:\n   - Does this week's paid spend correlate with website traffic volume?\n   - Which paid channels drive the highest-quality visitors (lowest bounce rate, highest conversion rate)?\n   - Estimated cost per website conversion by channel (total paid spend divided by goal completions)\n   - Efficiency ranking of paid channels (best to worst)\n5. Recommendations - exactly 3 specific, actionable recommendations based on the data\n6. Footer\n\nOutput ONLY the HTML body content starting with a <div> tag. Do not include <html>, <head>, or <body> tags.",
        "options": {
          "systemMessage": "You are a marketing intelligence analyst specializing in cross-channel correlation analysis. You do NOT call any tools - you analyze only the data provided in the prompt.\n\nYour job is to synthesize website analytics and paid acquisition data into a single HTML report that surfaces insights neither dataset could reveal on its own.\n\nHTML FORMATTING RULES:\n- Use Databox brand color #3164FA for all headings and table headers\n- Color WoW changes: green (#059669) for improvements, red (#dc2626) for declines\n- Font: 'Helvetica Neue', Arial, sans-serif throughout\n- Table headers: background #3164FA, white text, padding 12px\n- Alternating table rows: #ffffff and #f9fafb\n- Section headings: <h3> with color #3164FA, font-weight 600\n- Executive summary box: background #F7F9FC, left border 4px solid #3164FA, padding 15px, border-radius 4px\n- Correlation insights box: background #FFF8E7, left border 4px solid #F59E0B, padding 15px, border-radius 4px\n- Recommendations box: background #F0FDF4, left border 4px solid #059669, padding 15px, border-radius 4px\n- Footer: small gray text, border-top, font-size 11px\n- No em-dashes - use hyphens instead\n- Format numbers with thousand separators (commas)\n- Currency as $X,XXX.XX, percentages as X.XX%\n- If data for a section is missing, note it gracefully rather than showing an error"
        },
        "promptType": "define"
      },
      "retryOnFail": false,
      "typeVersion": 3,
      "alwaysOutputData": true
    },
    {
      "id": "7ff62ebf-8eca-4085-ab2d-aa3ad1656f22",
      "name": "Prepare Email",
      "type": "n8n-nodes-base.code",
      "position": [
        1808,
        704
      ],
      "parameters": {
        "jsCode": "const agentOutput = $input.first().json.output || '';\n\nconst today = new Date();\nconst dateStr = today.toLocaleDateString('en-US', {\n  month: 'long',\n  day: 'numeric',\n  year: 'numeric'\n});\n\nreturn [{\n  json: {\n    subject: `Daily Paid Acquisition Report - ${dateStr}`,\n    htmlBody: agentOutput\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "f19469a6-7667-4595-93ae-750695e0b3d6",
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "notes": "Update the To field with the recipient email address",
      "position": [
        2000,
        704
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.htmlBody }}",
        "options": {},
        "subject": "={{ $json.subject }}"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "5801443e-8b91-4c50-9c39-4a51ea8981aa",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        16
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 400,
        "content": "### How to connect Databox MCP Tool in n8n\n@[youtube](892KtXhv-vI)"
      },
      "typeVersion": 1
    },
    {
      "id": "3a24b5cd-a138-4b86-845a-055af932339a",
      "name": "Databox MCP Tool 2",
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "position": [
        1136,
        896
      ],
      "parameters": {
        "options": {},
        "endpointUrl": "https://mcp.databox.com/mcp",
        "authentication": "mcpOAuth2Api"
      },
      "credentials": {
        "mcpOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ec486f27-d925-477d-b2e3-bccbdcd08b4a",
      "name": "OpenAI Chat Model 3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1328,
        896
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "maxTokens": 4096
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "26492b87-50d3-4104-9b3b-9aa3a4ca10f3",
      "name": "OpenAI Chat Model 2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        928,
        896
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "maxTokens": 2048
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "6644413f-f864-4e8a-b85f-de5c3794cfbf",
      "name": "OpenAI Chat Model 1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        560,
        896
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "maxTokens": 2048
        },
        "builtInTools": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "39bced5e-61fc-44d0-956b-acd8337a6cf5",
  "connections": {
    "Prepare Email": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Every Day 8 AM": {
      "main": [
        [
          {
            "node": "Get Current Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Databox MCP Tool": {
      "ai_tool": [
        [
          {
            "node": "Website Analysis Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Current Date": {
      "main": [
        [
          {
            "node": "Website Analysis Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Correlation Agent": {
      "main": [
        [
          {
            "node": "Prepare Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Databox MCP Tool 2": {
      "ai_tool": [
        [
          {
            "node": "Paid Acquisition Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model 1": {
      "ai_languageModel": [
        [
          {
            "node": "Website Analysis Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model 2": {
      "ai_languageModel": [
        [
          {
            "node": "Paid Acquisition Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model 3": {
      "ai_languageModel": [
        [
          {
            "node": "Correlation Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Paid Acquisition Agent": {
      "main": [
        [
          {
            "node": "Correlation Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Website Analysis Agent": {
      "main": [
        [
          {
            "node": "Paid Acquisition Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}