Google Analytics UTM Campaign Builder

Create trackable marketing links for Google Analytics 4 (GA4) with standardized campaign tags and instant high-resolution QR codes.

Channel Presets:

How to Use the Google Analytics UTM Campaign Builder

1

Enter Destination URL

Paste the webpage address where visitors should land (e.g. https://blueutils.com/pricing).

2

Fill In Channel & Campaign

Specify the traffic source, medium, and campaign name (or pick a 1-click popular channel preset).

3

Copy Link or QR Code

Copy your standardized, encoded tracking link or scan/download the generated high-resolution QR code.

UTM Parameters Explained

Traffic Source (utm_source)

Tells Google Analytics which platform sent the traffic (e.g. google, newsletter, twitter).

Marketing Medium (utm_medium)

Identifies the broad delivery channel type (e.g. email, cpc, social, referral).

Campaign Name (utm_campaign)

Groups analytics performance under a specific marketing initiative (e.g. summer_sale, v2_launch).

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the Google Analytics UTM Campaign Builder do?

The Google Analytics UTM Campaign Builder constructs standardized, error-free, and URL-encoded Google Analytics 4 (GA4) campaign tracking links. It automatically attaches tracking parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content), normalizes spaces and uppercase characters, and generates instant high-resolution QR codes for print and event marketing.

Marketers, developers, and growth teams use this tool to ensure uniform traffic attribution across advertising channels, newsletters, and social media posts.

Core Concepts & UTM Parameters

Google Analytics tracks inbound marketing traffic using standardized query parameters:

  • utm_source: Identifies where the link was placed (e.g. google, newsletter, twitter).
  • utm_medium: Identifies the broad marketing channel type (e.g. cpc, email, social, referral).
  • utm_campaign: Groups analytics under a specific marketing promotion or launch name (e.g. summer_sale, v2_launch).
  • utm_term: Identifies targeted paid search keywords (e.g. developer-tools).
  • utm_content: Differentiates specific buttons or ad variants within the same campaign (e.g. header_cta, sidebar_banner).

How to use the tool?

  1. Enter Destination Website URL: Paste the webpage address where visitors should land (e.g. https://blueutils.com/pricing).
  2. Select a Channel Preset or Enter Custom Tags: Click a 1-click popular channel preset (Google Ads, Facebook, Twitter/X, Newsletter) or enter custom parameters.
  3. Copy Link or Scan QR Code: Copy your formatted, encoded campaign link or download the generated QR code.

REST API Integration

Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/url/utm-builder) for programmatic integration.

API Request Parameters

Name Type Description Example
url String Destination website URL (required). "https://blueutils.com/pricing"
source String Campaign source (utm_source). "newsletter"
medium String Campaign medium (utm_medium). "email"
campaign String Campaign name (utm_campaign). "weekly_digest"
term String Optional search keywords (utm_term). "developer-tools"
content String Optional ad variant (utm_content). "cta_button"

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/url/utm-builder \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://blueutils.com/pricing",
    "source": "twitter",
    "medium": "social",
    "campaign": "v2_launch"
  }'

Python

import requests

url = "https://blueutils.com/api/url/utm-builder"
payload = {
    "url": "https://blueutils.com/pricing",
    "mode": "build",
    "source": "newsletter",
    "medium": "email",
    "campaign": "weekly_digest"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = "{\"url\":\"https://blueutils.com\",\"mode\":\"build\",\"source\":\"google\",\"medium\":\"cpc\",\"campaign\":\"search_ads\"}";
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/url/utm-builder"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether URL processing succeeded. true
mode String Active processing mode ("build" or "clean"). "build"
generatedUrl String Complete encoded campaign URL (Build mode). "https://blueutils.com/pricing?utm_source=twitter..."
cleanUrl String Sanitized tracking-free URL (Clean mode). "https://example.com/item?item_id=99"
strippedCount Number Count of removed tracking parameters (Clean mode). 2
qrCodeUrl String Direct URL for scannable QR code image. "https://api.qrserver.com/..."

API Response Payload Examples

Success Response (HTTP 200 OK - Build Mode)

{
  "isValid": true,
  "mode": "build",
  "baseUrl": "https://blueutils.com/pricing",
  "generatedUrl": "https://blueutils.com/pricing?utm_source=twitter&utm_medium=social&utm_campaign=v2_launch",
  "params": {
    "utm_source": "twitter",
    "utm_medium": "social",
    "utm_campaign": "v2_launch",
    "utm_term": "",
    "utm_content": ""
  },
  "qrCodeUrl": "https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=..."
}

Success Response (HTTP 200 OK - Clean Mode)

{
  "isValid": true,
  "mode": "clean",
  "originalUrl": "https://example.com/item?utm_source=fb&fbclid=IwAR123&item_id=99",
  "cleanUrl": "https://example.com/item?item_id=99",
  "strippedCount": 2,
  "strippedParams": ["utm_source", "fbclid"]
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Please enter a valid website destination URL (e.g., https://example.com)."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API for UTM building and link sanitization?

Integrating the UTM Builder API into automated publishing workflows and chatbots provides several practical advantages:

  • Automated Social Schedulers: Marketing bots and RSS-to-social pipelines can dynamically generate standardized campaign links before publishing.
  • Privacy Bots for Chat Communities: Slack, Discord, and Telegram bots can sanitize user-posted tracking links in real time to protect community privacy.
  • Uniform Data Conventions: Enforces lowercase, hyphen-delimited parameters across distributed marketing teams.

Native Usage

How to build and sanitize UTM links locally using native command-line utilities and scripts:

Windows (PowerShell UTM Formatter)

# Build a UTM campaign URL in PowerShell
$url = "https://blueutils.com/pricing"
$source = "newsletter"
$medium = "email"
$campaign = "weekly_digest"
"$url`?utm_source=$source&utm_medium=$medium&utm_campaign=$campaign"

Linux / Unix (Sed & Tr URL Cleaner)

# Strip UTM and Facebook tracking tags using sed
echo "https://example.com/page?utm_source=google&fbclid=xyz&item=1" | sed -E 's/[?&](utm_[^&]+|fbclid=[^&]+)//g'

Python (Standard Library urllib UTM Builder)

import urllib.parse

def build_utm(url, source, medium, campaign):
    params = {"utm_source": source, "utm_medium": medium, "utm_campaign": campaign}
    parsed = urllib.parse.urlparse(url)
    query = urllib.parse.parse_qs(parsed.query)
    query.update({k: [v.lower().replace(" ", "-")] for k, v in params.items()})
    new_query = urllib.parse.urlencode(query, doseq=True)
    return urllib.parse.urlunparse(parsed._replace(query=new_query))

print(build_utm("https://blueutils.com/pricing", "twitter", "social", "v2_launch"))

Java (Native Standard Library URL Query Cleaner)

import java.net.URI;
import java.util.Arrays;
import java.util.stream.Collectors;

public class UtmCleaner {
    public static void main(String[] args) throws Exception {
        URI uri = new URI("https://example.com/page?utm_source=fb&fbclid=123&id=42");
        String cleanQuery = Arrays.stream(uri.getQuery().split("&"))
            .filter(p -> !p.startsWith("utm_") && !p.startsWith("fbclid") && !p.startsWith("gclid"))
            .collect(Collectors.joining("&"));
        URI cleanUri = new URI(uri.getScheme(), uri.getAuthority(), uri.getPath(), cleanQuery.isEmpty() ? null : cleanQuery, null);
        System.out.println(cleanUri.toString());
    }
}

Frequently Asked Questions (FAQ)

How do I create a Google Analytics campaign tracking URL with UTM parameters?

Enter your destination URL, specify your traffic source (e.g. newsletter), marketing medium (e.g. email), and campaign name, then click Generate Campaign URL to copy the encoded link and QR code.

What are the 3 mandatory UTM parameters in Google Analytics 4?

Google Analytics 4 requires utm_source (traffic origin), utm_medium (marketing channel), and utm_campaign (promotion or launch name) for accurate attribution.

Can I generate QR codes for my UTM campaign URLs?

Yes. The builder automatically creates an instant scannable high-resolution QR code for print marketing, event flyers, and physical banners.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.