boundless-notebook-34527
02/10/2023, 8:25 AM"error": "ga4AppInstanceId must be provided under externalId"
I checked into documentation https://www.rudderstack.com/docs/destinations/streaming-destinations/google-analytics-4/setting-up-google-analytics-4-in-rudderstack/ and found Enter the identifier which RudderStack should look for in the payload and map to the GA4
Does this mean we can map a unique id from rudderstack payload to be client id for GA4? What would be the best way to set this? what we want to do is send data from each app platform to it's own GA4 destination based on different env like dev, uat, prod.bulky-breakfast-19942
02/10/2023, 11:57 AMga4AppInstanceId
inside externalId
of our rudderstack payload because rudderstack maps ga4AppInstanceId
to app_instance_id
which is required to make a call to ga4
while the doc you are referring to is ga4 client_Id. where you can specify from which place in your payload you want to send ga4 client_id and rudderstack will take from there and sent it to ga4.boundless-notebook-34527
02/13/2023, 3:52 AMGA4 client_id Field Identifier
in destination config, I am assuming this is keyName and not value right? Then I need to send the ga4AppInstanceId
which is probably GOOGLE_APP_ID
that we get from GA4 dashboard right? So, for the code below
let option = RSOption()
option.putExternalId("ga4AppInstanceId", withId: "GOOGLE_APP_ID")
RSClient.sharedInstance().track(event.description, properties: eventProperties, option: option)
GA4 client_id Field Identifier
should be set to ga4AppInstanceId
and not GOOGLE_APP_ID
right?
I tried this but I did not see externalId
or ga4AppInstanceId
when testing on live events on source and I am still getting same error as before in destination live events
https://www.rudderstack.com/docs/destinations/streaming-destinations/google-analytics-4/google-analytics-4-cloud-mode/#mapping-client_id This documentation states that even if we do not set GA4 client_id Field Identifier
it will map anonymousId
to client_id
our payload has anonymousId
but still we are getting errorbulky-breakfast-19942
02/13/2023, 4:31 AMga4AppInstanceId
and client_id
. you can reference thatbulky-breakfast-19942
02/13/2023, 4:33 AM{
"channel": "web",
"messageId": "ec5481b6-a926-4d2e-b293-0b3a77c4d3be",
"anonymousId": "ea5cfab2-3961-4d8a-8187-3d1858c99090",
"context": {
"app": {
"build": "1.0.0",
"name": "RudderLabs JavaScript SDK",
"namespace": "com.rudderlabs.javascript",
"version": "1.0.0"
},
"device": {
"adTrackingEnabled": "false",
"advertisingId": "T0T0T072-5e28-45a1-9eda-ce22a3e36d1a",
"id": "3f034872-5e28-45a1-9eda-ce22a3e36d1a",
"manufacturer": "Google",
"model": "AOSP on IA Emulator",
"name": "generic_x86_arm",
"type": "ios",
"attTrackingStatus": 3
},
"ip": "0.0.0.0",
"library": {
"name": "RudderLabs JavaScript SDK",
"version": "1.0.0"
},
"locale": "en-US",
"os": {
"name": "iOS",
"version": "14.4.1"
},
"screen": {
"density": 2
},
"externalId": [
{
"type": "ga4AppInstanceId",
"id": "************"
}
],
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
},
"type": "track",
"event": "product added",
"properties": {
"currency": "USD",
"price": 2.4,
"quantity": 2,
"client_id": "<tel:123456.7654321|123456.7654321>",
"products": [
{
"product_id": "507f1f77bcf86cd799439011",
"name": "Monopoly: 3rd Edition",
"coupon": "SUMMER_FUN",
"category": "Apparel",
"brand": "Google",
"variant": "green",
"price": "19",
"quantity": "2",
"position": "1",
"affiliation": "Google Merchandise Store",
"currency": "USD",
"discount": 2.22,
"item_category2": "Adult",
"item_category3": "Shirts",
"item_category4": "Crew",
"item_category5": "Short sleeve",
"item_list_id": "related_products",
"item_list_name": "Related Products",
"location_id": "L_12345"
}
]
},
"integrations": {
"All": true
}
}
bulky-breakfast-19942
02/13/2023, 4:34 AMga4AppInstanceId
from externalId
and client_id
is coming from properties which i configured on dashboard.
GA4 client_id Field Identifier
= properties.client_id
boundless-notebook-34527
02/13/2023, 5:33 AMga4AppInstanceId
from externalId
is mapped onto app_instance_id
of GA4 payload and GA4 client_id Field Identifier
is a different field definition for sending out client_id
to GA4 event param field client_id
boundless-notebook-34527
02/20/2023, 8:08 AMboundless-notebook-34527
02/20/2023, 8:11 AMga4AppInstanceId
by fetching it using Firebase/Analytics framework for getting appInstanceId and we do not send client_id
at the moment.bulky-breakfast-19942
02/20/2023, 8:18 AMEnable debug mode
option is enabled or not?boundless-notebook-34527
02/20/2023, 8:22 AMbulky-breakfast-19942
02/20/2023, 1:48 PMboundless-notebook-34527
02/21/2023, 9:20 AMbulky-breakfast-19942
02/21/2023, 10:15 AMboundless-notebook-34527
02/21/2023, 10:47 AMbulky-breakfast-19942
02/21/2023, 11:59 AMrudderanalytics.track()
eventsboundless-notebook-34527
02/22/2023, 6:48 AMbulky-breakfast-19942
02/22/2023, 6:51 AMboundless-notebook-34527
02/22/2023, 7:04 AMbulky-breakfast-19942
02/22/2023, 7:06 AMboundless-notebook-34527
02/22/2023, 7:33 AMboundless-notebook-34527
02/22/2023, 7:38 AMbulky-breakfast-19942
02/22/2023, 7:46 AMboundless-notebook-34527
02/22/2023, 8:22 AMboundless-notebook-34527
02/23/2023, 7:36 AMexport function transformEvent(event, metadata) {
if(event["type"] == "screen") {
let screen_name = event.event;
event.properties = {
"screen_name": event["event"]
}
event["event"] = "screen_view";
event["type"] = "track";
}
return event;
}
to convert the screen event to track event for GA4 but I still do not see any info on destinationboundless-notebook-34527
02/23/2023, 7:36 AMbulky-breakfast-19942
02/23/2023, 7:59 AMboundless-notebook-34527
02/23/2023, 8:29 AMboundless-notebook-34527
02/23/2023, 8:35 AMtype
from "screen" to "track", event
from "screen_name" to "screen_view" (custom type) and push event name inside property of track, on the diff it looks same as a new track event but hard to say if this is sufficientbulky-breakfast-19942
02/23/2023, 8:38 AMboundless-notebook-34527
02/23/2023, 8:46 AMbulky-breakfast-19942
02/23/2023, 8:51 AMboundless-notebook-34527
02/23/2023, 8:55 AMbulky-breakfast-19942
02/23/2023, 9:02 AMboundless-notebook-34527
03/03/2023, 3:49 AMbulky-breakfast-19942
03/03/2023, 5:27 AMboundless-notebook-34527
03/03/2023, 6:00 AM{
"type": "track",
"event": "button_tap",
"sentAt": "2566-03-03T04:59:44.467Z",
"channel": "mobile",
"context": {
"os": {
"name": "iOS",
"version": "16.3.1"
},
"app": {
"name": "Pi Financial",
"build": "548",
"version": "1.2.3",
"namespace": "th.co.cgsec.pi-financial"
},
"device": {
"id": "473477E0-AFE9-4598-810A-3D562B134A34",
"name": "iPhone",
"type": "ios",
"model": "iPhone11,2",
"manufacturer": "Apple"
},
"locale": "en-TH",
"screen": {
"width": 375,
"height": 812,
"density": 3
},
"traits": {
"anonymousId": "e0f6dd0a-f37c-4a14-97c3-62cb7ad3fada"
},
"library": {
"name": "rudder-ios-library",
"version": "2.0.1"
},
"network": {
"wifi": false,
"carrier": "unavailable",
"cellular": true,
"bluetooth": false
},
"timezone": "Asia/Bangkok",
"externalId": [
{
"id": "D447F9CF5F8D47C785CC63C3A7",
"type": "ga4AppInstanceId"
}
]
},
"rudderId": "f7467c63-eff6-41b0-8592-17e7944e4642",
"messageId": "1677819577-51fb39a7-f546-41dc-895a-c15adbd3e855",
"timestamp": "2023-03-03T04:59:38.974Z",
"properties": {
"button_name": "resend_otp",
"screen_name": "2fa_mobile"
},
"receivedAt": "2023-03-03T04:59:45.761Z",
"request_ip": "49.237.19.91",
"anonymousId": "e0f6dd0a-f37c-4a14-97c3-62cb7ad3fada",
"integrations": {
"All": true
},
"originalTimestamp": "2566-03-03T04:59:37.680Z"
}
boundless-notebook-34527
03/03/2023, 6:02 AMbulky-breakfast-19942
03/03/2023, 6:14 AMoriginalTimestamp, sentAt, timestamp
bulky-breakfast-19942
03/03/2023, 6:15 AMbulky-breakfast-19942
03/03/2023, 6:15 AMboundless-notebook-34527
03/03/2023, 6:24 AM