GithubHelp home page GithubHelp logo

Comments (4)

bartschelfhout avatar bartschelfhout commented on July 29, 2024 1

Hi @alexhansonsmith I did actually.
Just to give some context fist:
Our own anonymous identifier is being created by a piece of javascript that is loaded from the head of our website, hence the identifier is available in way before the entirety of the page loads.

What we discovered is that the consent manager does a series of lookups before generating a new identifier, to find if there was a previously generated one.
It looks at the local storage for a variable called ajs_anonymous_id.

So the solution was simple. In the piece of javascript that is loaded from the header section of our page, we write our own anonymous identifier to localStorage with that name.
localStorage && localStorage.setItem('ajs_anonymous_id', our_anonymous_identifier);

This would always get picked up by the consent manager.
Hope that helps!

from consent-manager.

alexhansonsmith avatar alexhansonsmith commented on July 29, 2024

Hi @bartschelfhout - did you get anywhere with this? Without being able to control the identifier our MTU usage has spiked considerably

from consent-manager.

alexhansonsmith avatar alexhansonsmith commented on July 29, 2024

Hey @bartschelfhout - this is really helpful. Thanks for such a comprehensive response!

from consent-manager.

felipe-najson-ntf avatar felipe-najson-ntf commented on July 29, 2024

@alexhansonsmith @bartschelfhout Hi everyone, it seems that you already managed to fix the problem.
I join what @bartschelfhout says. The easiest way to override the anonymus ID is to overwrite it in the snippet as suggested in the segment documentation.
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/identity/#override-the-anonymous-id-from-the-segment-snippet

You can find other ways to override the anonymous ID here
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/identity/#override-the-anonymous-id-from-the-segment-snippet

On the other hand I will be adding a section to the documentation so that future users know how to do it.

Thanks for your contribution!

from consent-manager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.