resume/docker/resume/one-pager-tools/utm-tool.html

354 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Free UTM URL builder tool. Generate tracking URLs with UTM parameters for marketing campaigns. Client-side processing for privacy.">
<title>UTM URL Generator - Free Campaign URL Builder</title>
<link rel="stylesheet" href="../styles.css">
<link rel="stylesheet" href="tool-styles.css" integrity="sha256-nsutlmVxvyIyABk8i0fzVyO+ram8rkuTntoETIGcou8=">
<script src="../theme.js" integrity="sha256-+dDNTo7WAOmn2YC875+vn9oH4UkMwlVOGlARp2uq3A4="></script>
<script src="../includes.js" integrity="sha256-CJbyPP0VWE+XrarLtjHMffGrI2GlTXXAXOce+NE+aQg="></script>
<style>
.utm-form {
display: grid;
gap: 1rem;
max-width: 600px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.form-group label {
font-weight: 600;
color: var(--text-color);
}
.form-group label .required {
color: #e63946;
}
.form-group label .optional {
color: var(--date-color);
font-weight: normal;
font-size: 0.85em;
}
.form-group input {
padding: 0.75rem;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--bg-color);
color: var(--text-color);
font-size: 1rem;
}
.form-group input:focus {
outline: none;
border-color: var(--accent-color);
box-shadow: 0 0 0 2px rgba(69, 123, 157, 0.2);
}
.form-group input.error {
border-color: #e63946;
}
.form-group .hint {
font-size: 0.8rem;
color: var(--date-color);
}
.custom-params-section {
margin-top: 1rem;
padding-top: 1rem;
border-top: 1px solid var(--border-color);
}
.custom-params-section h3 {
margin-bottom: 0.75rem;
font-size: 1rem;
}
.custom-param-row {
display: flex;
gap: 0.5rem;
margin-bottom: 0.5rem;
align-items: center;
}
.custom-param-row input {
flex: 1;
padding: 0.5rem;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--bg-color);
color: var(--text-color);
}
.custom-param-row input:focus {
outline: none;
border-color: var(--accent-color);
}
.btn-remove-param {
padding: 0.5rem 0.75rem;
background: #e63946;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
}
.btn-remove-param:hover {
background: #c1121f;
}
.btn-add-param {
padding: 0.5rem 1rem;
background: var(--accent-color);
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 0.9rem;
}
.btn-add-param:hover {
opacity: 0.9;
}
.output-section {
margin-top: 2rem;
padding: 1.5rem;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
}
.output-section h2 {
margin-top: 0;
margin-bottom: 1rem;
}
.generated-url {
word-break: break-all;
padding: 1rem;
background: var(--bg-color);
border: 1px solid var(--border-color);
border-radius: 4px;
font-family: 'Courier New', monospace;
font-size: 0.9rem;
min-height: 3rem;
}
.generated-url.empty {
color: var(--date-color);
font-style: italic;
}
.generated-url.valid {
border-color: #2a9d8f;
}
.generated-url.invalid {
border-color: #e63946;
}
.copy-section {
margin-top: 1rem;
display: flex;
gap: 1rem;
align-items: center;
}
.btn-copy {
padding: 0.75rem 1.5rem;
background: var(--accent-color);
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
}
.btn-copy:hover {
opacity: 0.9;
}
.btn-copy:disabled {
background: var(--border-color);
cursor: not-allowed;
}
.copy-feedback {
color: #2a9d8f;
font-weight: 600;
opacity: 0;
transition: opacity 0.2s;
}
.copy-feedback.show {
opacity: 1;
}
.url-breakdown {
margin-top: 1.5rem;
}
.url-breakdown h3 {
margin-bottom: 0.5rem;
font-size: 1rem;
}
.url-breakdown table {
width: 100%;
border-collapse: collapse;
font-size: 0.9rem;
}
.url-breakdown th,
.url-breakdown td {
padding: 0.5rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.url-breakdown th {
font-weight: 600;
width: 30%;
}
.url-breakdown td {
font-family: 'Courier New', monospace;
word-break: break-all;
}
.validation-message {
margin-top: 0.5rem;
padding: 0.5rem;
border-radius: 4px;
font-size: 0.9rem;
}
.validation-message.error {
background: rgba(230, 57, 70, 0.1);
color: #e63946;
}
.validation-message.success {
background: rgba(42, 157, 143, 0.1);
color: #2a9d8f;
}
.validation-message.info {
background: rgba(69, 123, 157, 0.1);
color: var(--accent-color);
}
</style>
</head>
<body>
<!-- Header Include -->
<div id="header-include"></div>
<div class="container-fluid" role="main" id="main-content">
<h1>UTM URL Generator</h1>
<p>Build tracking URLs with UTM parameters for your marketing campaigns.</p>
<div class="tool-container">
<div class="utm-form">
<div class="form-group">
<label for="baseUrl">Website URL <span class="required">*</span></label>
<input type="url" id="baseUrl" placeholder="https://example.com/page" aria-required="true">
<span class="hint">The full URL of the page you want to track</span>
</div>
<div class="form-group">
<label for="utmSource">Campaign Source <span class="required">*</span></label>
<input type="text" id="utmSource" placeholder="google, newsletter, facebook" aria-required="true">
<span class="hint">utm_source: Identifies which site sent the traffic</span>
</div>
<div class="form-group">
<label for="utmMedium">Campaign Medium <span class="required">*</span></label>
<input type="text" id="utmMedium" placeholder="cpc, email, social" aria-required="true">
<span class="hint">utm_medium: The marketing medium (e.g., cpc, email, social)</span>
</div>
<div class="form-group">
<label for="utmCampaign">Campaign Name <span class="required">*</span></label>
<input type="text" id="utmCampaign" placeholder="spring_sale, product_launch" aria-required="true">
<span class="hint">utm_campaign: The specific campaign name</span>
</div>
<div class="form-group">
<label for="utmTerm">Campaign Term <span class="optional">(optional)</span></label>
<input type="text" id="utmTerm" placeholder="running+shoes, marketing+software">
<span class="hint">utm_term: Paid search keywords</span>
</div>
<div class="form-group">
<label for="utmContent">Campaign Content <span class="optional">(optional)</span></label>
<input type="text" id="utmContent" placeholder="logolink, textlink, banner_v1">
<span class="hint">utm_content: Differentiate ads or links pointing to the same URL</span>
</div>
<div class="custom-params-section">
<h3>Custom Parameters <span class="optional">(optional)</span></h3>
<div id="customParams"></div>
<button type="button" class="btn-add-param" id="addParamBtn" aria-label="Add custom parameter">+ Add Parameter</button>
</div>
</div>
<div class="output-section">
<h2>Generated URL</h2>
<div id="validationMessage" class="validation-message" aria-live="polite"></div>
<div id="generatedUrl" class="generated-url empty" aria-live="polite">
Enter a URL and required parameters to generate your tracking URL
</div>
<div class="copy-section">
<button type="button" class="btn-copy" id="copyBtn" disabled aria-label="Copy URL to clipboard">Copy URL</button>
<span class="copy-feedback" id="copyFeedback">Copied!</span>
</div>
<div class="url-breakdown" id="urlBreakdown" style="display: none;">
<h3>URL Parameters</h3>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
</thead>
<tbody id="breakdownBody"></tbody>
</table>
</div>
</div>
</div>
<hr>
<h2>About This Tool</h2>
<p>This UTM URL Generator helps you create campaign tracking URLs with:</p>
<ul>
<li>All standard UTM parameters (source, medium, campaign, term, content)</li>
<li>Custom parameters for additional tracking needs</li>
<li>Live URL preview as you type</li>
<li>Proper URL encoding for special characters</li>
<li>One-click copy to clipboard</li>
</ul>
<p>The tool processes everything in your browser - no data is sent to any server.</p>
</div>
<!-- Footer Include -->
<div id="footer-include"></div>
<script src="utm-tool.js" integrity="sha256-f5yZtBrRofKWD/H5Hth5syEYPun+WicrCGxKzyzwZ6A="></script>
</body>
</html>