# GA4 weekly reporting for n8n

1. Import the .n8n.json file and leave it unpublished. Keep **Read GA4 totals** and **Post to Slack** disabled while their credentials are unset. Run **Run manually**. The fictional sample reaches **Format report** with sessions 1,234, active users 824 and key events 30.

2. Enable the Google Analytics Data API in a Google Cloud project. Configure an n8n generic OAuth2 credential with authorization URL https://accounts.google.com/o/oauth2/v2/auth, token URL https://oauth2.googleapis.com/token and scope https://www.googleapis.com/auth/analytics.readonly. Register the n8n redirect URI with Google. Request offline access using access_type=offline and, if reconnecting without a refresh token, prompt=consent. Connect with a Google user who can read the GA4 property. Select this credential in **Read GA4 totals**, then enable the node.

3. In **Configure report**, set propertyId to the numeric property ID as a string and reportingTimeZone to the GA4 property’s IANA timezone. Use the same workflow timezone in n8n settings so the Wednesday 09:00 schedule follows the same clock. Set useSample to false and leave sendToSlack false.

4. Run manually and compare sessions, active users and key events for the displayed dates with an equivalent GA4 report. Inspect **Read GA4 totals** for missing rows, thresholding, sampling, restricted metrics or other warnings if the validation stops the run. The report uses property-local Monday through Sunday and does not apply segment or channel filters.

5. For delivery, add a Slack bot with chat:write to a test channel. Store Authorization with the value Bearer followed by a space and the bot token in an n8n Header Auth credential. Bind it in **Post to Slack** before enabling this node, set slackChannel to the conversation ID in **Configure report**, and enable sendToSlack. Check the posted message and **Confirm Slack delivery** before using the production destination.

6. Publish or activate the configured workflow to start the schedule. Review failed executions. If a send times out or confirmation fails, check the channel for that date range before rerunning, because replay can post a duplicate.

Google Analytics Data API docs: https://developers.google.com/analytics/devguides/reporting/data/v1

Slack API docs: https://docs.slack.dev/reference/methods/chat.postMessage/
