Hi guys, We would like to know why sometimes we ha...
# support
b
Hi guys, We would like to know why sometimes we have version number of the app in our custom events as “default” events and sometimes not. The version number of the app in RudderStack is being mapped automatically or being taken automatically? We do have this issue in RudderStack SDK iOS when sending custom events to Google Analytics
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Pietro, so you are saying when events are sent from your iOS app to Google analytics as custom events, some events have the iOS app version as a default parameter while other events do not? Can you share some sample events where you are seeing this? It would be helpful if you can share both the source and destination event. Also do remember to delete any PII before sharing the event. Thanks
p
hi @shy-kite-21035 let me share example (some fields replaced according to security reasons)
this event i got from bigquery and as you can see it has app version
Copy code
[{
  "context_device_type": "ios",
  "context_network_carrier": "unavailable",
  "user_id": "i30T12313123112412347HHKpmL2hk2",
  "context_destination_type": "BQ",
  "context_library_version": "2.4.2",
  "id": "1708037776-026c0d5b-0c55-498c-bd69-5ee0acb1eafa",
  "context_traits_user_id": "i30T12313123112412347HHKpmL2hk2",
  "context_network_cellular": "false",
  "context_app_build": "49",
  "context_source_id": "2ZUaXO11lM2eDUi7WBHV61hwC85",
  "context_network_bluetooth": "false",
  "context_ip": "1.2.3.4",
  "context_destination_id": "2cOH3k1cXWesTpuD84K4y7Zfos3",
  "event_text": "registration_start",
  "channel": "mobile",
  "event": "registration_start",
  "context_screen_height": "896",
  "timestamp": "2024-02-15 22:56:17.179000 UTC",
  "anonymous_id": "b7a98df0-4b57-4bf7-b2ce-c2cd1189bc04",
  "context_library_name": "rudder-ios-library",
  "context_app_namespace": "com.app.app",
  "context_device_manufacturer": "Apple",
  "context_network_wifi": "true",
  "context_device_id": "B7A98DF0-4B57-4BF7-B2CE-C2CD1189BC04",
  "context_device_name": "iPhone",
  "context_os_name": "iOS",
  "context_source_type": "iOS",
  "received_at": "2024-02-15 22:56:24.560000 UTC",
  "context_app_version": "3.1.0",
  "context_app_name": "app",
  "loaded_at": "2024-02-16 00:21:26.601927 UTC",
  "context_device_model": "iPhone11,8",
  "uuid_ts": "2024-02-16 00:21:26.000000 UTC",
  "context_locale": "ru-RU",
  "context_timezone": "Europe/Moscow",
  "context_external_id": "[{\"id\":\"3326D35179FD415BA79158BD43B26D42\",\"type\":\"ga4AppInstanceId\"}]",
  "context_screen_density": "2",
  "context_screen_width": "414",
  "context_traits_anonymous_id": "b7a98df0-4b57-4bf7-b2ce-c2cd1189bc04",
  "context_os_version": "16.2",
  "sent_at": "2024-02-15 22:56:23.851000 UTC",
  "context_request_ip": "1.2.3.4",
  "original_timestamp": "2024-02-15 22:56:16.470000 UTC",
  "context_traits_ghost": null,
  "context_device_advertising_id": null,
  "context_traits_gender": null,
  "context_traits_age": null,
  "context_traits_is_new_home": null,
  "context_device_ad_tracking_enabled": null,
  "context_user_agent": null,
  "context_traits_username": null,
  "context_traits_num_of_photos": null,
  "context_traits_id": null,
  "context_traits_gems": null,
  "context_traits_birthday": null,
  "context_traits_noti_enabled": null,
  "context_traits_gender_pref": null,
  "context_device_token": null,
  "context_traits_count_watched_ads": null,
  "context_traits_avg_amount_purch_usd": null,
  "context_traits_count_purchases": null,
  "context_traits_total_amount_purch_gems": null,
  "context_traits_first_amount_purch_gems": null,
  "context_traits_avg_amount_purch_gems": null,
  "context_traits_first_amount_purch_usd": null,
  "context_traits_total_amount_purch_usd": null,
  "context_traits_total_watch_ads": null,
  "context_traits_total_purchases": null
}]
and the same event but in google analytics (i also got it from bigquery) here we don't have app version
Copy code
[{
  "event_date": "20240215",
  "event_timestamp": "1708042061246508",
  "event_name": "registration_start",
  "event_params": [{
    "key": "engagement_time_msec",
    "value": {
      "string_value": null,
      "int_value": "1",
      "float_value": null,
      "double_value": null
    }
  }],
  "event_previous_timestamp": null,
  "event_value_in_usd": null,
  "event_bundle_sequence_id": "-2007863252",
  "event_server_timestamp_offset": null,
  "user_pseudo_id": "3326D35179FD415BA79158BD43B26D42",
  "privacy_info": {
    "analytics_storage": null,
    "ads_storage": null,
    "uses_transient_token": "No"
  },
  "user_properties": [{
    "key": "user_id",
    "value": {
      "string_value": "i30T12313123112412347HHKpmL2hk2",
      "int_value": null,
      "float_value": null,
      "double_value": null,
      "set_timestamp_micros": "4284246508"
    }
  }, {
    "key": "anonymousId",
    "value": {
      "string_value": "b7a98df0-4b57-4bf7-b2ce-c2cd1189bc04",
      "int_value": null,
      "float_value": null,
      "double_value": null,
      "set_timestamp_micros": "1708042061246508"
    }
  }, {
    "key": "userId",
    "value": {
      "string_value": "i30T12313123112412347HHKpmL2hk2",
      "int_value": null,
      "float_value": null,
      "double_value": null,
      "set_timestamp_micros": "1708042061246509"
    }
  }],
  "user_first_touch_timestamp": "1708037773667000",
  "user_ltv": null,
  "device": {
    "category": "mobile",
    "mobile_brand_name": null,
    "mobile_model_name": null,
    "mobile_marketing_name": null,
    "mobile_os_hardware_model": null,
    "operating_system": "iOS",
    "operating_system_version": "iOS",
    "vendor_id": "B7A98DF0-4B57-4BF7-B2CE-C2CD1189BC04",
    "advertising_id": null,
    "language": null,
    "is_limited_ad_tracking": "No",
    "time_zone_offset_seconds": null,
    "browser": null,
    "browser_version": null,
    "web_info": null
  },
  "geo": {
    "city": "Fake",
    "country": "Fake",
    "continent": "Fake",
    "region": "Fake",
    "sub_continent": "Fake",
    "metro": null
  },
  "app_info": {
    "id": "com.app.app",
    "version": null,
    "install_store": null,
    "firebase_app_id": "1:123123123:ios:123123123",
    "install_source": null
  },
  "traffic_source": null,
  "stream_id": "1370322168",
  "platform": "IOS",
  "event_dimensions": null,
  "ecommerce": null,
  "items": [],
  "collected_traffic_source": null,
  "is_active_user": null,
  "user_id": "i30T12313123112412347HHKpmL2hk2",
  "session_number": null,
  "session_id": null,
  "product_id": null,
  "gem_count": null,
  "avg_amount_purch_gems": null,
  "is_noti_enabled": null,
  "is_new_home": null,
  "first_amount_purch_gems": null,
  "count_watched_ads": null,
  "total_amount_purch_gems": null,
  "age_category": null,
  "count_purchases": null,
  "first_amount_purch_usd": null,
  "total_amount_purch_usd": null,
  "photo_count": null,
  "gender_preference": null,
  "is_ghost": null,
  "avg_amount_purch_usd": null,
  "snap_account": null,
  "is_google_linked": null,
  "is_tiktok_login": null,
  "is_linked": null,
  "is_apple_linked": null,
  "is_email_linked": null,
  "date": "2024-02-16",
  "timestamp": "2024-02-16 00:07:41.246508 UTC"
}]
why is it possible?
we use rudderstack open source and as i see we have the same issue with android as well
@shy-kite-21035 could you please take a look?
m
Yes looking into this
So the first event is sent directly to Bigquery, while the second is sent to GA4 and you are using the Google Analytics Bigquery integration to fetch the event? Is that correct? Can you provide the workspaceId?
p
sure, it's
2ZP5xDRTUfjBWyBrCkDrTpdqLpi
we have these flows 1. app -> rudderstack -> ga4 -> bigquery 2. app -> rudderstack -> bigquery (1) flow is our default flow (2) flow i created because i wanted to verify where is the problem
s
Oh ok
p
do you know possible issue? it's very critical to fix events in google analytics, because i see the problem in google analytics ui as well - i see many events without app version
s
Hi Sergey, you are using GA4 in cloud mode and those events are sent via the measurement protocol and it does not support sending these parameters. The measurement protocol is primarily for backend (server) events. I am not sure how you are even seeing the version number for a few events. You can do the following • Using the cloud mode write a user transformation to move the app properties either to the context traits or to the event properties. (preferably the context traits). I can help out with this transformation
p
but i have for some events
s
That is what has me stumped
Can you share the out-going event from the destination live events tab?
p
i don't see app version there
s
That is the event that is actually sent to the destination.
p
this is strange ok, if i enable device mode, is it possible to receive events on the rudder server to save them into separate destination?
s
So the device mode events are sent directly from the client. But in the case of GA4 we do not support the device mode destination for mobile.
p
so, what can we do?
s
The best option would be to send it in the context traits.
Let me also discuss this once with the team.
p
thanks
m
Let me know if you need help with the User transformation in the meantime.
👍 1
p
yes, please help
hello @shy-kite-21035 do you have any details from internal team?
m
Hi yes the team confirmed what I mentioned, that Measurement Protocol does not support sending these properties. Moreover, the mentioned that currently we only support sending these properties in the event properties.
Do you need to send the app_version only for track events or for page events as well?
p
all
m
Copy code
export function transformEvent(event, metadata) {
  const context = {event};
  let app_version;
  if (context && context.app && context.app.version) {
      app_version = context.app.version;
      if (event.properties) {
          event.properties.app_version = app_version;
      }
  }
  return event;
}
You can use this user transformation to add the app_version key to your properties object in GA4. Note:- Kindly test out this user transformation before using it in production.
🙌 1
p
but what about geo? some events don't have geo
i can confirm that we have
app_info.version
field filled correctly for many events, but you said that it isn't possible how does it work?
5% of events without app_info.version in ga4, but other events have this field
m
but what about geo? some events don’t have geo
You mean like geolocation?
So the app_info.version is correctly populating your app version for about 95% of the events?
p
yes, correct
m
i can confirm that we have`app_info.version`⁣field filled correctly for many events, but you said that it isn't possible
I am not sure how to debug this. Lets see if we can work these 2 issues out in a call? You can create one here