Move analytics out of redux folder #881

Merged
liamcardenas merged 2 commits from update-analytics into master 2017-12-19 07:36:19 +01:00
2 changed files with 4 additions and 1 deletions
Showing only changes of commit a9863b9082 - Show all commits

View file

@ -46,6 +46,7 @@ export const Header = props => {
onClick={() => navigate("/subscriptions")}
button="alt button--flat"
icon="icon-at"
title={__("My Subscriptions")}
/>
</div>
<div className="header__item header__item--wunderbar">

View file

@ -73,7 +73,8 @@ document.addEventListener("click", event => {
if (target.matches("a") || target.matches("button")) {
// TODO: Look into using accessiblity labels (this would also make the app more accessible)
let hrefParts = window.location.href.split("#");
let element = target.title || (target.text && target.text.trim());
let element =
target.title || (target.textContent && target.textContent.trim());
if (element) {
amplitude.getInstance().logEvent("CLICK", {
target: element,
@ -84,6 +85,7 @@ document.addEventListener("click", event => {
amplitude.getInstance().logEvent("UNMARKED_CLICK", {
location:
hrefParts.length > 1 ? hrefParts[hrefParts.length - 1] : "/",
source: target.outerHTML,
});
}
}