mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-02 01:18:30 +02:00
add Segment click tracking for the documentation feedback buttons (#2085)
This commit is contained in:
@@ -110,7 +110,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
document.querySelectorAll('.menu-mobile__item').forEach((item) => {
|
||||
item.addEventListener('click', () => {
|
||||
console.log(item.dataset.path);
|
||||
toggleMenu(item.dataset.path);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,10 +49,10 @@ const handleClickInteraction = (event) => {
|
||||
}
|
||||
};
|
||||
|
||||
// Gather all <a> elements that have been tagged
|
||||
// Gather all <a> and <button> elements that have been tagged
|
||||
// for tracking via 'data-metric-loc' attribute
|
||||
function tagAllAnchors() {
|
||||
const allMetricsAnchors= document.querySelectorAll('a[data-metric-loc]');
|
||||
const allMetricsAnchors= document.querySelectorAll('a[data-metric-loc], button[data-metric-loc]');
|
||||
|
||||
if (allMetricsAnchors) {
|
||||
allMetricsAnchors.forEach(anchor => {
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
<section class="docs-feedback d-print-none">
|
||||
<h5 class="docs-feedback__title">{{ .Params.title }}</h5>
|
||||
<div class="docs-feedback__buttons">
|
||||
<button class="button button_outlined button_sm docs-feedback__button" id="feedback__answer_yes">
|
||||
<button class="button button_outlined button_sm docs-feedback__button" id="feedback__answer_yes" data-metric-loc="useful_prompt_yes">
|
||||
<img src="{{ .Params.positiveButton.icon.src }}" alt="{{ .Params.positiveButton.icon.alt }}" />
|
||||
{{ .Params.positiveButton.text }}
|
||||
</button>
|
||||
<button class="button button_outlined button_sm docs-feedback__button" id="feedback__answer_no">
|
||||
<button class="button button_outlined button_sm docs-feedback__button" id="feedback__answer_no" data-metric-loc="useful_prompt_no">
|
||||
<img src="{{ .Params.negativeButton.icon.src }}" alt="{{ .Params.negativeButton.icon.alt }}" />
|
||||
{{ .Params.negativeButton.text }}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user