What This Workflow Does
This workflow automatically collects Google Analytics and Google Search Console data every week.
It saves time by removing manual report making.
It fetches page engagement, search clicks, and country user stats.
It compares current week and prior week data.
Finally, it sends a clear HTML report by email.
The goal is to save hours of work and stop mistakes from manual data copying.
Who Should Use This Workflow
People managing Google Analytics data for marketing or business reporting benefit most.
Users who want accurate, repeated weekly reports without doing extra work will find this helpful.
Tools and Services Used
- Google Analytics API: Provides page engagement and country-level data.
- Google Search Console data: Accessed via Google Analytics for search metrics.
- n8n automation platform: Runs the workflow and handles data processing.
- Gmail API with OAuth2: Sends the weekly email report securely.
Beginner Step-by-Step: How to Use This Workflow in n8n
Step 1: Import the Workflow
- Download the workflow file by clicking the Download button on this page.
- Go to the n8n editor where you want to run this automation.
- Use “Import from File” option in n8n to load the downloaded workflow.
Step 2: Configure Required Settings
- Add your Google Analytics OAuth2 credentials in n8n.
- Add Gmail OAuth2 credentials in n8n for email sending.
- Look through Google Analytics nodes and update the Property ID if different from default.
- Change email recipient address in the Gmail node to who should get reports.
Step 3: Test the Workflow
- Run the workflow manually using the Manual Trigger to check data pulls and email output.
Step 4: Activate for Production
- Enable the workflow in n8n and, if scheduled, make sure the Schedule Trigger is activated.
- Check regularly that the workflow runs without errors.
For users running on own servers, consider reliable self-host n8n options.
Inputs, Processing, and Outputs
Inputs
- Google Analytics property ID.
- OAuth2 credentials for Google Analytics and Gmail APIs.
- Scheduled trigger or manual trigger to start workflow.
Processing Steps
- Pull current week’s page engagement, search clicks, and country stats from Google Analytics API.
- Pull prior week’s matching data with adjusted date ranges.
- Use multiple Code nodes to parse raw API JSON data into simple, clean JSON arrays.
- Collect all parsed data strings in a Set node for aggregation.
- Decode, parse, and merge the JSON strings into one combined data object for easier use.
- Format the full data object into color-coded HTML tables with inline CSS styling in a Code node.
Outputs
- An email sent via the Gmail node with the full HTML report to specified recipient(s).
Edge Cases and Common Problems
- If Google Analytics data is missing or empty, the parsing Code nodes might fail. Fix by checking if the configured property ID and date ranges are correct.
- Google API limits may cause incomplete data. Retry after waiting or check API quota.
- The Gmail sending node may fail if OAuth2 credentials are not authorized properly. Refresh or reauthenticate tokens.
- Schedule triggers must be enabled and workflows activated to run automatically.
Customization Ideas
- Change how often reports run by adjusting the Schedule Trigger.
- Add or remove metrics in Google Analytics nodes’ metric fields to get different insights.
- Update recipient emails to notify different or multiple users in the Gmail node.
- Tweak report HTML and CSS styling inside the formatting Code node to change colors or layout.
- Swap out the hardcoded Google Analytics property ID for other accounts as needed.
Summary and Final Results
✓ Saves 3 to 5 hours weekly by automating Google Analytics data fetching and reporting.
✓ Removes errors from manual copying and formatting of analytics data.
✓ Delivers easy to read, color-coded weekly reports by email automatically.
✓ Compares current week vs prior week on page engagement, search data, and user country stats.
✓ Lets users focus on analysis and decisions instead of report making.

