Added logging of icon searches

This commit is contained in:
squidfunk 2021-02-15 17:17:11 +01:00
parent 6ad24784cc
commit 8de8da222f
6 changed files with 21 additions and 8 deletions

View File

@ -9,8 +9,8 @@
"assets/stylesheets/main.css.map": "assets/stylesheets/main.45122f27.min.css.map", "assets/stylesheets/main.css.map": "assets/stylesheets/main.45122f27.min.css.map",
"assets/stylesheets/palette.css": "assets/stylesheets/palette.e03a20ad.min.css", "assets/stylesheets/palette.css": "assets/stylesheets/palette.e03a20ad.min.css",
"assets/stylesheets/palette.css.map": "assets/stylesheets/palette.e03a20ad.min.css.map", "assets/stylesheets/palette.css.map": "assets/stylesheets/palette.e03a20ad.min.css.map",
"overrides/assets/javascripts/bundle.js": "overrides/assets/javascripts/bundle.0f7341a3.min.js", "overrides/assets/javascripts/bundle.js": "overrides/assets/javascripts/bundle.e5217812.min.js",
"overrides/assets/javascripts/bundle.js.map": "overrides/assets/javascripts/bundle.0f7341a3.min.js.map", "overrides/assets/javascripts/bundle.js.map": "overrides/assets/javascripts/bundle.e5217812.min.js.map",
"overrides/assets/stylesheets/main.css": "overrides/assets/stylesheets/main.c2cc92d1.min.css", "overrides/assets/stylesheets/main.css": "overrides/assets/stylesheets/main.c2cc92d1.min.css",
"overrides/assets/stylesheets/main.css.map": "overrides/assets/stylesheets/main.c2cc92d1.min.css.map" "overrides/assets/stylesheets/main.css.map": "overrides/assets/stylesheets/main.c2cc92d1.min.css.map"
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -53,5 +53,5 @@
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{ 'overrides/assets/javascripts/bundle.0f7341a3.min.js' | url }}"></script> <script src="{{ 'overrides/assets/javascripts/bundle.e5217812.min.js' | url }}"></script>
{% endblock %} {% endblock %}

View File

@ -24,8 +24,10 @@ import { Observable, combineLatest, fromEvent, merge } from "rxjs"
import { import {
delay, delay,
distinctUntilChanged, distinctUntilChanged,
filter,
map, map,
startWith startWith,
withLatestFrom
} from "rxjs/operators" } from "rxjs/operators"
import { watchElementFocus } from "~/browser" import { watchElementFocus } from "~/browser"
@ -71,6 +73,17 @@ export function mountIconSearchQuery(
distinctUntilChanged() distinctUntilChanged()
) )
/* Log search on blur */
focus$
.pipe(
filter(active => !active),
withLatestFrom(value$)
)
.subscribe(([, value]) => {
const path = document.location.pathname
ga("send", "pageview", `${path}?q=[icon]+${value}`)
})
/* Combine into single observable */ /* Combine into single observable */
return combineLatest([value$, focus$]) return combineLatest([value$, focus$])
.pipe( .pipe(