Skip to content
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

Track Lunr search-result clicks #1570

Open
2 of 3 tasks
chalin opened this issue Aug 28, 2023 · 2 comments
Open
2 of 3 tasks

Track Lunr search-result clicks #1570

chalin opened this issue Aug 28, 2023 · 2 comments

Comments

@chalin
Copy link
Collaborator

chalin commented Aug 28, 2023

Tasks

Context

Originally posted by @harshit-gangal in #1519 (comment)

image

The statement you are referring to (https://developers.google.com/tag-platform/devguides/events#gtag.js_1) concerns UA:

The Universal Analytics event information is structured as follows: <value> ... A non-negative integer that will appear as the vent value.

I'm not aware that this is a restriction for GA4. In fact, you can see the search-result URL from the realtime event reports page as the value of the value attribute. For this example, I searched for "install" and clicked on the "Local Install via Homebrew" search result:

Screen Shot 2023-08-28 at 14 38 15

Also, by using the tagassistant, you can see that the search-result URL is available as ep.value of a click event:

Name Parameter Value
Protocol Version v 2
Measurement ID tid G-JWT03RNV4P
Page Title dt Vitess | Scalable. Reliable. MySQL-compatible. Cloud-native. Database.
Event Name en click
Event Parameter ep.anonymize_ip false
Event Parameter ep.event_category Lunr Search
Event Parameter ep.event_label Search-result Click
Event Parameter ep.search_term install
Event Parameter ep.value https://vitess.io/docs/17.0/get-started/local-mac/

That being said, it will be difficult to use GA4 reports to view the URL. Let me investigate this further.

@chalin
Copy link
Collaborator Author

chalin commented Aug 28, 2023

For a search-result click event, it would be better to use link_url rather than value to hold the search-result URL. Let me make that change first. Note that even with that change, I haven't been able to generate reports containing that URL, despite adding custom metrics. (Maybe it's just because custom reports don't have access to realtime data, so I'll try again tomorrow.)

@chalin
Copy link
Collaborator Author

chalin commented Aug 29, 2023

Yesterday I defined some custom metrics (see below), but it seems that only restricted metric types are supported, excluding strings:

Screen Shot 2023-08-29 at 18 15 35

The custom metrics (set to type "standard") turn out to be interpreted as integers in reports:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant