This integration allows you to import your e-mail event data like opens, clicks or bounces from Mandrill into Google Analytics for a single interface dashboard and deeper e-mail performance analysis.
This integration is based on webhooks so data is ready in nearly real-time.
Supported e-mail events:
- Send
- Open
- Click
- Spam
- Hard Bounce
This integration allows you to explore your data by the following dimensions:
- E-mail type, in case your application have different e-mail types
- Device category (mobile, desktop, tablet)
- Geographic location (city, country...)
- Hostname (domain)
Universal Analytics user_id feature is also supported.
First, install the webhook processing script in your server. PHP sample code is available here, but you can use any other server side language if you prefer.
From your Mandrill account, go to Settings > Webhooks > Add a Webhook.
Fill the form using the following settings:
Please do not forget to replace the "Post To URL" field with the actual URL your webhook processing script is located.
From your Google Analytics account, go to Admin > Custom Definitions > Custom Metrics.
Then create these custom metrics:
Name | Scope | Index | Type | Min. Value | Max. Value | Active |
---|---|---|---|---|---|---|
Sent | hit | 1 | integer | - | - | Yes |
Opens | hit | 2 | integer | - | - | Yes |
Clicks | hit | 3 | integer | - | - | Yes |
Marked as Spam | hit | 4 | integer | - | - | Yes |
Bounces | hit | 5 | integer | - | - | Yes |
Install this Google Analytics custom report into any data views in your account.
In case your web application uses different e-mail types and you want to segment your data based on this dimension or you want to take advantage of the Universal Analytics user_id feature, please set your application to be pass the email_type and/or user_id metadata fields to Mandrill at the time of sending new e-mails.