If you are new to creating authorizations in Lytics, see the Authorizations documentation for more information.

  1. Select Mailgun from the list of providers.
  2. Select the Mailgun API Key method for the authorization.
  3. Enter a Label to identify your authorization.
  4. (Optional) Enter a Description for further context on your authorization.
  5. Enter your Domain and API Key.
  6. Click Save authorization to save your newly-created authorization.

Import Data from Mailgun into Lytics

  1. Authorize Lytics with Mailgun, if you have not previously done so.

  2. Select Setup webhooks from the list of workflows.

  3. This workflow doesn't require any additional configuration. Click Start setup and Lytics will begin collecting data in realtime as users open and click through emails sent from Mailgun.
    Start Mailgun setup


The following fields are included in the default mapping of the mg_events stream:

Source FieldConditional (IF)Lytics User FieldDescriptionType
email(recipient)email unique idEmail Addressstring
emaildomain(recipient)email_domainEmail Domainstring
map("email", epochms())last_channel_activitiesLast Activity By Channelmap[string]time
max(epochms())last_active_tsLast Activedate
set("email")event IN ("opened", "clicked")channelsAll Channels Used[]string
set(url)mg_email_urlsMailgun URLs Clicked[]string
valuect(hash(urlmain(url)))event IN ("opened", "clicked")hashedurlsHashed Urls Visitedmap[string]intsum