segmentio / analytics-node

The hassle-free way to integrate analytics into any node application.

Home Page:https://segment.com/libraries/node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing referrer and initial_referrer to Amplitude

dko-slapdash opened this issue · comments

Is it possible to tell Amplitude to set initial_referrer (i.e. a referrer value which sets only once with $setOnce) via analytics-node API? I tried different variants (including the documented one - via context.page.referrer), and none works.

I see that analytics-js sets initial_referrer using $setOnce, but since the server side counter-part of analytics-node (located on segment servers) is not open-source, I can't infer this information from the source.

Where do you see "analytics-js sets initial_referrer using $setOnce"?

Here: https://github.com/segmentio/analytics.js-integrations/blob/2d5c637c022d2661c23449aed237d0d546bf062d/integrations/amplitude/lib/index.js#L450

It does it for initial_referrer. I.e. initial_referrer is not something which Segment servers control, it's a purely client-side feature of analytics.js (although it's not clear from the docs). The same applies to initial_referring_domain

I don't think this issue is related to analytics-node. This is probably related to how the Amplitude destination works in the cloud mode which is out of scope of this library.