mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge pull request #583 from makeplane/chore/analytics_payload
chore: analytics payload
This commit is contained in:
commit
2f69761130
@ -86,7 +86,7 @@ class SignInEndpoint(BaseAPIView):
|
|||||||
"user": serialized_user,
|
"user": serialized_user,
|
||||||
}
|
}
|
||||||
|
|
||||||
# Send event to Jitsu for tracking
|
# Send Analytics
|
||||||
if settings.ANALYTICS_BASE_API:
|
if settings.ANALYTICS_BASE_API:
|
||||||
_ = requests.post(
|
_ = requests.post(
|
||||||
settings.ANALYTICS_BASE_API,
|
settings.ANALYTICS_BASE_API,
|
||||||
@ -99,7 +99,7 @@ class SignInEndpoint(BaseAPIView):
|
|||||||
"event_data": {
|
"event_data": {
|
||||||
"medium": "email",
|
"medium": "email",
|
||||||
},
|
},
|
||||||
"user": {"email": email},
|
"user": {"email": email, "id": str(user.id)},
|
||||||
"device_ctx": {
|
"device_ctx": {
|
||||||
"ip": request.META.get("REMOTE_ADDR"),
|
"ip": request.META.get("REMOTE_ADDR"),
|
||||||
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
||||||
@ -137,7 +137,7 @@ class SignInEndpoint(BaseAPIView):
|
|||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
access_token, refresh_token = get_tokens_for_user(user)
|
access_token, refresh_token = get_tokens_for_user(user)
|
||||||
# Send event to Jitsu for tracking
|
# Send Analytics
|
||||||
if settings.ANALYTICS_BASE_API:
|
if settings.ANALYTICS_BASE_API:
|
||||||
_ = requests.post(
|
_ = requests.post(
|
||||||
settings.ANALYTICS_BASE_API,
|
settings.ANALYTICS_BASE_API,
|
||||||
@ -150,7 +150,7 @@ class SignInEndpoint(BaseAPIView):
|
|||||||
"event_data": {
|
"event_data": {
|
||||||
"medium": "email",
|
"medium": "email",
|
||||||
},
|
},
|
||||||
"user": {"email": email},
|
"user": {"email": email, "id": str(user.id)},
|
||||||
"device_ctx": {
|
"device_ctx": {
|
||||||
"ip": request.META.get("REMOTE_ADDR"),
|
"ip": request.META.get("REMOTE_ADDR"),
|
||||||
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
||||||
@ -324,7 +324,7 @@ class MagicSignInEndpoint(BaseAPIView):
|
|||||||
"event_data": {
|
"event_data": {
|
||||||
"medium": "code",
|
"medium": "code",
|
||||||
},
|
},
|
||||||
"user": {"email": email},
|
"user": {"email": email, "id": str(user.id)},
|
||||||
"device_ctx": {
|
"device_ctx": {
|
||||||
"ip": request.META.get("REMOTE_ADDR"),
|
"ip": request.META.get("REMOTE_ADDR"),
|
||||||
"user_agent": request.META.get(
|
"user_agent": request.META.get(
|
||||||
@ -354,7 +354,7 @@ class MagicSignInEndpoint(BaseAPIView):
|
|||||||
"event_data": {
|
"event_data": {
|
||||||
"medium": "code",
|
"medium": "code",
|
||||||
},
|
},
|
||||||
"user": {"email": email},
|
"user": {"email": email, "id": str(user.id)},
|
||||||
"device_ctx": {
|
"device_ctx": {
|
||||||
"ip": request.META.get("REMOTE_ADDR"),
|
"ip": request.META.get("REMOTE_ADDR"),
|
||||||
"user_agent": request.META.get(
|
"user_agent": request.META.get(
|
||||||
|
@ -217,7 +217,7 @@ class OauthEndpoint(BaseAPIView):
|
|||||||
"event_data": {
|
"event_data": {
|
||||||
"medium": f"oauth-{medium}",
|
"medium": f"oauth-{medium}",
|
||||||
},
|
},
|
||||||
"user": {"email": email},
|
"user": {"email": email, "id": str(user.id)},
|
||||||
"device_ctx": {
|
"device_ctx": {
|
||||||
"ip": request.META.get("REMOTE_ADDR"),
|
"ip": request.META.get("REMOTE_ADDR"),
|
||||||
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
||||||
@ -285,7 +285,7 @@ class OauthEndpoint(BaseAPIView):
|
|||||||
"event_data": {
|
"event_data": {
|
||||||
"medium": f"oauth-{medium}",
|
"medium": f"oauth-{medium}",
|
||||||
},
|
},
|
||||||
"user": {"email": email},
|
"user": {"email": email, "id": str(user.id)},
|
||||||
"device_ctx": {
|
"device_ctx": {
|
||||||
"ip": request.META.get("REMOTE_ADDR"),
|
"ip": request.META.get("REMOTE_ADDR"),
|
||||||
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
"user_agent": request.META.get("HTTP_USER_AGENT"),
|
||||||
|
Loading…
Reference in New Issue
Block a user