|
| 1 | +--- |
| 2 | +layout: base.njk |
| 3 | +permalink: / |
| 4 | +title: "Campaign URL Builder" |
| 5 | +desc: "Use the Campaign URL Builder to easily add campaign parameters to URLs so you can track Custom Campaigns in Google Analytics." |
| 6 | +--- |
| 7 | + |
| 8 | +<main class="" x-data="CampaignURLBuilder"> |
| 9 | + |
| 10 | + <div class="prose md:prose-xl mx-auto"> |
| 11 | + |
| 12 | + <h1 class="flex text-center xs:text-right justify-center"> |
| 13 | + <a href="https://freshjuice.dev" class="hover:no-underline group flex flex-col relative"> |
| 14 | + <span class="block pb-3 font-black text-transparent bg-gradient-60 from-red-500 via-amber-500 dark:via-amber-400 to-orange-600 dark:to-orange-500 bg-clip-text">Campaign URL Builder</span> |
| 15 | + <span class="text-sm md:text-base italic -mt-4 group-hover:underline"> |
| 16 | + by FreshJuice |
| 17 | + </span> |
| 18 | + </a> |
| 19 | + </h1> |
| 20 | + |
| 21 | + <p>Use the Campaign URL Builder to easily add campaign parameters to URLs so you can track Custom Campaigns in Google Analytics.</p> |
| 22 | + |
| 23 | + <form @submit.prevent> |
| 24 | + <div class="grid grid-cols-1 md:grid-cols-2 gap-4 gap-x-8"> |
| 25 | + <div class="md:col-span-2"> |
| 26 | + <label for="website-url" class="block">Website URL *</label> |
| 27 | + <input type="url" id="website-url" class="input" x-model="url" @input.debounce="generateURL()" placeholder="https://www.example.com"> |
| 28 | + <div class="text-sm px-4">The full website URL (e.g. https://example.com).</div> |
| 29 | + </div> |
| 30 | + <div> |
| 31 | + <label for="campaign-id" class="block">Campaign ID</label> |
| 32 | + <input type="text" id="campaign-source" class="input" @input.debounce="generateURL()" x-model="id" placeholder=""> |
| 33 | + <div class="text-sm px-4">The ads campaign id.</div> |
| 34 | + </div> |
| 35 | + <div> |
| 36 | + <label for="campaign-source" class="block">Campaign Source *</label> |
| 37 | + <input type="text" id="campaign-source" class="input" @input.debounce="generateURL()" x-model="source" placeholder="newsletter"> |
| 38 | + <div class="text-sm px-4">The referrer (e.g. google, newsletter).</div> |
| 39 | + </div> |
| 40 | + <div> |
| 41 | + <label for="campaign-medium" class="block">Campaign Medium *</label> |
| 42 | + <input type="text" id="campaign-medium" class="input" @input.debounce="generateURL()" x-model="medium" placeholder="cpc"> |
| 43 | + <div class="text-sm px-4">Marketing medium (e.g. cpc, banner, email)</div> |
| 44 | + </div> |
| 45 | + <div> |
| 46 | + <label for="campaign-name" class="block">Campaign Name *</label> |
| 47 | + <input type="text" id="campaign-name" class="input" @input.debounce="generateURL()" x-model="name" placeholder="spring_sale"> |
| 48 | + <div class="text-sm px-4">Product, promo code, or slogan (e.g. spring_sale).</div> |
| 49 | + </div> |
| 50 | + <div> |
| 51 | + <label for="campaign-term" class="block">Campaign Term</label> |
| 52 | + <input type="text" id="campaign-term" class="input" @input.debounce="generateURL()" x-model="term" placeholder=""> |
| 53 | + <div class="text-sm px-4">Identify the paid keywords.</div> |
| 54 | + </div> |
| 55 | + <div> |
| 56 | + <label for="campaign-content" class="block">Campaign Content</label> |
| 57 | + <input type="text" id="campaign-content" class="input" @input.debounce="generateURL()" x-model="content" placeholder=""> |
| 58 | + <div class="text-sm px-4">Use to differentiate ads.</div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + |
| 62 | + <div class="hidden"> |
| 63 | + <button type="button" class="btn" @click="generateURL()">Generate URL</button> |
| 64 | + </div> |
| 65 | + |
| 66 | + <hr class="!my-8"> |
| 67 | + |
| 68 | + <div> |
| 69 | + <label for="generated-url" class="block">Generated URL</label> |
| 70 | + <div class="relative"> |
| 71 | + <input type="text" id="generated-url" class="input pr-24" x-model="generatedURL" placeholder="" readonly> |
| 72 | + <div class="cursor-pointer font-mono text-sm absolute right-1 top-1 px-3 py-1.5 rounded-full transition-all bg-gray-100 hover:bg-gray-200 dark:hover:bg-cursor border-2 border-gray-300 dark:border-gray-400 inline-flex gap-2 items-center text-terminal" |
| 73 | + x-show="generatedURL" |
| 74 | + x-transition:enter="transition ease-out duration-700" |
| 75 | + x-transition:enter-start="opacity-0" |
| 76 | + x-transition:enter-end="opacity-100" |
| 77 | + x-transition:leave="transition ease-in duration-300" |
| 78 | + x-transition:leave-start="opacity-100" |
| 79 | + x-transition:leave-end="opacity-0" |
| 80 | + @click="copyToClipboard"> |
| 81 | + {% phicon "copy", "duotone", { class: "size-5" } %} |
| 82 | + <span>Copy</span> |
| 83 | + </div> |
| 84 | + <div class="not-prose text-base absolute inset-x-0 -bottom-6 text-center" |
| 85 | + aria-hidden="true" style="display: none" |
| 86 | + x-transition:enter="transition ease-out duration-300" |
| 87 | + x-transition:enter-start="opacity-0 transform -translate-y-4" |
| 88 | + x-transition:enter-end="opacity-100 transform translate-y-0" |
| 89 | + x-transition:leave="transition ease-in duration-200" |
| 90 | + x-transition:leave-start="opacity-100 transform translate-y-0" |
| 91 | + x-transition:leave-end="opacity-0 transform -translate-y-4" |
| 92 | + x-show="copySuccess">Link copied to clipboard!</div> |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + </form> |
| 96 | + |
| 97 | + <hr> |
| 98 | + |
| 99 | + <h2>More information and examples for each parameter</h2> |
| 100 | + <p>The following table provides more information about each parameter and examples of how they can be used.</p> |
| 101 | + |
| 102 | + |
| 103 | + <table-saw> |
| 104 | + <table> |
| 105 | + <thead> |
| 106 | + <tr> |
| 107 | + <th>Parameter</th> |
| 108 | + <th>Required</th> |
| 109 | + <th>Example</th> |
| 110 | + <th>Description</th> |
| 111 | + </tr> |
| 112 | + </thead> |
| 113 | + <tbody> |
| 114 | + <tr> |
| 115 | + <td> |
| 116 | + <p class="!mt-0 !mb-1 whitespace-nowrap">Campaign ID</p> |
| 117 | + <span class="whitespace-nowrap"><code>utm_id</code></span> |
| 118 | + </td> |
| 119 | + <td>No</td> |
| 120 | + <td><span class="whitespace-nowrap"><code>abc.123</code></span></td> |
| 121 | + <td>Used to identify which ads campaign this referral references. Use utm_id to identify a specific ads campaign.</td> |
| 122 | + </tr> |
| 123 | + <tr> |
| 124 | + <td> |
| 125 | + <p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Source</p> |
| 126 | + <span class="whitespace-nowrap"><code>utm_source</code></span> |
| 127 | + </td> |
| 128 | + <td>Yes</td> |
| 129 | + <td><span class="whitespace-nowrap"><code>newsletter</code></span></td> |
| 130 | + <td>Use utm_source to identify a search engine, newsletter name, or other source.</td> |
| 131 | + </tr> |
| 132 | + <tr> |
| 133 | + <td> |
| 134 | + <p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Medium</p> |
| 135 | + <span class="whitespace-nowrap"><code>utm_medium</code></span> |
| 136 | + </td> |
| 137 | + <td>Yes</td> |
| 138 | + <td><span class="whitespace-nowrap"><code>cpc</code></span></td> |
| 139 | + <td>Use utm_medium to identify a medium such as email or cost-per-click.</td> |
| 140 | + </tr> |
| 141 | + <tr> |
| 142 | + <td> |
| 143 | + <p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Name</p> |
| 144 | + <span class="whitespace-nowrap"><code>utm_campaign</code></span> |
| 145 | + </td> |
| 146 | + <td>No</td> |
| 147 | + <td><span class="whitespace-nowrap"><code>spring_sale</code></span></td> |
| 148 | + <td>Used for keyword analysis. Use utm_campaign to identify a specific product promotion or strategic campaign.</td> |
| 149 | + </tr> |
| 150 | + <tr> |
| 151 | + <td> |
| 152 | + <p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Term</p> |
| 153 | + <span class="whitespace-nowrap"><code>utm_term</code></span> |
| 154 | + </td> |
| 155 | + <td>No</td> |
| 156 | + <td><span class="whitespace-nowrap"><code>running+shoes</code></span></td> |
| 157 | + <td>Used for paid search. Use utm_term to note the keywords for this ad.</td> |
| 158 | + </tr> |
| 159 | + <tr> |
| 160 | + <td> |
| 161 | + <p class="!mt-0 !mb-1 whitespace-nowrap">Campaign Content</p> |
| 162 | + <span class="whitespace-nowrap"><code>utm_content</code></span> |
| 163 | + </td> |
| 164 | + <td>No</td> |
| 165 | + <td><span class="whitespace-nowrap"><code>logolink</code></span></td> |
| 166 | + <td>Used for A/B testing and content-targeted ads. Use utm_content to differentiate ads or links that point to the same URL.</td> |
| 167 | + </tr> |
| 168 | + </tbody> |
| 169 | + </table> |
| 170 | + </table-saw> |
| 171 | + |
| 172 | + </div> |
| 173 | + |
| 174 | +</main> |
0 commit comments