Skip to main content
Version: 1.3.0

Login With User Properties

A login event example with Firebase user_properties for Android and iOS.

DataLayer Example

firebaseAnalytics.setUserProperty(FirebaseAnalytics.UserProperty.SIGN_UP_METHOD, "email")
firebaseAnalytics.setUserProperty(FirebaseAnalytics.UserProperty.ALLOW_AD_PERSONALIZATION_SIGNALS, "false")

firebaseAnalytics.logEvent(FirebaseAnalytics.Event.LOGIN) {
param(FirebaseAnalytics.Param.METHOD, "email")
}

Event Properties

PropertyTypeConstraintsExamplesDescription
$schemastringrequired
"https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/login-with-user-properties-event.json"
Defines the structure of the event.
const: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/login-with-user-properties-event.json"
eventstringrequired
"login"
The event name for user login.
const: "login"
methodstringrequired
"email"
Login method.
{}user_propertiesobjectrequiredFirebase user properties to set before logging the event.
sign_up_methodstringrequired
"email"
The sign up method user property.
allow_ad_personalization_signalsstring, null
"false"
Whether ad personalization signals are allowed.
additionalPropertiesSchema constraintControls properties not listed in properties and not matched by patternProperties.string, null
"beta_tester"
Additional Firebase user property values keyed by property name.
patternProperties/^custom_/Schema constraintApplies the subschema to property names that match the given regular expression.string, null
"vip_member"
Custom Firebase user properties for keys prefixed with custom_.
View Raw JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/login-with-user-properties-event.json",
  "title": "Login With User Properties",
  "description": "A login event example with Firebase user_properties for Android and iOS.",
  "x-tracking-targets": [
    "android-firebase-kotlin-sdk",
    "android-firebase-java-sdk",
    "ios-firebase-swift-sdk",
    "ios-firebase-objc-sdk"
  ],
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "description": "Defines the structure of the event.",
      "const": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/mobile/login-with-user-properties-event.json"
    },
    "event": {
      "type": "string",
      "const": "login",
      "description": "The event name for user login."
    },
    "method": {
      "type": "string",
      "description": "Login method.",
      "examples": [
        "email"
      ]
    },
    "user_properties": {
      "type": "object",
      "description": "Firebase user properties to set before logging the event.",
      "properties": {
        "sign_up_method": {
          "type": "string",
          "description": "The sign up method user property.",
          "examples": [
            "email"
          ]
        },
        "allow_ad_personalization_signals": {
          "type": [
            "string",
            "null"
          ],
          "description": "Whether ad personalization signals are allowed.",
          "examples": [
            "false",
            null
          ]
        }
      },
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ],
        "description": "Additional Firebase user property values keyed by property name.",
        "examples": [
          "beta_tester",
          null
        ]
      },
      "patternProperties": {
        "^custom_": {
          "type": [
            "string",
            "null"
          ],
          "description": "Custom Firebase user properties for keys prefixed with custom_.",
          "examples": [
            "vip_member",
            null
          ]
        }
      },
      "required": [
        "sign_up_method"
      ]
    }
  },
  "required": [
    "$schema",
    "event",
    "method",
    "user_properties"
  ]
}