GooglePlacesSwift Framework Reference

PlaceAnalyticsEvent

struct PlaceAnalyticsEvent
extension PlaceAnalyticsEvent : Equatable, Hashable, Sendable, SendableMetatype

An analytics event reported by a Places UI Kit component.

Places UI Kit components deliver events to handlers registered with View.onPlaceAnalyticsEvent(_:).

  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    static func == (a: PlaceAnalyticsEvent, b: PlaceAnalyticsEvent) -> Bool
  • The Places UI Kit components that report analytics events.

    Declaration

    Swift

    enum ComponentType
  • The configurable content areas of a component that a PlaceAnalyticsEvent can relate to.

    Declaration

    Swift

    enum ContentType
  • Tag

    Tags that describe what happened in a PlaceAnalyticsEvent.

    Tags name the user’s intent or destination rather than the control that triggered it, so the same action reports the same tags wherever it appears. Events combine several independent tags; for example, tapping the Directions button reports click, directions, and outbound.

    Declaration

    Swift

    enum Tag
  • The Places UI Kit component that reported the event.

    One of the PlaceAnalyticsEvent.ComponentType constants, such as PlaceAnalyticsEvent.ComponentType.placeDetailsCompact.

    Declaration

    Swift

    var componentType: String
  • The PlaceAnalyticsEvent.ContentType value of the configurable content area the event relates to, or nil if the event does not relate to a configurable content area.

    Declaration

    Swift

    var contentType: String?
  • Hashes the essential components of this value by feeding them into the given hasher.

    Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

    Important

    In your implementation of hash(into:), don’t call finalize() on the hasher instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.

    Declaration

    Swift

    func hash(into hasher: inout Hasher)
  • The hash value.

    Hash values are not guaranteed to be equal across different executions of your program. Do not save hash values to use during a future execution.

    Important

    hashValue is deprecated as a Hashable requirement. To conform to Hashable, implement the hash(into:) requirement instead. The compiler provides an implementation for hashValue for you.

    Declaration

    Swift

    var hashValue: Int { get }
  • Creates an analytics event.

    Declaration

    Swift

    init(componentType: String, tags: Set<String> = [], places: [Place] = [], contentType: String? = nil)

    Parameters

    componentType

    The PlaceAnalyticsEvent.ComponentType value of the reporting component.

    tags

    The PlaceAnalyticsEvent.Tag values that describe what happened.

    places

    The place(s) the event applies to.

    contentType

    The PlaceAnalyticsEvent.ContentType value of the related content area.

  • The place(s) the event applies to, or an empty array if no place is loaded.

    Each place contains only its ID, coordinate, and viewport.

    Declaration

    Swift

    var places: [Place]
  • The PlaceAnalyticsEvent.Tag values that describe what happened, such as PlaceAnalyticsEvent.Tag.click and PlaceAnalyticsEvent.Tag.outbound.

    Tags are independent of each other and have no order.

    Declaration

    Swift

    var tags: Set<String>