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

trymito.io: better goal tracking on glossary pages #1209

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions trymito.io/pages/excel-to-python/[...slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require('prismjs/components/prism-python');

import Link from 'next/link';
import { arraysContainSameValueAndOrder } from '../../utils/arrays';
import { PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_IN_CONTENT_CTA, PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_TOC_CTA, PLAUSIBLE_MITO_EXPORTED_FUNCTION_CODE_COPIED } from '../../utils/plausible';
import { PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_IN_CONTENT_CTA, PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_TOC_CTA, PLAUSIBLE_COPIED_CODE_MITO_EXPORTED_FUNCTION, PLAUSIBLE_COPIED_CODE_NON_MITO_EXPORTED_FUNCTION } from '../../utils/plausible';

const getRelatedFunctionHref = (relatedFunctionShortName: string, glossaryPageInfo: GlossaryPageInfo[]) => {
const relatedFunction = glossaryPageInfo.filter((glossaryPageInfo) => {
Expand Down Expand Up @@ -202,7 +202,7 @@ const ExcelToPythonGlossaryPage = (props: {pageContent: PageContent, glossaryPag
})}
{codeSection.codeLines.length > 0 &&
<CodeBlock
className={codeSection.shortTitle.startsWith('Mito') ? PLAUSIBLE_MITO_EXPORTED_FUNCTION_CODE_COPIED : ''}
className={PLAUSIBLE_COPIED_CODE_NON_MITO_EXPORTED_FUNCTION}
>
{codeSection.codeLines.join('\n')}
</CodeBlock>
Expand All @@ -225,7 +225,7 @@ const ExcelToPythonGlossaryPage = (props: {pageContent: PageContent, glossaryPag
<a href={MITO_INSTALLATION_DOCS_LINK} target="_blank" rel="noreferrer" className={classNames(pageStyles.link, PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_IN_CONTENT_CTA)}>Install Mito</a> to start using Excel formulas in Python.
</p>
<CodeBlock
className={PLAUSIBLE_MITO_EXPORTED_FUNCTION_CODE_COPIED}
className={PLAUSIBLE_COPIED_CODE_MITO_EXPORTED_FUNCTION}
>
{[
"# Import the mitosheet Excel functions",
Expand Down Expand Up @@ -268,7 +268,7 @@ const ExcelToPythonGlossaryPage = (props: {pageContent: PageContent, glossaryPag
})}
{codeSections.codeLines.length > 0 &&
<CodeBlock
className={codeSections.shortTitle.startsWith('Mito') ? 'mito-code-block' : ''}
className={PLAUSIBLE_COPIED_CODE_NON_MITO_EXPORTED_FUNCTION}
>
{codeSections.codeLines.join('\n')}
</CodeBlock>
Expand Down
4 changes: 3 additions & 1 deletion trymito.io/utils/plausible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_EXCEL_TO_PYTHON_GLOSSARY_IN_CON
export const PLAUSIBLE_INSTALL_DOCS_CTA_LOCATION_BLOG = 'plausible-event-name=install_docs_cta_pressed+location_blog'

// The user copied the code from a code block that contains a Mito exported function, ie: SUM(df['A']) from the glossary page
export const PLAUSIBLE_MITO_EXPORTED_FUNCTION_CODE_COPIED = 'plausible-event-name=mito_exported_function_code_copied'
export const PLAUSIBLE_COPIED_CODE_MITO_EXPORTED_FUNCTION = 'plausible-event-name=copied_code_mito_exported_function'
// The user copied some other code from a code block that does not contain a Mito exported function
export const PLAUSIBLE_COPIED_CODE_NON_MITO_EXPORTED_FUNCTION = 'plausible-event-name=copied_code_non_mito_exported_function'

// The user clicked a book a demo CTA
export const PLAUSIBLE_BOOK_A_DEMO_CTA_PRESSED = 'plausible-event-name=book_a_demo_cta_pressed+location_title_card'