All

struct All

Keys that availible for all hits in Google Analytics Measurement Protocol.

  • This will only change when there are changes made that are not backwards compatible.

    • Example: v=1

    Declaration

    Swift

    static let protocolVersion: String
  • The format is UA-XXXX-Y. All collected data is associated by this ID.

    • Example: tid=UA-XXXX-Y

    Declaration

    Swift

    static let trackingID: String
  • Indicates the data source of the hit. Hits sent from analytics.js will have data source set to ‘web’; hits sent from one of the mobile SDKs will have data source set to ‘app’.

    • Example: ds=app

    Declaration

    Swift

    static let dataSource: String
  • This field is required if User ID (uid) is not specified in the request. This anonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID (version 4) as described in documentation

    • Example: cid=35009a79-1a05-49d7-b876-2b884d0f825b

    Declaration

    Swift

    static let clientID: String
  • Specifies the screen resolution.

    • Example: sr=800x600

    Declaration

    Swift

    static let screenResolution: String
  • Specifies the language.

    • Example: ul=en-us

    Declaration

    Swift

    static let userLanguage: String
  • The type of hit.

    • Example: t=pageview

    Declaration

    Swift

    static let hitType: String
  • Undocumented

    See more

    Declaration

    Swift

    struct HitType
  • Custom Dimension Each custom dimension has an associated index. There is a maximum of 20 custom dimensions (200 for Analytics 360 accounts). The dimension index must be a positive integer between 1 and 200, inclusive.

    • Example: cd1=Sports cd2=Cooking

    Declaration

    Swift

    static let customDimension: String