-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add analytics events for external links #2247
Conversation
Size Change: +2.87 kB (0%) Total Size: 846 kB
ℹ️ View Unchanged
|
267be91
to
66afe98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and saw the events locally, and the get media action sent the GET_MEDIA
event as expected! Your explanation around not adding an event to the attribution text section makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweeeeet
036eb7d
to
d8459af
Compare
Fixes
Fixes #1078 by @dhruvkb
Description
This PR adds three closely-related analytics events:
EXTERNAL_LINK_CLICK
VISIT_CREATOR_LINK
VISIT_LICENSE_PAGE
The
EXTERNAL_LINK_CLICK
event is fired every time an externalVLink
is clicked, unlesssend-external-link-click-event
prop isfalse
. This prop is used to replace theEXTERNAL_LINK_CLICK
event with other custom events such asGET_MEDIA
, if necessary.I've also added the analytics events to links in the copyable HTML media attribution statement:
Normally, clicking the creator link here should send
VISIT_CREATOR_LINK
event. However, it is impossible to get whether the link is the creator or title link from this HTML. I thought of using the heuristics of "if a link follows the word 'by'", but since the attribution HTML is translated, this is not reliable.Testing Instructions
Run the app (
just frontend/run dev
) and try clicking external links (most of them have the "external link" icon next to them) everywhere in the app. Indev
mode, you should see the events and their payloads in the console. Clicking on any given external link should send a single event, either theEXTERNAL_LINK_CLICK
or a different custom event likeGET_MEDIA
.Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin