-
Retrieving App Instance ID and Client ID from Firebase SDK for Web: Sending Google Analytics Events via API
“Hey fellow coders, I’m stuck on something. I’m trying to snag the
app_instance_idorclient_idfrom the Firebase SDK for a web client. Just to clarify, I’m not usinggtag.js. Here’s a link that I’ve been referencing for help: (https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=firebase).I attempted to use
firebase/installationswith this bit of code:`
const installationId = await installations.getId(
installations.getInstallations()
);
`But when I tried to validate a request with the given
installationIdthrough the ga4 API, I got this error message:`
description: “Measurement app_instance_id is expected to be a 32 digit hexadecimal number but was [22] digits.”
fieldPath: “app_instance_id”
validationCode: “VALUE_INVALID”
`How can I fix this?”
Log in to reply.