> For the complete documentation index, see [llms.txt](https://docs.emaillabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emaillabs.io/en/email/email-api/settings/smtp-accounts/google-analytics/google-analytics-configuration.md). Agents can also search and read this documentation through its [MCP server](https://docs.emaillabs.io/~gitbook/mcp).

# Google Analytics Configuration

To configure Google Analytics for emails, follow these steps:

* Go to the SMTP server settings.
* Locate the Google Analytics option and toggle the switch to activate it.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2Fpo3tOQyfp2eORXyKlX40%2Fgoogle-analytics_1%402x.png?alt=media&amp;token=ca6b9105-fbd4-4db7-8421-fa6509acdd4d" alt=""><figcaption></figcaption></figure>

* Select the ‘Add new rule’ option.
* Set the rule for:

  • From field (sender’s email address) or

  • Subject field of the message.
* In the ‘Search Phrase’ field, enter the expression that the system will look for in the message fields to apply the appropriate rule.
* In the ‘utm\_campaign’ field, enter a unique campaign name that will be visible in Google Analytics, allowing for easy monitoring of the results for that specific campaign.
* For messages that do not meet any defined rule, the system will automatically assign the default campaign name *default*.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2F7o2IMKL3j6SYNrLji9Ys%2Fga-config%402x.png?alt=media&amp;token=bbe1b675-0c9c-4e00-ab4f-200d2ebc5e63" alt=""><figcaption></figcaption></figure>

Once this feature is enabled, the system will automatically add tracking parameters to links in email messages, allowing for the analysis of traffic and recipient behaviors in Google Analytics.
