-
-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Is your feature request related to a problem? Please describe.
Besides the auto event page view I want the page click event that occurs when a user clicked on a page. If it's an external link I want it to be a page clickout event.
Describe the solution you'd like
There are three different options:
- Just a click somewhere on the page
- A click on an internal link
- A click on an external site
A page click event could contain the following basic data for all the options
interface PageClick {
id: string,
tagName: string,
className: string
isLink: boolean;
}if isLink is true add these data properties
interface PageClickLink {
title: string;
text: string;
href: string;
}And if it's an external link change the action from click to clickout.
Describe alternatives you've considered
Don't measure it at all. This will lead to a lot of events. I guess people could be annoyed the amount of events and there should be a possibility to disable it (shout out to mapping).
Additional context
Inspiration from a previous beta:
function isLink(elem) {
var parent = elem.parentElement;
if (elem instanceof HTMLAnchorElement) return elem;
return parent ? isLink(parent) : false;
}
function isExternalLink(elem) {
return elem.host !== window.location.host;
}