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

Add the page title to Segment tracking #259

Closed
msbt opened this issue Apr 26, 2021 · 2 comments · Fixed by #262
Closed

Add the page title to Segment tracking #259

msbt opened this issue Apr 26, 2021 · 2 comments · Fixed by #262

Comments

@msbt
Copy link
Collaborator

msbt commented Apr 26, 2021

We just realized that all docs pages are getting the title "visited_section_docs" in Analytics, because of this line here: https://github.com/crate/crate-docs-theme/blob/master/src/crate/theme/rtd/crate/layout.html#L191

We specifically tell Segment to use that as the page title via analytics.page('visited_section_docs'...

I was playing around with it locally and analytics.page('{{ title }} - {{ docstitle }}', { already seems to give more information, but since this is only a local demo, I don't know if those are the correct tags. Can anyone confirm or suggest better title options?

Cheers, M

@msbt
Copy link
Collaborator Author

msbt commented May 17, 2021

thanks to @amotl and #262 this can be closed

@msbt msbt closed this as completed May 17, 2021
@msbt
Copy link
Collaborator Author

msbt commented May 31, 2021

@amotl @norosa there is a small problem with pages like https://crate.io/docs/crate/reference/en/4.5/sql/statements/create-table.html - the segment snippet on the rendered page looks like this:
analytics.page('<code class="docutils literal notranslate"><span class="pre">CREATE</span> <span class="pre">TABLE</span></code> - CrateDB: Reference', {

the code to display this is the one above (analytics.page('{{ title }} - {{ docstitle }}', {), any idea how to sanitize this properly to remove the html tags?

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