FirebaseAnalytics Framework Reference Stay organized with collections Save and categorize content based on your preferences.
Constants
The following constants are available globally.
Enables storage (such as device identifiers) related to advertising.
Declaration
Objective-C
externconstFIRConsentType_NonnullFIRConsentTypeAdStorageEnables storage (such as app identifiers) related to analytics, e.g. visit duration.
Declaration
Objective-C
externconstFIRConsentType_NonnullFIRConsentTypeAnalyticsStorageSets consent for sending user data to Google for advertising purposes.
Declaration
Objective-C
externconstFIRConsentType_NonnullFIRConsentTypeAdUserDataSets consent for personalized advertising.
Declaration
Objective-C
externconstFIRConsentType_NonnullFIRConsentTypeAdPersonalizationConsent status indicating consent is denied. For an overview of which data is sent when consentis denied, seeSDK behavior with consentmode.
Declaration
Objective-C
externconstFIRConsentStatus_NonnullFIRConsentStatusDeniedConsent status indicating consent is granted.
Declaration
Objective-C
externconstFIRConsentStatus_NonnullFIRConsentStatusGrantedAd Impression event. This event signifies when a user sees an ad impression. Note: If you supplythe
AnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately. Params:AnalyticsParameterAdPlatform(String) (optional)AnalyticsParameterAdFormat(String) (optional)AnalyticsParameterAdSource(String) (optional)AnalyticsParameterAdUnitName(String) (optional)AnalyticsParameterCurrency(String) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventAdImpression=@"ad_impression"Add Payment Info event. This event signifies that a user has submitted their paymentinformation. Note: If you supply the
AnalyticsParameterValueparameter, you must also supplytheAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately.Params:AnalyticsParameterCoupon(String) (optional)AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterPaymentType(String) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventAddPaymentInfo=@"add_payment_info"Add Shipping Info event. This event signifies that a user has submitted their shippinginformation. Note: If you supply the
AnalyticsParameterValueparameter, you must also supplytheAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately.Params:AnalyticsParameterCoupon(String) (optional)AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterShippingTier(String) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventAddShippingInfo=@"add_shipping_info"E-Commerce Add To Cart event. This event signifies that an item(s) was added to a cart forpurchase. Add this event to a funnel with
AnalyticsEventPurchaseto gauge the effectivenessof your checkout process. Note: If you supply theAnalyticsParameterValueparameter, you mustalso supply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computedaccurately. Params:AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventAddToCart=@"add_to_cart"E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. Usethis event to identify popular gift items. Note: If you supply the
AnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenuemetrics can be computed accurately. Params:AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventAddToWishlist=@"add_to_wishlist"App Open event. By logging this event when an App becomes active, developers can understand howoften users leave and return during the course of a Session. Although Sessions are automaticallyreported, this event can provide further clarification around the continuous engagement ofapp-users.
Declaration
Objective-C
staticNSString*constkFIREventAppOpen=@"app_open"E-Commerce Begin Checkout event. This event signifies that a user has begun the process ofchecking out. Add this event to a funnel with your
AnalyticsEventPurchaseevent to gauge theeffectiveness of your checkout process. Note: If you supply theAnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenuemetrics can be computed accurately. Params:AnalyticsParameterCoupon(String) (optional)AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventBeginCheckout=@"begin_checkout"Campaign Detail event. Log this event to supply the referral details of a re-engagementcampaign. Note: you must supply at least one of the required parametersAnalyticsParameterSource, AnalyticsParameterMedium or AnalyticsParameterCampaign. Params:
AnalyticsParameterSource(String)AnalyticsParameterMedium(String)AnalyticsParameterCampaign(String)AnalyticsParameterTerm(String) (optional)AnalyticsParameterContent(String) (optional)AnalyticsParameterAdNetworkClickID(String) (optional)AnalyticsParameterCP1(String) (optional)AnalyticsParameterCampaignID(String) (optional)AnalyticsParameterCreativeFormat(String) (optional)AnalyticsParameterMarketingTactic(String) (optional)AnalyticsParameterSourcePlatform(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventCampaignDetails=@"campaign_details"Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Logthis along with
AnalyticsEventSpendVirtualCurrencyto better understand your virtual economy.Params:AnalyticsParameterVirtualCurrencyName(String)AnalyticsParameterValue(Int or Double)
Declaration
Objective-C
staticNSString*constkFIREventEarnVirtualCurrency=@"earn_virtual_currency"Generate Lead event. Log this event when a lead has been generated in the app to understand theefficacy of your install and re-engagement campaigns. Note: If you supply the
AnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately. Params:AnalyticsParameterCurrency(String) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventGenerateLead=@"generate_lead"In-App Purchase event. This event signifies that extra content or a subscription was purchasedby a user inside an app. Note: This is different from the ecommerce purchase event. Note: If yousupply the
AnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately.Params:AnalyticsParameterCurrency(String)AnalyticsParameterFreeTrial(Int) (optional)AnalyticsParameterPrice(Double) (optional)AnalyticsParameterPriceIsDiscounted(Int) (optional)AnalyticsParameterProductID(String) (optional)AnalyticsParameterProductName(String) (optional)AnalyticsParameterQuantity(Int) (optional)AnalyticsParameterSubscription(Int) (optional)AnalyticsParameterValue(Double)
Declaration
Objective-C
staticNSString*constkFIREventInAppPurchase=@"in_app_purchase"Join Group event. Log this event when a user joins a group such as a guild, team or family. Usethis event to analyze how popular certain groups or social features are in your app. Params:
AnalyticsParameterGroupID(String)
Declaration
Objective-C
staticNSString*constkFIREventJoinGroup=@"join_group"Level End event. Log this event when the user finishes a level. Params:
AnalyticsParameterLevelName(String)AnalyticsParameterSuccess(String)
Declaration
Objective-C
staticNSString*constkFIREventLevelEnd=@"level_end"Level Start event. Log this event when the user starts a new level. Params:
AnalyticsParameterLevelName(String)
Declaration
Objective-C
staticNSString*constkFIREventLevelStart=@"level_start"Level Up event. This event signifies that a player has leveled up in your gaming app. It canhelp you gauge the level distribution of your userbase and help you identify certain levels thatare difficult to pass. Params:
AnalyticsParameterLevel(Int)AnalyticsParameterCharacter(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventLevelUp=@"level_up"Login event. Apps with a login feature can report this event to signify that a user has loggedin.
Declaration
Objective-C
staticNSString*constkFIREventLogin=@"login"Post Score event. Log this event when the user posts a score in your gaming app. This event canhelp you understand how users are actually performing in your game and it can help you correlatehigh scores with certain audiences or behaviors. Params:
AnalyticsParameterScore(Int)AnalyticsParameterLevel(Int) (optional)AnalyticsParameterCharacter(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventPostScore=@"post_score"E-Commerce Purchase event. This event signifies that an item(s) was purchased by a user. Note:This is different from the in-app purchase event, which is reported automatically for AppStore-based apps. Note: If you supply the
AnalyticsParameterValueparameter, you must alsosupply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computedaccurately. Params:AnalyticsParameterAffiliation(String) (optional)AnalyticsParameterCoupon(String) (optional)AnalyticsParameterCurrency(String) (optional)AnalyticsParameterEndDate(String) (optional)AnalyticsParameterItemID(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterShipping(Double) (optional)AnalyticsParameterStartDate(String) (optional)AnalyticsParameterTax(Double) (optional)AnalyticsParameterTransactionID(String) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventPurchase=@"purchase"E-Commerce Refund event. This event signifies that a refund was issued. Note: If you supply the
AnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately. Params:AnalyticsParameterAffiliation(String) (optional)AnalyticsParameterCoupon(String) (optional)AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterShipping(Double) (optional)AnalyticsParameterTax(Double) (optional)AnalyticsParameterTransactionID(String) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventRefund=@"refund"E-Commerce Remove from Cart event. This event signifies that an item(s) was removed from a cart.Note: If you supply the
AnalyticsParameterValueparameter, you must also supply theAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately. Params:AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventRemoveFromCart=@"remove_from_cart"Screen View event. This event signifies a screen view. Use this when a screen transition occurs.This event can be logged irrespective of whether automatic screen tracking is enabled. Params:
AnalyticsParameterScreenClass(String) (optional)AnalyticsParameterScreenName(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventScreenView=@"screen_view"Search event. Apps that support search features can use this event to contextualize searchoperations by supplying the appropriate, corresponding parameters. This event can help youidentify the most popular content in your app. Params:
AnalyticsParameterSearchTerm(String)AnalyticsParameterStartDate(String) (optional)AnalyticsParameterEndDate(String) (optional)AnalyticsParameterNumberOfNights(Int) (optional) for hotel bookingsAnalyticsParameterNumberOfRooms(Int) (optional) for hotel bookingsAnalyticsParameterNumberOfPassengers(Int) (optional) for travel bookingsAnalyticsParameterOrigin(String) (optional)AnalyticsParameterDestination(String) (optional)AnalyticsParameterTravelClass(String) (optional) for travel bookings
Declaration
Objective-C
staticNSString*constkFIREventSearch=@"search"Select Content event. This general purpose event signifies that a user has selected some contentof a certain type in an app. The content can be any object in your app. This event can help youidentify popular content and categories of content in your app. Params:
AnalyticsParameterContentType(String)AnalyticsParameterItemID(String)
Declaration
Objective-C
staticNSString*constkFIREventSelectContent=@"select_content"Select Item event. This event signifies that an item was selected by a user from a list. Use theappropriate parameters to contextualize the event. Use this event to discover the most popularitems selected. Params:
AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterItemListID(String) (optional)AnalyticsParameterItemListName(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventSelectItem=@"select_item"Select promotion event. This event signifies that a user has selected a promotion offer. Use theappropriate parameters to contextualize the event, such as the item(s) for which the promotionapplies. Params:
AnalyticsParameterCreativeName(String) (optional)AnalyticsParameterCreativeSlot(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterLocationID(String) (optional)AnalyticsParameterPromotionID(String) (optional)AnalyticsParameterPromotionName(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventSelectPromotion=@"select_promotion"Share event. Apps with social features can log the Share event to identify the most viralcontent. Params:
AnalyticsParameterContentType(String)AnalyticsParameterItemID(String)
Declaration
Objective-C
staticNSString*constkFIREventShare=@"share"Sign Up event. This event indicates that a user has signed up for an account in your app. Theparameter signifies the method by which the user signed up. Use this event to understand thedifferent behaviors between logged in and logged out users. Params:
AnalyticsParameterMethod(String)
Declaration
Objective-C
staticNSString*constkFIREventSignUp=@"sign_up"Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and canhelp you identify which virtual goods are the most popular objects of purchase. Params:
AnalyticsParameterItemName(String)AnalyticsParameterVirtualCurrencyName(String)AnalyticsParameterValue(Int or Double)
Declaration
Objective-C
staticNSString*constkFIREventSpendVirtualCurrency=@"spend_virtual_currency"Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Usethis in a funnel with
AnalyticsEventTutorialCompleteto understand how many users completethis process and move on to the full app experience.Declaration
Objective-C
staticNSString*constkFIREventTutorialBegin=@"tutorial_begin"Tutorial End event. Use this event to signify the user’s completion of your app’s on-boardingprocess. Add this to a funnel with
AnalyticsEventTutorialBeginto gauge the completion rateof your on-boarding process.Declaration
Objective-C
staticNSString*constkFIREventTutorialComplete=@"tutorial_complete"Unlock Achievement event. Log this event when the user has unlocked an achievement in yourgame. Since achievements generally represent the breadth of a gaming experience, this event canhelp you understand how many users are experiencing all that your game has to offer. Params:
AnalyticsParameterAchievementID(String)
Declaration
Objective-C
staticNSString*constkFIREventUnlockAchievement=@"unlock_achievement"E-commerce View Cart event. This event signifies that a user has viewed their cart. Use this toanalyze your purchase funnel. Note: If you supply the
AnalyticsParameterValueparameter, youmust also supply theAnalyticsParameterCurrencyparameter so that revenue metrics can becomputed accurately. Params:AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventViewCart=@"view_cart"View Item event. This event signifies that a user has viewed an item. Use the appropriateparameters to contextualize the event. Use this event to discover the most popular items viewedin your app. Note: If you supply the
AnalyticsParameterValueparameter, you must also supplytheAnalyticsParameterCurrencyparameter so that revenue metrics can be computed accurately.Params:AnalyticsParameterCurrency(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterValue(Double) (optional)
Declaration
Objective-C
staticNSString*constkFIREventViewItem=@"view_item"View Item List event. Log this event when a user sees a list of items or offerings. Params:
AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterItemListID(String) (optional)AnalyticsParameterItemListName(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventViewItemList=@"view_item_list"View Promotion event. This event signifies that a promotion was shown to a user. Add this eventto a funnel with the
AnalyticsEventAddToCartandAnalyticsEventPurchaseto gauge yourconversion process. Params:AnalyticsParameterCreativeName(String) (optional)AnalyticsParameterCreativeSlot(String) (optional)AnalyticsParameterItems([[String: Any]]) (optional)AnalyticsParameterLocationID(String) (optional)AnalyticsParameterPromotionID(String) (optional)AnalyticsParameterPromotionName(String) (optional)
Declaration
Objective-C
staticNSString*constkFIREventViewPromotion=@"view_promotion"View Search Results event. Log this event when the user has been presented with the results of asearch. Params:
AnalyticsParameterSearchTerm(String)
Declaration
Objective-C
staticNSString*constkFIREventViewSearchResults=@"view_search_results"Game achievement ID (String).
let params = [ AnalyticsParameterAchievementID : "10_matches_won", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAchievementID=@"achievement_id"The ad format (e.g. Banner, Interstitial, Rewarded, Native, Rewarded Interstitial, Instream).(String).
let params = [ AnalyticsParameterAdFormat : "Banner", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAdFormat=@"ad_format"Ad Network Click ID (String). Used for network-specific click IDs which vary in format.
let params = [ AnalyticsParameterAdNetworkClickID : "1234567", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAdNetworkClickID=@"aclid"The ad platform (e.g. MoPub, IronSource) (String).
let params = [ AnalyticsParameterAdPlatform : "MoPub", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAdPlatform=@"ad_platform"The ad source (e.g. AdColony) (String).
let params = [ AnalyticsParameterAdSource : "AdColony", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAdSource=@"ad_source"The ad unit name (e.g. Banner_03) (String).
let params = [ AnalyticsParameterAdUnitName : "Banner_03", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAdUnitName=@"ad_unit_name"A product affiliation to designate a supplying company or brick and mortar store location(String).
let params = [ AnalyticsParameterAffiliation : "Google Store", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterAffiliation=@"affiliation"Campaign custom parameter (String). Used as a method of capturing custom data in a campaign.Use varies by network.
let params = [ AnalyticsParameterCP1 : "custom_data", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCP1=@"cp1"The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro tocapture campaign information, otherwise can be populated by developer. Highly Recommended(String).
let params = [ AnalyticsParameterCampaign : "winter_promotion", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCampaign=@"campaign"Campaign ID (String). Used for keyword analysis to identify a specific product promotion orstrategic campaign. This is a required key for GA4 data import.
let params = [ AnalyticsParameterCampaignID : "7877652710", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCampaignID=@"campaign_id"Character used in game (String).
let params = [ AnalyticsParameterCharacter : "beat_boss", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCharacter=@"character"Campaign content (String).
Declaration
Objective-C
staticNSString*constkFIRParameterContent=@"content"Type of content selected (String).
let params = [ AnalyticsParameterContentType : "news article", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterContentType=@"content_type"Coupon code used for a purchase (String).
let params = [ AnalyticsParameterCoupon : "SUMMER_FUN", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCoupon=@"coupon"Creative Format (String). Used to identify the high-level classification of the type of adserved by a specific campaign.
let params = [ AnalyticsParameterCreativeFormat : "display", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCreativeFormat=@"creative_format"The name of a creative used in a promotional spot (String).
let params = [ AnalyticsParameterCreativeName : "Summer Sale", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCreativeName=@"creative_name"The name of a creative slot (String).
let params = [ AnalyticsParameterCreativeSlot : "summer_banner2", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCreativeSlot=@"creative_slot"Currency of the purchase or items associated with the event, in 3-letter ISO_4217 format (String).
let params = [ AnalyticsParameterCurrency : "USD", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterCurrency=@"currency"Flight or Travel destination (String).
let params = [ AnalyticsParameterDestination : "Mountain View, CA", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterDestination=@"destination"Monetary value of discount associated with a purchase (Double).
let params = [ AnalyticsParameterDiscount : 2.0, AnalyticsParameterCurrency : "USD", // e.g. $2.00 USD // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterDiscount=@"discount"The arrival date, check-out date or rental end date for the item. This should be inYYYY-MM-DD format (String).
let params = [ AnalyticsParameterEndDate : "2015-09-14", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterEndDate=@"end_date"Indicates that the associated event should either extend the current session or start a newsession if no session was active when the event was logged. Specify 1 to extend the currentsession or to start a new session; any other value will not extend or start a session.
let params = [ AnalyticsParameterExtendSession : 1, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterExtendSession=@"extend_session"Flight number for travel events (String).
let params = [ AnalyticsParameterFlightNumber : "ZZ800", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterFlightNumber=@"flight_number"Indicates if the user is on a free trial of a subscription. Specify 1 to indicate true and 0 toindicate false (Int).
let params = [ AnalyticsParameterFreeTrial : 1, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterFreeTrial=@"free_trial"Group/clan/guild ID (String).
let params = [ AnalyticsParameterGroupID : "g1", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterGroupID=@"group_id"The index of the item in a list (Int).
let params = [ AnalyticsParameterIndex : 5, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterIndex=@"index"Item brand (String).
let params = [ AnalyticsParameterItemBrand : "Google", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemBrand=@"item_brand"Item category (context-specific) (String).
let params = [ AnalyticsParameterItemCategory : "pants", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemCategory=@"item_category"Item Category (context-specific) (String).
let params = [ AnalyticsParameterItemCategory2 : "pants", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemCategory2=@"item_category2"Item Category (context-specific) (String).
let params = [ AnalyticsParameterItemCategory3 : "pants", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemCategory3=@"item_category3"Item Category (context-specific) (String).
let params = [ AnalyticsParameterItemCategory4 : "pants", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemCategory4=@"item_category4"Item Category (context-specific) (String).
let params = [ AnalyticsParameterItemCategory5 : "pants", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemCategory5=@"item_category5"Item ID (context-specific) (String).
let params = [ AnalyticsParameterItemID : "SKU_12345", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemID=@"item_id"The ID of the list in which the item was presented to the user (String).
let params = [ AnalyticsParameterItemListID : "ABC123", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemListID=@"item_list_id"The name of the list in which the item was presented to the user (String).
let params = [ AnalyticsParameterItemListName : "Related products", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemListName=@"item_list_name"Item Name (context-specific) (String).
let params = [ AnalyticsParameterItemName : "jeggings", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemName=@"item_name"Item variant (String).
let params = [ AnalyticsParameterItemVariant : "Black", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterItemVariant=@"item_variant"The list of items involved in the transaction expressed as
[[String: Any]].let params = [ AnalyticsParameterItems : [ [AnalyticsParameterItemName : "jeggings", AnalyticsParameterItemCategory : "pants"], [AnalyticsParameterItemName : "boots", AnalyticsParameterItemCategory : "shoes"], ], ]
Declaration
Objective-C
staticNSString*constkFIRParameterItems=@"items"Level in game (Int).
let params = [ AnalyticsParameterLevel : 42, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterLevel=@"level"The name of a level in a game (String).
let params = [ AnalyticsParameterLevelName : "room_1", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterLevelName=@"level_name"Location (String). The GooglePlace ID that corresponds to the associated event. Alternatively, you can supply your own customLocation ID.
let params = [ AnalyticsParameterLocation : "ChIJiyj437sx3YAR9kUWC8QkLzQ", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterLocation=@"location"The location associated with the event. Preferred to be the GooglePlace ID that corresponds to theassociated item but could be overridden to a custom location ID string.(String).
let params = [ AnalyticsParameterLocationID : "ChIJiyj437sx3YAR9kUWC8QkLzQ", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterLocationID=@"location_id"Marketing Tactic (String). Used to identify the targeting criteria applied to a specificcampaign.
let params = [ AnalyticsParameterMarketingTactic : "Remarketing", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterMarketingTactic=@"marketing_tactic"The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended(String).
let params = [ AnalyticsParameterMedium : "email", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterMedium=@"medium"A particular approach used in an operation; for example, “facebook” or “email” in the contextof a sign_up or login event. (String).
let params = [ AnalyticsParameterMethod : "google", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterMethod=@"method"Number of nights staying at hotel (Int).
let params = [ AnalyticsParameterNumberOfNights : 3, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterNumberOfNights=@"number_of_nights"Number of passengers traveling (Int).
let params = [ AnalyticsParameterNumberOfPassengers : 11, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterNumberOfPassengers=@"number_of_passengers"Number of rooms for travel events (Int).
let params = [ AnalyticsParameterNumberOfRooms : 2, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterNumberOfRooms=@"number_of_rooms"Flight or Travel origin (String).
let params = [ AnalyticsParameterOrigin : "Mountain View, CA", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterOrigin=@"origin"The chosen method of payment (String).
let params = [ AnalyticsParameterPaymentType : "Visa", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterPaymentType=@"payment_type"Purchase price (Double).
let params = [ AnalyticsParameterPrice : 1.0, AnalyticsParameterCurrency : "USD", // e.g. $1.00 USD // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterPrice=@"price"Indicates if an item’s price is discounted. Specify 1 to indicate true and 0 to indicate false(Int).
let params = [ AnalyticsParameterPriceIsDiscounted : 1, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterPriceIsDiscounted=@"price_is_discounted"The ID of a product (String).
let params = [ AnalyticsParameterProductID : "PROD_12345", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterProductID=@"product_id"The name of a product (String).
let params = [ AnalyticsParameterProductName : "My Awesome Product", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterProductName=@"product_name"The ID of a product promotion (String).
let params = [ AnalyticsParameterPromotionID : "ABC123", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterPromotionID=@"promotion_id"The name of a product promotion (String).
let params = [ AnalyticsParameterPromotionName : "Summer Sale", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterPromotionName=@"promotion_name"Purchase quantity (Int).
let params = [ AnalyticsParameterQuantity : 1, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterQuantity=@"quantity"Score in game (Int).
let params = [ AnalyticsParameterScore : 4200, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterScore=@"score"Current screen class, such as the class name of the UIViewController, logged with screen_viewevent and added to every event (String).
let params = [ AnalyticsParameterScreenClass : "LoginViewController", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterScreenClass=@"screen_class"Current screen name, such as the name of the UIViewController, logged with screen_view event andadded to every event (String).
let params = [ AnalyticsParameterScreenName : "LoginView", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterScreenName=@"screen_name"The search string/keywords used (String).
let params = [ AnalyticsParameterSearchTerm : "periodic table", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterSearchTerm=@"search_term"Shipping cost associated with a transaction (Double).
let params = [ AnalyticsParameterShipping : 5.99, AnalyticsParameterCurrency : "USD", // e.g. $5.99 USD // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterShipping=@"shipping"The shipping tier (e.g. Ground, Air, Next-day) selected for delivery of the purchased item(String).
let params = [ AnalyticsParameterShippingTier : "Ground", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterShippingTier=@"shipping_tier"The origin of your traffic, such as an Ad network (for example, google) or partner (urbanairship). Identify the advertiser, site, publication, etc. that is sending traffic to yourproperty. Highly recommended (String).
let params = [ AnalyticsParameterSource : "InMobi", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterSource=@"source"Source Platform (String). Used to identify the platform responsible for directing traffic to agiven Analytics property (e.g., a buying platform where budgets, targeting criteria, etc. areset, a platform for managing organic traffic data, etc.).
let params = [ AnalyticsParameterSourcePlatform : "sa360", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterSourcePlatform=@"source_platform"The departure date, check-in date or rental start date for the item. This should be inYYYY-MM-DD format (String).
let params = [ AnalyticsParameterStartDate : "2015-09-14", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterStartDate=@"start_date"Indicates if the purchase is a subscription. Specify 1 to indicate true and 0 to indicate false(Int).
let params = [ AnalyticsParameterSubscription : 1, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterSubscription=@"subscription"The result of an operation. Specify 1 to indicate success and 0 to indicate failure (Int).
let params = [ AnalyticsParameterSuccess : 1, // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterSuccess=@"success"Tax cost associated with a transaction (Double).
let params = [ AnalyticsParameterTax : 2.43, AnalyticsParameterCurrency : "USD", // e.g. $2.43 USD // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterTax=@"tax"If you’re manually tagging keyword campaigns, you should use utm_term to specify the keyword(String).
let params = [ AnalyticsParameterTerm : "game", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterTerm=@"term"The unique identifier of a transaction (String).
let params = [ AnalyticsParameterTransactionID : "T12345", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterTransactionID=@"transaction_id"Travel class (String).
let params = [ AnalyticsParameterTravelClass : "business", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterTravelClass=@"travel_class"A context-specific numeric value which is accumulated automatically for each event type. This isa general purpose parameter that is useful for accumulating a key metric that pertains to anevent. Examples include revenue, distance, time and points. Value should be specified as Int orDouble.Notes: Values for pre-defined currency-related events (such as
AnalyticsEventAddToCart)should be supplied using Double and must be accompanied by aAnalyticsParameterCurrencyparameter. The valid range of accumulated values is[-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting thecorrespondingAnalyticsParameterCurrencyparameter, or supplying an invalidcurrency code for conversion events will cause thatconversion to be omitted from reporting.let params = [ AnalyticsParameterValue : 3.99, AnalyticsParameterCurrency : "USD", // e.g. $3.99 USD // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterValue=@"value"Name of virtual currency type (String).
let params = [ AnalyticsParameterVirtualCurrencyName : "virtual_currency_name", // ... ]
Declaration
Objective-C
staticNSString*constkFIRParameterVirtualCurrencyName=@"virtual_currency_name"Indicates whether events logged by Google Analytics can be used to personalize ads for the user.Set to “YES” to enable, or “NO” to disable. Default is enabled. See thedocumentation formore details and information about related settings.
Analytics.setUserProperty("NO", forName: AnalyticsUserPropertyAllowAdPersonalizationSignals)Declaration
Objective-C
staticNSString*constkFIRUserPropertyAllowAdPersonalizationSignals=@"allow_personalized_ads"The method used to sign in. For example, “google”, “facebook” or “twitter”.
Declaration
Objective-C
staticNSString*constkFIRUserPropertySignUpMethod=@"sign_up_method"
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-28 UTC.