Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun trackContactSeller(
- listing: ListingResponse,
- contact_method: String,
- contact_trigger: String,
- contact_screen: String?,
- latitude: Double?,
- longitude: Double?
- ) {
- mpProperties.put("contact_method", contact_method)
- mpProperties.put("car_id", listing.id)
- mpProperties.put("mileage", listing.mileage)
- mpProperties.put("asking_price", listing.price)
- mpProperties.put("negotiated_price", listing.negotiated_price?.toInt())
- mpProperties.put("country_code", listing.country_code)
- mpProperties.put("currency_code", listing.currency)
- mpProperties.put("is_featured", listing.is_featured)
- mpProperties.put("is_certified", listing.is_certified)
- mpProperties.put("body_type_name", bodyTypes[listing.body_type_id?.toInt()])
- mpProperties.put("make_name", listing.make_name)
- mpProperties.put("model_name", listing.model_name)
- mpProperties.put("submodel_name", listing.submodel_name)
- mpProperties.put("trim_name", listing.trim_name)
- mpProperties.put("phone_number", listing.phone_number)
- mpProperties.put("is_new", listing.is_new)
- mpProperties.put("year", listing.year)
- mpProperties.put(
- "car_type",
- if (listing.is_new) "is_new" else if (!listing.is_new) "used" else "lease"
- )
- mpProperties.put("longitude", longitude)
- mpProperties.put("latitude", latitude)
- mpProperties.put("contact_screen", contact_screen)
- mpProperties.put("contact_trigger", contact_trigger)
- mixPanelAPI.track(EVENTS_TRACKING_CONTACT_SELLER_MIXPANEL, mpProperties)
- fbProperties.putString("contact_method", contact_method)
- fbProperties.putString("car_id", listing.id)
- fbProperties.putInt("mileage", listing.mileage)
- fbProperties.putInt("asking_price", listing.price)
- val negotiatedPrice = listing.negotiated_price
- if (negotiatedPrice != null)
- fbProperties.putInt("negotiated_price", negotiatedPrice.toInt())
- fbProperties.putString("country_code", listing.country_code)
- fbProperties.putString("currency_code", listing.currency)
- fbProperties.putBoolean("is_featured", listing.is_featured)
- fbProperties.putBoolean("is_certified", listing.is_certified)
- fbProperties.putString("body_type_name", bodyTypes[listing.body_type_id?.toInt()])
- fbProperties.putString("make_name", listing.make_name)
- fbProperties.putString("model_name", listing.model_name)
- fbProperties.putString("submodel_name", listing.submodel_name)
- fbProperties.putString("trim_name", listing.trim_name)
- fbProperties.putString("phone_number", listing.phone_number)
- fbProperties.putBoolean("is_new", listing.is_new)
- fbProperties.putInt("year", listing.year)
- fbProperties.putString(
- "car_type",
- if (listing.is_new) "is_new" else if (!listing.is_new) "used" else "lease"
- )
- if (longitude != null) {
- fbProperties.putDouble("longitude", longitude)
- }
- if (latitude != null) {
- fbProperties.putDouble("latitude", latitude)
- }
- fbProperties.putString("contact_screen", contact_screen)
- fbProperties.putString("contact_trigger", contact_trigger)
- facebookLogger.logEvent(EVENTS_TRACKING_CONTACT_SELLER_FACEBOOK, fbProperties)
- clearPropertiesObjects()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement