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

Adding exception for staff user for analytics #5

Merged

Conversation

webbyfox
Copy link
Contributor

To do (delete all that do not apply):

  • Changelog entry added.

…henticated_staff_user' into GP2-3054_GA360_exception_for_authenticated_staff_user

# Conflicts:
#	tests/test_mixins.py
@@ -75,6 +75,6 @@ def get_context_data(self, *args, **kwargs):
user = helpers.get_user(self.request)
is_logged_in = helpers.get_is_authenticated(self.request)
self.ga360_payload['login_status'] = is_logged_in
self.ga360_payload['user_id'] = user.hashed_uuid if is_logged_in else None
self.ga360_payload['user_id'] = user.hashed_uuid if (is_logged_in and not user.is_staff) else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean I can't be a staff user and a business user ?

Copy link
Contributor Author

@webbyfox webbyfox Jun 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can but for staff users, we are just adding user_id to None for google analytics as I dont think we should record staff visit to GA

This will resolve the issue while admin user not have UUID

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok @depsiatwal amended for admin users only

Copy link
Contributor

@depsiatwal depsiatwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@depsiatwal depsiatwal merged commit 51334e1 into master Jun 18, 2021
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

Successfully merging this pull request may close these issues.

2 participants