Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytics shows server location traffic instead of customer location #80

Open
michaelhidalgo opened this issue Jun 24, 2017 · 8 comments

Comments

@michaelhidalgo
Copy link

michaelhidalgo commented Jun 24, 2017

Hi folks, this is just a question.

I deployed an application with universal-analytics and the application was deployed into a cloud server, however when accessing the site from Costa Rica, I can see in Google Analytics that the location of the traffic is the on from server, not my remote location.

I used the same samples from this repository and I was wondering if i need to pass somehow the remote ip so it can use my location instead of the server's one.

Thanks.

@sfratini
Copy link

I am having the same issue however I understand this is the "expected" behavior since the requests are coming from the server and not the client (I use this in a chatbot where everything runs on the server).

It would be nice to be able to override this somehow.

@jtillmann
Copy link
Member

You can, the Measurement Protocol parameter uip is meant for IP override: https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uip

@abskmj
Copy link

abskmj commented Jun 18, 2018

Hi @jtillmann, does this module support passing these values to override IP and User Agent? If not, I can work of it and send you a pull request.

I'm think, these override parameters can be sent as part of visitor options. Something like this:

var visitor = ua('UA-XXXX-XX', 'CUSTOM_CLIENTID_1', {uip: "", ua: "" });

@jtillmann
Copy link
Member

They can not be provided to the visitor options, they need to be provided as parameters to track calls or as persistent parameters.

@abskmj
Copy link

abskmj commented Jun 18, 2018

Great! I didn't see that part of the documentation. This module already supports passing override parameters.

@j-mendez
Copy link

Currently experiencing this issue on my fargate instance on AWS. I am setting the vistor using visitor.set("uip", ip) with the proper ip and its using my servers IP instead. I think the request headers is being declared as source of truth instead of the visitor uip.

@j-mendez
Copy link

j-mendez commented Dec 11, 2021

@michaelhidalgo using version 0.4.23 seems not have the issue. In my case I needed to downgrade the package.

@jtillmann
Copy link
Member

Could you check the debug output? There should be no difference between .4 and .5 in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants