GoogleAnalytics

public struct GoogleAnalytics : Encodable

The GoogleAnalytics class is used to toggle the Google Analytics setting, which adds GA parameters to links in the email.

  • Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)

    Declaration

    Swift

    public let source: String?
  • Name of the marketing medium. (e.g. Email)

    Declaration

    Swift

    public let medium: String?
  • Used to identify any paid keywords.

    Declaration

    Swift

    public let term: String?
  • Used to differentiate your campaign from advertisements.

    Declaration

    Swift

    public let content: String?
  • The name of the campaign.

    Declaration

    Swift

    public let campaign: String?
  • A Bool indicating if the setting is enabled or not.

    Declaration

    Swift

    public let enable: Bool
  • Initializes the setting with the various Google Analytics parameters.

    If the Google Analytics setting is normally enabled by default on your SendGrid account and you want to disable it for this particular email, specify nil for all the parameters (the default values for each parameter is nil so you can also just initialize with GoogleAnalytics() to set everything to nil).

    Declaration

    Swift

    public init(source: String? = nil, medium: String? = nil, term: String? = nil, content: String? = nil, campaign: String? = nil)

    Parameters

    source

    Name of the referrer source. (e.g. Google, SomeDomain.com, or Marketing Email)

    medium

    Name of the marketing medium. (e.g. Email)

    term

    Used to identify any paid keywords.

    content

    Used to differentiate your campaign from advertisements.

    campaign

    The name of the campaign.