Marketing
Google Analytics Data Aggregation and Email Report
This workflow aggregates Google Analytics data (page engagement, search results, country views) for the current and prior week, then formats and emails a comprehensive report.
Built · ~4.5 hours saved per week
Anyone needing weekly Google Analytics reports delivered via email. This includes marketers, SEO specialists, website owners, and business analysts.
This workflow gathers Google Analytics data for page engagement, Google Search Console, and country views from the current and previous weeks. It processes the data, formats it into an easy-to-read HTML table, and emails a weekly report.
1. Set up Google Analytics credentials. 2. Input your Google Analytics property ID. 3. Configure the email recipient.
n8n, Google Analytics account, Gmail account.
Users can change the recipient email address, the email subject, and sender name. You can also adjust the date ranges for data retrieval. Advanced users can modify the JavaScript code to change data parsing or report formatting.
Key Technologies: n8n,Google Analytics GA4 API,JavaScript,Gmail
Automation Value: - Saves time: Automates data collection and report generation, eliminating manual effort. - Improves efficiency: Delivers a consistent weekly report without manual intervention. - Enables data-driven decisions: Provides a quick overview of website performance by comparing current and previous week data. - Reduces human error: Standardizes data extraction and presentation.
Best Practices: - Modular design: Breaks down complex tasks (data retrieval, parsing, aggregation, formatting) into smaller, manageable nodes. - Clear naming conventions: Node names reflect their function, improving readability. - Date range automation: Uses dynamic expressions ($today.minus) for date ranges, ensuring the workflow always fetches the latest weekly data. - Error handling in code nodes: Includes try-catch blocks and input validation in JavaScript code to prevent workflow failures and provide meaningful console messages. - URL encoding for data transfer: Uses encodeURIComponent to safely pass JSON data between code nodes, preventing issues with special characters. - Styled HTML reports: Generates visually appealing and easy-to-read reports using inline CSS in the "Format Data" node. - Scheduled execution: Uses a "Schedule Trigger" for autonomous, regular report delivery.
Tags: SEO, Reports & Analytics, Data Transformation, Google, Timer
Integrations: Code, Email, Schedule