Version: v1.20.4 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 11 Imported by: 160


Mailchimp Input Plugin

Pulls campaign reports from the Mailchimp API.


This section contains the default TOML to configure the plugin. You can generate it using telegraf --usage mailchimp.

  ## MailChimp API key
  ## get from
  api_key = "" # required
  ## Reports for campaigns sent more than days_old ago will not be collected.
  ## 0 means collect all and is the default value.
  days_old = 0
  ## Campaign ID to get, if empty gets all campaigns, this option overrides days_old
  # campaign_id = ""
  • mailchimp
    • tags:
      • id
      • campaign_title
    • fields:
      • emails_sent (integer, emails)
      • abuse_reports (integer, reports)
      • unsubscribed (integer, unsubscribes)
      • hard_bounces (integer, emails)
      • soft_bounces (integer, emails)
      • syntax_errors (integer, errors)
      • forwards_count (integer, emails)
      • forwards_opens (integer, emails)
      • opens_total (integer, emails)
      • unique_opens (integer, emails)
      • open_rate (double, percentage)
      • clicks_total (integer, clicks)
      • unique_clicks (integer, clicks)
      • unique_subscriber_clicks (integer, clicks)
      • click_rate (double, percentage)
      • facebook_recipient_likes (integer, likes)
      • facebook_unique_likes (integer, likes)
      • facebook_likes (integer, likes)
      • industry_type (string, type)
      • industry_open_rate (double, percentage)
      • industry_click_rate (double, percentage)
      • industry_bounce_rate (double, percentage)
      • industry_unopen_rate (double, percentage)
      • industry_unsub_rate (double, percentage)
      • industry_abuse_rate (double, percentage)
      • list_stats_sub_rate (double, percentage)
      • list_stats_unsub_rate (double, percentage)
      • list_stats_open_rate (double, percentage)
      • list_stats_click_rate (double, percentage)




This section is empty.


This section is empty.


This section is empty.


type APIError

type APIError struct {
	Status   int    `json:"status"`
	Type     string `json:"type"`
	Title    string `json:"title"`
	Detail   string `json:"detail"`
	Instance string `json:"instance"`

func (APIError) Error

func (e APIError) Error() string

type Bounces

type Bounces struct {
	HardBounces  int `json:"hard_bounces"`
	SoftBounces  int `json:"soft_bounces"`
	SyntaxErrors int `json:"syntax_errors"`

type ChimpAPI

type ChimpAPI struct {
	Transport http.RoundTripper

	// contains filtered or unexported fields

func NewChimpAPI

func NewChimpAPI(apiKey string, log telegraf.Logger) *ChimpAPI

func (*ChimpAPI) GetReport

func (a *ChimpAPI) GetReport(campaignID string) (Report, error)

func (*ChimpAPI) GetReports

func (a *ChimpAPI) GetReports(params ReportsParams) (ReportsResponse, error)

type Clicks

type Clicks struct {
	ClicksTotal            int     `json:"clicks_total"`
	UniqueClicks           int     `json:"unique_clicks"`
	UniqueSubscriberClicks int     `json:"unique_subscriber_clicks"`
	ClickRate              float64 `json:"click_rate"`
	LastClick              string  `json:"last_click"`

type FacebookLikes

type FacebookLikes struct {
	RecipientLikes int `json:"recipient_likes"`
	UniqueLikes    int `json:"unique_likes"`
	FacebookLikes  int `json:"facebook_likes"`

type Forwards

type Forwards struct {
	ForwardsCount int `json:"forwards_count"`
	ForwardsOpens int `json:"forwards_opens"`

type IndustryStats

type IndustryStats struct {
	Type       string  `json:"type"`
	OpenRate   float64 `json:"open_rate"`
	ClickRate  float64 `json:"click_rate"`
	BounceRate float64 `json:"bounce_rate"`
	UnopenRate float64 `json:"unopen_rate"`
	UnsubRate  float64 `json:"unsub_rate"`
	AbuseRate  float64 `json:"abuse_rate"`

type ListStats

type ListStats struct {
	SubRate   float64 `json:"sub_rate"`
	UnsubRate float64 `json:"unsub_rate"`
	OpenRate  float64 `json:"open_rate"`
	ClickRate float64 `json:"click_rate"`

type MailChimp

type MailChimp struct {
	APIKey     string `toml:"api_key"`
	DaysOld    int    `toml:"days_old"`
	CampaignID string `toml:"campaign_id"`

	Log telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields

func (*MailChimp) Description

func (m *MailChimp) Description() string

func (*MailChimp) Gather

func (m *MailChimp) Gather(acc telegraf.Accumulator) error

func (*MailChimp) Init added in v1.20.4

func (m *MailChimp) Init() error

func (*MailChimp) SampleConfig

func (m *MailChimp) SampleConfig() string

type Opens

type Opens struct {
	OpensTotal  int     `json:"opens_total"`
	UniqueOpens int     `json:"unique_opens"`
	OpenRate    float64 `json:"open_rate"`
	LastOpen    string  `json:"last_open"`

type Report

type Report struct {
	ID            string `json:"id"`
	CampaignTitle string `json:"campaign_title"`
	Type          string `json:"type"`
	EmailsSent    int    `json:"emails_sent"`
	AbuseReports  int    `json:"abuse_reports"`
	Unsubscribed  int    `json:"unsubscribed"`
	SendTime      string `json:"send_time"`

	TimeSeries    []TimeSeries
	Bounces       Bounces       `json:"bounces"`
	Forwards      Forwards      `json:"forwards"`
	Opens         Opens         `json:"opens"`
	Clicks        Clicks        `json:"clicks"`
	FacebookLikes FacebookLikes `json:"facebook_likes"`
	IndustryStats IndustryStats `json:"industry_stats"`
	ListStats     ListStats     `json:"list_stats"`

type ReportsParams

type ReportsParams struct {
	Count          string
	Offset         string
	SinceSendTime  string
	BeforeSendTime string

func (*ReportsParams) String

func (p *ReportsParams) String() string

type ReportsResponse

type ReportsResponse struct {
	Reports    []Report `json:"reports"`
	TotalItems int      `json:"total_items"`

type TimeSeries added in v1.15.0

type TimeSeries struct {
	TimeStamp       string `json:"timestamp"`
	EmailsSent      int    `json:"emails_sent"`
	UniqueOpens     int    `json:"unique_opens"`
	RecipientsClick int    `json:"recipients_click"`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL