open-contracting / data-registry

BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

User tracking #6

Closed jakubkrafka closed 3 years ago

jakubkrafka commented 3 years ago

I guess that user tracking (i.e. Google Analytics, Google Tag Manager) will be part of the application. Please could you provide more specific details to integrate those? Thanks!

jpmckinney commented 3 years ago

As mentioned in #7, it'll be Fathom. You can put this in the head:

<script src="https://kite.open-contracting.org/script.js" data-site="HTTGFPYH" defer></script>

To ignore requests from development, I usually change it to:

<script src="https://kite.open-contracting.org/script.js" data-site="HTTGFPYH" defer data-excluded-domains="localhost,127.0.0.1,0.0.0.0"></script>
jakubkrafka commented 3 years ago

Thanks! I like it configurable. There is variable FATHOM_KEY in settings, when set, the analytics will start to work.

jpmckinney commented 3 years ago

Note: In Toucan (a Django project) we also have a setting for the custom domain. https://github.com/open-contracting/toucan/blob/main/ocdstoucan/settings.py#L165-L166

Many paranoid browser extensions like uBlock Origin block Fathom, even though it doesn't track users, serve ads, etc. To get around blockers, we use a custom domain.

jpmckinney commented 3 years ago

I've updated the code snippet to use our custom domain, and to add another excluded domain.

jakubkrafka commented 3 years ago

Good tip, thanks! Integrated as well.