Hi all :wave: I'm new to Rudderstack and I've set...
# support
a
Hi all πŸ‘‹ I'm new to Rudderstack and I've setup a new integration from my React front-end app to Google Analytics using the Javascript SDK. Currently, Rudderstack sends the anonymousID to GA as the clientID (which I understand is the default behaviour). However, this causes an issue when we track GA sessions across a different subdomain that shares cookies but doesn't use Rudderstack. Here GA tracks the clientID from its own cookie and the sessions cannot be linked in GA. I see a potential solution to this is for us to send the GA clientID from the cookie in every Rudderstack payload as per these docs: https://www.rudderstack.com/docs/destinations/streaming-destinations/google-analytics-ga/#how-rudderstack-takes-the-clientid Should the values "clientId" and "gaExternalId" be replaced with the GA clientID (usually of the form "1183997174.1673932710")? Is it best practice to send this on both initialisation and with every event? Lastly, is it our responsibility to write code to read the GA clientID from the cookie and include it in the Payload, or does Rudderstack do this behind the scenes? I'm also a bit unclear about what "Disable Md5 encryption from Client ID" setting does and again, what's best practice and if it's related to my issue above. Thanks in advance!
s
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.
q
Hi @alert-vegetable-59655 Let me check this and get back to you
πŸ™ 1
g
@alert-vegetable-59655 1. Yes, You can send this with every event. 2. You need to send the clientId in the payload. 3.
Disable Md5 encryption from Client ID
: this setting is used to send the
userId
from payload to
clientId
, when
integrations
object,
externalId
,
traits.cid
, and
anonymousId
all are absent. The userId is passed in md5 hashed format.
a
OK thanks @gentle-church-13189. So for (2), is it correct that "gaExternalID" should be replaced with the client_id in that code snippet? So for example:
Copy code
"externalID": [{
  "id": "externalClientId",
   "type": "1183997174.1673932710"
}]
And I would retrieve the client_id from the GA cookie myself?
g
Yes and enable the
Disable Md5 encryption from Client ID
toggle. and you can retrieve the client_id from the GA cookie, then utilise it perhaps
a
Perfect, thank you! And lastly, is it best practice to do it this way, or is it more common to use the Rudderstack default behaviour (anonymousID as client_id_ for GA) and make sure that is passed into any iFrames or other places where tracking is needed?
g
That depends on your exact use case πŸ™‚ If the default behavior of sdk suffices for you, and you don’t see any incorrect trackings, it should be utilised. Else above customisations are present so as to fit your usecase
πŸ™ 1
a
OK thanks for your help πŸ™‚
gratitude thank you 1
g
Do let us know with any other issues or questions!
q
Thank you @gentle-church-13189
πŸ™Œ 1
a
I added this to the SDK initialize as a test but it doesn't change the integrations property on my tacking events (in the browser nor in live events)
also the cid is still using the Rudderstack annonymous id, not the "clientId" string (I know this should be from the cookie but just wanted to see if it worked). I have Disable md5 set to true
h
@alert-vegetable-59655, You need to replace the
"clientId"
with the actual
clientId
.