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

pass utm url parameters to checkout #352

Merged
merged 3 commits into from
Aug 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
10 changes: 7 additions & 3 deletions app/components/school-plans-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CheckCircleIcon,
} from '@heroicons/react/24/outline';
import * as Dialog from '@radix-ui/react-dialog';
import {Link} from '@remix-run/react';
import {Link, useLocation} from '@remix-run/react';
import {Button, ButtonPreset, ButtonType} from './button.js';

type SchoolPlansDialogProperties = {
Expand All @@ -12,6 +12,10 @@ type SchoolPlansDialogProperties = {
};

export default function SchoolPlansDialog({isOpen, onOpenChange}: SchoolPlansDialogProperties) {
const {search} = useLocation();
const searchParameters = search ? search.split('?')[1].split('&') : [];
const marketingSearchParameters = searchParameters.filter(searchParameter => searchParameter.includes('utm_'));

return (
<Dialog.Root open={isOpen} onOpenChange={onOpenChange}>
<Dialog.Portal>
Expand Down Expand Up @@ -65,7 +69,7 @@ export default function SchoolPlansDialog({isOpen, onOpenChange}: SchoolPlansDia

<div className='flex justify-center flex-col items-center gap-3'>
<p>R$ 77,00/mês</p>
<Link to='https://pay.hotmart.com/Y5414825L?off=z0k6km14&hideBillet=1&hidePix=1&showOnlyTrial=1' target='_blank'>
<Link to={`https://pay.hotmart.com/Y5414825L?off=z0k6km14&hideBillet=1&hidePix=1&showOnlyTrial=1&${marketingSearchParameters.join('&')}`} target='_blank'>
<Button
type={ButtonType.Button}
preset={ButtonPreset.Secondary}
Expand Down Expand Up @@ -140,7 +144,7 @@ export default function SchoolPlansDialog({isOpen, onOpenChange}: SchoolPlansDia
<p className='text-xs'>pago anualmente</p>
<p>ou R$ 497,00 por ano</p>
</div>
<Link to='https://pay.hotmart.com/Y5414825L?off=0dc69b6z&hideBillet=1&hidePix=1&showOnlyTrial=1' target='_blank'>
<Link to={`https://pay.hotmart.com/Y5414825L?off=0dc69b6z&hideBillet=1&hidePix=1&showOnlyTrial=1&${marketingSearchParameters.join('&')}`} target='_blank'>
<Button
type={ButtonType.Button}
preset={ButtonPreset.Primary}
Expand Down
1 change: 0 additions & 1 deletion app/routes/escola-online.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as Accordion from '@radix-ui/react-accordion';
import {useState} from 'react';
import {Button, ButtonPreset, ButtonType} from '~/components/button.js';
import {Testimonies} from '~/layouts/testimonies.js';
import {History} from '~/layouts/yem-history.js';
import {buildImgSource} from '~/utils/build-cloudflare-image-source.js';
import {PlaylistCard} from '~/components/playlist-card.js';
import {AccordionItem} from '~/components/accordion.js';
Expand Down
Loading