📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
utm generator free tool
Blue Mouse9174680efd0b
diff --git a/web/app/components/Footer/index.tsx b/web/app/components/Footer/index.tsxindex 101952948..d850de274 100644--- a/web/app/components/Footer/index.tsx+++ b/web/app/components/Footer/index.tsx@@ -14,7 +14,6 @@ import {LINKEDIN_URL,STATUSPAGE_URL,TWITTER_URL,- UTM_GENERATOR_URL,SWETRIX_VS_GOOGLE,SWETRIX_VS_CLOUDFLARE,DOCS_URL,@@ -96,7 +95,7 @@ const navigation = {{ value: 'vs Cloudflare Analytics', href: SWETRIX_VS_CLOUDFLARE },{ value: 'vs Simple Analytics', href: SWETRIX_VS_SIMPLE_ANALYTICS },{ key: 'captcha', href: CAPTCHA_URL, internal: false },- { key: 'utm', href: UTM_GENERATOR_URL, internal: false },+ { key: 'utm', href: routesPath.utm_generator, internal: true },],social: [{@@ -219,7 +218,7 @@ const SelfHostedFooter = () => {</div><div className='px-5 py-2'><a- href={UTM_GENERATOR_URL}+ href={`https://swetrix.com${routesPath.utm_generator}`}className='leading-6 text-slate-900 hover:text-slate-700 dark:text-gray-300 dark:hover:text-white'target='_blank'rel='noopener noreferrer'diff --git a/web/app/lib/constants/index.ts b/web/app/lib/constants/index.tsindex 5b7bf9cb7..4e4ab6671 100644--- a/web/app/lib/constants/index.ts+++ b/web/app/lib/constants/index.ts@@ -342,7 +342,6 @@ export const DISCORD_URL = 'https://discord.gg/ZVK8Tw2E8j'export const STATUSPAGE_URL = 'https://stats.uptimerobot.com/33rvmiXXEz'export const MAIN_URL = 'https://swetrix.com'export const REF_URL_PREFIX = `${MAIN_URL}/ref/`-export const UTM_GENERATOR_URL = 'https://url.swetrix.com'export const LIVE_DEMO_URL = '/projects/STEzHcB1rALV'export const BOOK_A_CALL_URL = 'https://cal.com/swetrix'export const PERFORMANCE_LIVE_DEMO_URL = '/projects/STEzHcB1rALV?tab=performance'diff --git a/web/app/routes/utm-generator.tsx b/web/app/routes/utm-generator.tsxnew file mode 100644index 000000000..aa9ea135c--- /dev/null+++ b/web/app/routes/utm-generator.tsx@@ -0,0 +1,373 @@+import { CopyIcon, ChevronDownIcon } from 'lucide-react'+import { useState } from 'react'+import type { SitemapFunction } from 'remix-sitemap'++import { DitchGoogle } from '~/components/marketing/DitchGoogle'+import Button from '~/ui/Button'+import Input from '~/ui/Input'+import Tooltip from '~/ui/Tooltip'++export const sitemap: SitemapFunction = () => ({+ priority: 0.8,+})++interface UTMParams {+ url: string+ utm_source: string+ utm_medium: string+ utm_campaign: string+ utm_content?: string+ utm_term?: string+}++const FAQ_ITEMS = [+ {+ question: 'What are UTM parameters?',+ answer:+ 'UTM (Urchin Tracking Module) parameters are tags you add to URLs to track the effectiveness of online marketing campaigns. They help you understand where your traffic comes from and how users interact with your campaigns.',+ },+ {+ question: 'What are the 5 UTM parameters?',+ answer:+ 'The 5 UTM parameters are: utm_source (identifies the source like Google, Facebook), utm_medium (marketing medium like email, cpc), utm_campaign (specific campaign name), utm_content (differentiates similar content), and utm_term (identifies paid search keywords).',+ },+ {+ question: 'When should I use UTM parameters?',+ answer:+ 'Use UTM parameters when running advertising campaigns on Google or social media, employing strategies to draw readers and potential clients, or when sending newsletters to monitor their effectiveness.',+ },+ {+ question: 'What is utm_source?',+ answer:+ 'utm_source identifies the source of your traffic such as a search engine (google), newsletter (newsletter), or social network (facebook).',+ },+ {+ question: 'What is utm_medium?',+ answer:+ 'utm_medium identifies the marketing medium such as email, cpc (cost-per-click), social, referral, or banner.',+ },+ {+ question: 'What is utm_campaign?',+ answer:+ 'utm_campaign identifies a specific product promotion or strategic campaign such as spring_sale, launch_2024, or black_friday.',+ },+ {+ question: 'What is utm_content?',+ answer:+ 'utm_content is used to differentiate similar content or links within the same ad. For example, if you have two CTA links in the same email, you can use utm_content to track which one performs better.',+ },+ {+ question: 'What is utm_term?',+ answer:+ 'utm_term is mainly used for paid search to identify keywords for your ad. You can use it to track which keywords generate the most traffic and conversions.',+ },+ {+ question: 'Can I track UTM parameters in Swetrix?',+ answer:+ 'Yes! Swetrix automatically tracks and analyzes UTM parameters from your URLs, providing detailed insights into your marketing campaigns performance, conversion rates, and user behavior across different traffic sources.',+ },+]++export default function UTMGenerator() {+ const [params, setParams] = useState<UTMParams>({+ url: '',+ utm_source: '',+ utm_medium: '',+ utm_campaign: '',+ utm_content: '',+ utm_term: '',+ })+ const [generatedURL, setGeneratedURL] = useState('')+ const [copied, setCopied] = useState(false)+ const [openFAQs, setOpenFAQs] = useState<Set<number>>(new Set())++ const handleParamChange = (key: keyof UTMParams, value: string) => {+ const newParams = { ...params, [key]: value }++ // If URL field is being updated, try to extract UTM parameters from it+ if (key === 'url' && value) {+ try {+ const url = new URL(value.startsWith('http') ? value : `https://${value}`)+ const urlParams = new URLSearchParams(url.search)++ // Extract UTM parameters and populate the fields+ if (urlParams.has('utm_source')) newParams.utm_source = urlParams.get('utm_source') || ''+ if (urlParams.has('utm_medium')) newParams.utm_medium = urlParams.get('utm_medium') || ''+ if (urlParams.has('utm_campaign')) newParams.utm_campaign = urlParams.get('utm_campaign') || ''+ if (urlParams.has('utm_content')) newParams.utm_content = urlParams.get('utm_content') || ''+ if (urlParams.has('utm_term')) newParams.utm_term = urlParams.get('utm_term') || ''+ } catch {+ // If URL parsing fails, that's fine, just keep the URL as is+ }+ }++ setParams(newParams)+ generateURL(newParams)+ }++ const generateURL = (currentParams: UTMParams) => {+ if (!currentParams.url) {+ setGeneratedURL('')+ return+ }++ try {+ let baseURL = currentParams.url+ if (!baseURL.startsWith('http://') && !baseURL.startsWith('https://')) {+ baseURL = `https://${baseURL}`+ }++ const url = new URL(baseURL)++ // Remove any existing UTM parameters first+ url.searchParams.delete('utm_source')+ url.searchParams.delete('utm_medium')+ url.searchParams.delete('utm_campaign')+ url.searchParams.delete('utm_content')+ url.searchParams.delete('utm_term')++ // Add new UTM parameters from the form fields+ if (currentParams.utm_source) {+ url.searchParams.set('utm_source', currentParams.utm_source)+ }+ if (currentParams.utm_medium) {+ url.searchParams.set('utm_medium', currentParams.utm_medium)+ }+ if (currentParams.utm_campaign) {+ url.searchParams.set('utm_campaign', currentParams.utm_campaign)+ }+ if (currentParams.utm_content) {+ url.searchParams.set('utm_content', currentParams.utm_content)+ }+ if (currentParams.utm_term) {+ url.searchParams.set('utm_term', currentParams.utm_term)+ }++ setGeneratedURL(url.toString())+ } catch {+ setGeneratedURL('')+ }+ }++ const copyToClipboard = async () => {+ if (!generatedURL) return++ try {+ await navigator.clipboard.writeText(generatedURL)+ setCopied(true)+ setTimeout(() => setCopied(false), 2000)+ } catch (err) {+ console.error('Failed to copy:', err)+ }+ }++ const toggleFAQ = (index: number) => {+ const newOpenFAQs = new Set(openFAQs)+ if (newOpenFAQs.has(index)) {+ newOpenFAQs.delete(index)+ } else {+ newOpenFAQs.add(index)+ }+ setOpenFAQs(newOpenFAQs)+ }++ const sourceExamples = ['google', 'facebook', 'twitter', 'newsletter', 'linkedin']+ const mediumExamples = ['cpc', 'email', 'social', 'referral', 'banner']+ const campaignExamples = ['spring_sale', 'product_launch', 'black_friday']++ return (+ <div className='min-h-screen bg-gray-50 dark:bg-slate-900'>+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>+ <div className='mx-auto max-w-4xl'>+ <div className='text-center'>+ <h1 className='text-4xl font-bold tracking-tight text-gray-900 sm:text-5xl dark:text-white'>+ UTM Link Generator+ </h1>+ <p className='mt-4 text-lg text-gray-600 dark:text-gray-400'>+ Create trackable URLs with UTM parameters to measure your marketing campaigns effectively+ </p>+ </div>++ <div className='mt-12 rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>+ <div className='space-y-6'>+ <div>+ <h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>Build your UTM link</h2>++ <div className='space-y-6'>+ <Input+ type='text'+ placeholder='https://example.com/page'+ label='Your URL address'+ value={params.url}+ onChange={(e) => handleParamChange('url', e.target.value)}+ className='w-full'+ />++ <div className='grid gap-6 md:grid-cols-2'>+ <div>+ <h3 className='mb-4 text-lg font-medium text-gray-900 dark:text-white'>Campaign parameters</h3>++ <div className='space-y-4'>+ <div>+ <Input+ type='text'+ placeholder={sourceExamples.join(', ')}+ label={+ <>+ Campaign source+ <Tooltip+ className='ml-1'+ text='Identifies the source of your traffic (e.g., google, facebook, newsletter)'+ />+ </>+ }+ value={params.utm_source}+ onChange={(e) => handleParamChange('utm_source', e.target.value)}+ className='w-full'+ />+ </div>++ <div>+ <Input+ type='text'+ placeholder={mediumExamples.join(', ')}+ label={+ <>+ Campaign medium+ <Tooltip+ className='ml-1'+ text='Identifies the marketing medium (e.g., email, cpc, social, referral)'+ />+ </>+ }+ value={params.utm_medium}+ onChange={(e) => handleParamChange('utm_medium', e.target.value)}+ className='w-full'+ />+ </div>++ <div>+ <Input+ type='text'+ placeholder={campaignExamples.join(', ')}+ label={+ <>+ Campaign name+ <Tooltip+ className='ml-1'+ text='Identifies a specific campaign (e.g., spring_sale, product_launch)'+ />+ </>+ }+ value={params.utm_campaign}+ onChange={(e) => handleParamChange('utm_campaign', e.target.value)}+ className='w-full'+ />+ </div>+ </div>+ </div>++ <div>+ <h3 className='mb-4 text-lg font-medium text-gray-900 dark:text-white'>Optional parameters</h3>++ <div className='space-y-4'>+ <div>+ <Input+ type='text'+ placeholder='link, landing page'+ label={+ <>+ Campaign content+ <Tooltip+ className='ml-1'+ text='Used to differentiate similar content or links within the same ad'+ />+ </>+ }+ value={params.utm_content}+ onChange={(e) => handleParamChange('utm_content', e.target.value)}+ className='w-full'+ />+ </div>++ <div>+ <Input+ type='text'+ placeholder='free, -30%, registration'+ value={params.utm_term}+ label={+ <>+ Campaign term+ <Tooltip+ className='ml-1'+ text='Used for paid search to identify keywords for your ad'+ />+ </>+ }+ onChange={(e) => handleParamChange('utm_term', e.target.value)}+ className='w-full'+ />+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>++ <div className='border-t border-gray-200 pt-6 dark:border-gray-700'>+ <h3 className='mb-4 text-lg font-medium text-gray-900 dark:text-white'>Result</h3>+ <div className='flex flex-col items-center gap-2 md:flex-row'>+ <Input+ type='text'+ value={generatedURL || 'Your UTM link will appear here...'}+ readOnly+ className='w-full font-mono text-sm tracking-tight'+ disabled={!generatedURL}+ />+ <Button onClick={copyToClipboard} disabled={!generatedURL} primary regular>+ <CopyIcon className='mr-1 h-4 w-4' />+ {copied ? 'Copied!' : 'Copy'}+ </Button>+ </div>+ </div>+ </div>+ </div>++ <div className='mt-16'>+ <h2 className='mb-8 text-center text-3xl font-bold text-gray-900 dark:text-white'>+ Frequently Asked Questions+ </h2>++ <div className='space-y-4'>+ {FAQ_ITEMS.map((item, index) => (+ <div+ key={index}+ className='rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'+ >+ <button+ className='flex w-full items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'+ onClick={() => toggleFAQ(index)}+ >+ <h3 className='text-lg font-medium text-gray-900 dark:text-white'>{item.question}</h3>+ <ChevronDownIcon+ className={`h-5 w-5 text-gray-500 transition-transform ${+ openFAQs.has(index) ? 'rotate-180' : ''+ }`}+ />+ </button>+ {openFAQs.has(index) ? (+ <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>+ <p className='text-gray-600 dark:text-gray-400'>{item.answer}</p>+ </div>+ ) : null}+ </div>+ ))}+ </div>+ </div>++ <DitchGoogle />+ </div>+ </main>+ </div>+ )+}diff --git a/web/app/utils/routes.ts b/web/app/utils/routes.tsindex 6fe0b54d8..6a28c842b 100644--- a/web/app/utils/routes.ts+++ b/web/app/utils/routes.ts@@ -42,6 +42,9 @@ const routes = Object.freeze({organisation: '/organisations/:id',feature_flags: '/feature-flags',dataPolicy: '/data-policy',++ // Free tools+ utm_generator: '/utm-generator',})export default routes