UTM auto-tagging for shared links #154

Open
opened 2026-06-23 13:33:48 +00:00 by jmiller · 2 comments
Owner

Summary

Automatically append UTM tracking parameters to article URLs in cross-posted content. Every major SaaS tool (Hootsuite, Sprout Social) offers this. No Joomla competitor does.

Implementation

Add UTM parameters to the {url} placeholder in CrossPostDispatcher::buildArticleMeta():

{url}?utm_source={platform}&utm_medium=social&utm_campaign=mokosuitecross

Configuration

Component config fields:

  • utm_enabled (Yes/No, default No)
  • utm_source (default: {platform} -- auto-replaced with service type)
  • utm_medium (default: social)
  • utm_campaign (default: mokosuitecross)
  • utm_content (optional, default empty)

Template Placeholders

  • {url} -- already exists, would get UTM params appended when enabled
  • {url_raw} -- new placeholder for URL without UTM params

Acceptance Criteria

  • Component config for UTM parameters
  • {platform} token resolved in UTM values
  • UTM params appended to {url} when enabled
  • {url_raw} placeholder for clean URLs
  • Existing & in URLs handled correctly
## Summary Automatically append UTM tracking parameters to article URLs in cross-posted content. Every major SaaS tool (Hootsuite, Sprout Social) offers this. No Joomla competitor does. ## Implementation Add UTM parameters to the `{url}` placeholder in `CrossPostDispatcher::buildArticleMeta()`: ``` {url}?utm_source={platform}&utm_medium=social&utm_campaign=mokosuitecross ``` ## Configuration Component config fields: - `utm_enabled` (Yes/No, default No) - `utm_source` (default: `{platform}` -- auto-replaced with service type) - `utm_medium` (default: `social`) - `utm_campaign` (default: `mokosuitecross`) - `utm_content` (optional, default empty) ## Template Placeholders - `{url}` -- already exists, would get UTM params appended when enabled - `{url_raw}` -- new placeholder for URL without UTM params ## Acceptance Criteria - [ ] Component config for UTM parameters - [ ] `{platform}` token resolved in UTM values - [ ] UTM params appended to `{url}` when enabled - [ ] `{url_raw}` placeholder for clean URLs - [ ] Existing `&` in URLs handled correctly
Author
Owner

Implemented in commit 7e5ff12. UTM config fieldset added to config.xml with utm_source (default {platform}), utm_medium, utm_campaign, utm_content. {platform} token resolved per-service in renderTemplate(). {url_raw} placeholder added for clean URLs. UTM params appended in buildArticleMeta() via http_build_query().

Implemented in commit `7e5ff12`. UTM config fieldset added to config.xml with utm_source (default `{platform}`), utm_medium, utm_campaign, utm_content. `{platform}` token resolved per-service in `renderTemplate()`. `{url_raw}` placeholder added for clean URLs. UTM params appended in `buildArticleMeta()` via `http_build_query()`.
Author
Owner

Testing Checklist

Migrated from #172

Test Steps

Configuration

  • UTM Tracking fieldset appears in Component Options
  • Enable/disable toggle works
  • utm_source defaults to {platform}
  • utm_medium defaults to social
  • utm_campaign defaults to mokosuitecross
  • utm_content is optional (empty by default)
  • Fields hidden when UTM disabled (showon works)

Placeholder Resolution

  • {url} includes UTM params when enabled (e.g. ?utm_source=facebook&utm_medium=social)
  • {url} has NO UTM params when disabled
  • {url_raw} always returns clean URL without UTM params
  • {platform} token in utm_source resolved to service type (facebook, twitter, telegram, etc.)
  • URLs with existing query params use & separator (not duplicate ?)

Per-Service Verification

  • Facebook post URL has utm_source=facebook
  • Twitter post URL has utm_source=twitter
  • Telegram post URL has utm_source=telegram

Related

  • #154 (implementation, closed)
## Testing Checklist _Migrated from #172_ ## Test Steps ### Configuration - [ ] UTM Tracking fieldset appears in Component Options - [ ] Enable/disable toggle works - [ ] utm_source defaults to {platform} - [ ] utm_medium defaults to social - [ ] utm_campaign defaults to mokosuitecross - [ ] utm_content is optional (empty by default) - [ ] Fields hidden when UTM disabled (showon works) ### Placeholder Resolution - [ ] {url} includes UTM params when enabled (e.g. ?utm_source=facebook&utm_medium=social) - [ ] {url} has NO UTM params when disabled - [ ] {url_raw} always returns clean URL without UTM params - [ ] {platform} token in utm_source resolved to service type (facebook, twitter, telegram, etc.) - [ ] URLs with existing query params use & separator (not duplicate ?) ### Per-Service Verification - [ ] Facebook post URL has utm_source=facebook - [ ] Twitter post URL has utm_source=twitter - [ ] Telegram post URL has utm_source=telegram ## Related - #154 (implementation, closed)
jmiller reopened this issue 2026-06-23 17:20:11 +00:00
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#154