Skip to main content

UTM Tracking

UTM Tracking preserves campaign parameters (UTM codes, gclid, fbclid) through the Google sign-in process, ensuring accurate attribution for marketing campaigns.

PRO Feature

UTM Tracking is a PRO feature. Upgrade to PRO to unlock this functionality.

The Problem​

Without UTM tracking:

1. User arrives via ad: yoursite.com?utm_source=google&gclid=abc123
2. User clicks Google sign-in
3. OAuth redirect loses UTM parameters
4. Attribution data lost

The Solution​

With UTM tracking:

1. User arrives via ad with UTM parameters
2. Plugin captures parameters before sign-in
3. Parameters stored during OAuth flow
4. After sign-in, parameters restored
5. Attribution preserved for analytics/orders

Tracked Parameters​

UTM Parameters​

ParameterDescriptionExample
utm_sourceTraffic sourcegoogle, facebook
utm_mediumMarketing mediumcpc, email, social
utm_campaignCampaign namesummer_sale
utm_termPaid keywordsrunning+shoes
utm_contentAd content/variantbanner_a
utm_idCampaign IDabc123

Click IDs​

ParameterPlatformExample
gclidGoogle AdsCj0KCQiA...
fbclidFacebookIwAR0xyz...
msclkidMicrosoft Adsabc123
dclidDoubleClickxyz789

Configuration​

Enable UTM Tracking​

  1. Go to Settings > OneTap Login
  2. Click Integrations tab (or Users)
  3. Enable Preserve UTM parameters
  4. Save Changes

UTM Tracking Settings

Settings Options​

SettingDescription
Enable UTM trackingToggle feature on/off
Store first-touchSave first visit attribution
Store last-touchSave most recent attribution
Save to user metaStore with user profile
Save to order metaStore with WooCommerce orders

Attribution Models​

First-Touch Attribution​

Records parameters from user's first visit:

Visit 1: utm_source=google (stored as first-touch)
Visit 2: utm_source=facebook
Visit 3: User registers
→ First-touch: google

Use for: Understanding discovery channel

Last-Touch Attribution​

Records parameters from most recent visit:

Visit 1: utm_source=google
Visit 2: utm_source=facebook (stored as last-touch)
Visit 3: User registers
→ Last-touch: facebook

Use for: Understanding converting channel

Both Models​

Enable both for complete picture:

User Meta:
_onetap_utm_first_touch: {...google data...}
_onetap_utm_last_touch: {...facebook data...}

Data Storage​

User Meta​

UTM data stored in user meta:

Meta KeyContent
_onetap_utm_sourceTraffic source
_onetap_utm_mediumMarketing medium
_onetap_utm_campaignCampaign name
_onetap_utm_termKeywords
_onetap_utm_contentAd content
_onetap_gclidGoogle Ads click ID
_onetap_fbclidFacebook click ID

WooCommerce Order Meta​

UTM Order Meta

When order placed:

Meta KeyContent
_onetap_utm_sourceSource at time of order
_onetap_utm_campaignCampaign at time of order
_onetap_gclidGoogle click ID

WooCommerce Attribution Integration​

OneTap integrates with WooCommerce's built-in order attribution:

  • Data flows to WC attribution table
  • Visible in Order Analytics
  • Works with WC reports

Viewing UTM Data​

In User Profile​

  1. Go to Users > All Users
  2. Click on user
  3. Scroll to "Marketing Attribution"

In Order Details​

  1. Go to WooCommerce > Orders
  2. Click on order
  3. Look for "Marketing Attribution" or "UTM Data"

Via Database​

SELECT * FROM wp_usermeta
WHERE user_id = 123
AND meta_key LIKE '_onetap_utm%';

Analytics Integration​

Google Analytics 4​

UTM parameters flow to GA4 automatically when present in URLs.

For Enhanced Tracking​

Use webhooks to send data:

{
"event": "user_registered",
"context": {
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "summer_sale",
"gclid": "Cj0KCQiA..."
}
}

With gclid preserved:

  1. User registers via ad
  2. gclid captured
  3. Pass to Google Ads API
  4. Conversion attributed to ad

Use Cases​

Measure Campaign ROI​

1. Run Google Ads campaign
2. Users sign up via ad
3. UTM data captured
4. Track which campaigns drive registrations
5. Calculate cost per acquisition

Optimize Ad Spend​

1. Multiple campaigns running
2. Track registrations per campaign
3. Identify high-performing campaigns
4. Shift budget to winners

Attribution Reporting​

1. Export user data with UTM
2. Build attribution report
3. Understand customer journey
4. First vs last touch analysis

Customer Segmentation​

1. Segment users by utm_source
2. Google users vs Facebook users
3. Different messaging per segment
4. Personalized experiences

Hooks for Developers​

Before Storing UTM​

add_filter('onetap_utm_data', function($utm_data, $user_id) {
// Add custom parameter
$utm_data['custom_param'] = $_GET['my_param'] ?? null;
return $utm_data;
}, 10, 2);

After UTM Stored​

add_action('onetap_utm_stored', function($user_id, $utm_data) {
// Send to analytics service
// Update CRM
// Log for reporting
}, 10, 2);

Filter Which Parameters to Track​

add_filter('onetap_tracked_params', function($params) {
// Add custom parameter
$params[] = 'my_tracking_id';
return $params;
});

Troubleshooting​

UTM Data Not Captured​

Causes:

  1. Feature disabled
  2. Parameters lost before page load
  3. JavaScript not running

Solutions:

  1. Enable UTM tracking
  2. Check URL on landing page
  3. Verify JS loads

Wrong Attribution Data​

Causes:

  1. First vs last touch confusion
  2. Multiple visits without tracking
  3. Cookie expiration

Solutions:

  1. Understand attribution model
  2. Enable consistent tracking
  3. Check cookie duration

Data Not in Orders​

Causes:

  1. Order meta not enabled
  2. User signed in after landing
  3. Different browser/device

Solutions:

  1. Enable order meta storage
  2. Data captured at registration time
  3. Cross-device attribution limited

Privacy Considerations​

GDPR​

UTM data may be considered personal data:

  • Document in privacy policy
  • Include in data export
  • Delete on erasure request

If using cookies to persist UTM:

  • May require consent
  • Integrate with cookie consent plugin
  • Consider session-only storage

Data Retention​

Storage Duration​

  • User meta: Until user deleted
  • Order meta: Until order deleted
  • Cookies: Session or configured duration

Cleanup​

// To remove UTM data
delete_user_meta($user_id, '_onetap_utm_source');
delete_user_meta($user_id, '_onetap_utm_medium');
// etc.

Best Practices​

Campaign Naming​

Use consistent UTM naming:

utm_source: platform (google, facebook, email)
utm_medium: type (cpc, organic, newsletter)
utm_campaign: campaign_name_date

Testing​

Before campaigns:

  1. Test with manual UTM URL
  2. Verify data captured
  3. Check user/order meta
  4. Confirm analytics integration

Documentation​

Maintain:

  • UTM naming conventions
  • Campaign tracking spreadsheet
  • Attribution model documentation

Next Steps​