-
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_id
orclient_id
from 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/installations
with this bit of code:`
const installationId = await installations.getId(
installations.getInstallations()
);
`
But when I tried to validate a request with the given
installationId
through 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.