A simple WordPress plugin that provides a shortcode to capture UTM parameters, append them to a URL, and generate a link. Useful in situations when you want to capture UTMs, but are unable to directly edit a page template's PHP code.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
inc
README.md
utmcapture.php

README.md

UTM Capture

Contributors: Barrett Cox, [barrett@barrettcox.com](mailto:barrett@barrettcox.com?subject=Feedback about UTM Capture)
Tags: wordpress, plugin, utm
Requires at least: 4.0
Tested up to: 4.6.1
Stable tag: 0.5
License: GPLv3 or later
License URI: https://choosealicense.com/licenses/gpl-3.0/

Description

A simple WordPress plugin that provides a shortcode to capture UTM parameters, append them to a URL, and generate a link. Useful in situations when you want to capture UTMs, but are unable to directly edit a page template's PHP code.

Instructions

Activating the Plugin

  1. Download or clone this repository and upload it to your /plugins directory.
  2. Go to “Plugins”, and locate the UTM Capture plugin.
  3. If the plugin is not activated, click “Activate” to enable it for the site.

Using the Shortcode

Here is an example of the utmcapture shortcode:

[utmcapture url="/formpage" text="Download the PDF" css_class="btn btn-primary"]

The utmcapture shortcode takes 3 attributes:

  • url: The URL you want to link to
  • text: A string of text to appear as the linked text
  • css_class: A string of CSS class names that you want applied to the <a> element.

UTM Parameters

UTM Capture will automatically capture the following parameters and add them to the URL string:

  • utm_source
  • utm_medium
  • utm_medium
  • utm_campaign
  • utm_term