All guides

Track Instagram DM traffic in WooCommerce: a UTM link builder you can build today

· 4 min read

WooCommerce Analytics and Google Analytics both classify Instagram traffic as social or referral regardless of whether the click came from a story, a post, or a direct message. For a store that relies on DM conversations to close sales, this makes the data nearly useless. You can see that Instagram is sending traffic, but you cannot tell whether it is converting because of your scheduled posts or because of the time you spend in your inbox answering product questions.

The fix is UTM parameters: short tags appended to any URL that tell analytics exactly where a click came from. The catch is friction. Building a UTM URL mid-conversation requires opening an external tool, constructing the link, copying it, and picking up the thread again. Done occasionally it is manageable; done dozens of times a week it gets skipped. A plugin that lives inside the WordPress admin generates a ready-to-copy tagged link for any product in a few clicks, without switching tabs or breaking the flow of a conversation.

What one build gives you

  • Admin settings to define reusable campaigns with source, medium, and campaign values
  • Product table with one-click copy of UTM-tagged URL per campaign
  • Custom URL input for generating tagged links to any page on your site
  • Client-side URL generation with no data stored in the database

What it does not do

  • Click tracking or campaign reporting inside WordPress
  • Automatic UTM tagging of outgoing links in posts or emails
  • Link shortening or branded short URLs
  • Order attribution back to specific UTM campaigns in WooCommerce Analytics

Google Campaign URL Builder does these. This covers the part most sites use.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

Build a WordPress plugin that generates UTM-tagged URLs for WooCommerce products from the admin. Add a settings page under Settings > UTM Link Builder with a repeatable campaign section: each campaign entry has a Campaign Label (shown in the admin only), UTM Source, UTM Medium, and UTM Campaign text inputs, plus an Add Campaign button and a Remove button per entry. Save campaign data to wp_options. Add an admin page called UTM Link Builder under the WooCommerce menu. At the top of the page, include a Custom URL text field and a row of copy buttons, one per saved campaign, each labelled with the campaign label and copying the custom URL with that campaign's UTM parameters appended as query string values. Below that, show a table of all published WooCommerce products with columns for product name, product URL, and one copy button per campaign. Each copy button appends utm_source, utm_medium, and utm_campaign to the product permalink and writes the result to the clipboard using the Clipboard API, then briefly shows a Copied label on the button for one second before reverting. Do not store generated URLs or click data anywhere.

Build this pluginAbout 55 credits · the free plan includes enough for one

Why analytics cannot tell your traffic apart

UTM parameters are query strings added to the end of a URL: utm_source, utm_medium, utm_campaign, and a few others. When a visitor clicks a link with those tags, GA4 reads them and records the source separately from untagged traffic. A link sent via Instagram DM tagged with utm_source=instagram and utm_medium=dm will appear as a distinct traffic source from an Instagram post tagged with utm_medium=organic.

Without those tags, GA4 falls back to the referrer header, which for Instagram is instagram.com regardless of where inside the app the click originated. WooCommerce Analytics does not read UTM parameters at all. Both tools give the same answer: traffic came from Instagram, and that is as far as they can go.

What the plugin delivers

A Steem build for this job adds a UTM Link Builder page under the WooCommerce menu and a settings page under Settings where you define your campaigns. Each campaign has a label shown in the admin, a UTM source, a UTM medium, and a UTM campaign value. You can define as many as you need: one for Instagram DMs, one for Instagram posts, one for your email newsletter, one for TikTok.

How to install and use it

Paste the prompt below into Steem and download the zip. Install it under Plugins > Add New > Upload Plugin, then go to Settings > UTM Link Builder and add your campaigns.

Open WooCommerce > UTM Link Builder. Find the product you are about to share, click the copy button under the campaign that matches the channel you are using, and paste the result directly into your message. The link is already tagged and ready. For page links or collection URLs not in the product table, paste the URL into the Custom URL field at the top and use the same copy buttons.

When a dedicated analytics platform makes more sense

This plugin generates URLs. It does not track clicks, store data, or produce reports. The UTM parameters it adds are read by whichever analytics tool you have installed on your store, typically GA4.

If you want to see which campaigns drove orders rather than just visits, you need GA4 with ecommerce tracking enabled, or a plugin like MonsterInsights that surfaces GA4 data inside WordPress. If you need UTM tags applied automatically to every outbound link without manual effort, a marketing automation platform handles that. For the specific job of having a tagged link ready to paste whenever a DM conversation turns into a product question, the custom build is the faster path.

Questions

Does this plugin track clicks or record any data?
No. It generates URLs and copies them to your clipboard. Tracking happens in whichever analytics tool you have installed when a visitor arrives via a tagged link.
Do I need Google Analytics for the UTM tags to do anything?
You need some analytics tool that reads UTM parameters on page load. GA4 is the most common choice. WooCommerce Analytics does not natively read UTM parameters, so campaign data will not appear there.
Can I use this for channels other than Instagram?
Yes. Campaigns are fully configurable in settings. Add one for each channel you use: email newsletter, TikTok bio, Twitter DMs, or anywhere else you share product links.
Will I be able to see which campaigns produced the most orders?
If you have GA4 with ecommerce tracking set up, yes. GA4 attributes conversions to the UTM source and campaign of the session. WooCommerce Analytics alone does not have this capability.

The prompt

Loads into the composer so you can edit it first. Nothing is built, and nothing is charged, until you send it.

Build a WordPress plugin that generates UTM-tagged URLs for WooCommerce products from the admin. Add a settings page under Settings > UTM Link Builder with a repeatable campaign section: each campaign entry has a Campaign Label (shown in the admin only), UTM Source, UTM Medium, and UTM Campaign text inputs, plus an Add Campaign button and a Remove button per entry. Save campaign data to wp_options. Add an admin page called UTM Link Builder under the WooCommerce menu. At the top of the page, include a Custom URL text field and a row of copy buttons, one per saved campaign, each labelled with the campaign label and copying the custom URL with that campaign's UTM parameters appended as query string values. Below that, show a table of all published WooCommerce products with columns for product name, product URL, and one copy button per campaign. Each copy button appends utm_source, utm_medium, and utm_campaign to the product permalink and writes the result to the clipboard using the Clipboard API, then briefly shows a Copied label on the button for one second before reverting. Do not store generated URLs or click data anywhere.

Build this pluginAbout 55 credits · the free plan includes enough for one

Read next

Other plugins you can build this way

Each loads into the composer, ready to edit.