Track Instagram DM traffic in WooCommerce

Published Updated 2 min read

WooCommerce Analytics and Google Analytics file Instagram traffic as social or referral whether the click came from a story, a post or a direct message. For a store that closes sales in DMs, that makes the data close to useless: Instagram is sending visitors, but you cannot tell whether your scheduled posts or the hours spent answering product questions in your inbox are doing the converting.

UTM parameters fix it: short tags on a URL that tell analytics exactly where a click came from. The catch is friction. Building one mid-conversation means opening an outside tool, assembling the link, copying it and finding your place in the thread again. Occasionally that is fine; dozens of times a week it gets skipped. A link builder inside wp-admin hands you a tagged link for any product in a couple of clicks.

Why analytics cannot tell your traffic apart

UTM parameters are query strings on the end of a URL: utm_source, utm_medium, utm_campaign and a few others. GA4 reads them when a visitor arrives and records that source separately from untagged traffic, so a DM link tagged utm_source=instagram and utm_medium=dm shows up apart from a post tagged utm_medium=organic.

Without tags, GA4 falls back to the referrer, which is instagram.com wherever in the app the click happened. WooCommerce Analytics does not read UTM parameters at all. Both can tell you the traffic came from Instagram, and no more.

Settings > UTM Link Builder is where you define campaigns, each with a label for the admin and its source, medium and campaign values. Make as many as you use: Instagram DMs, Instagram posts, the newsletter, a TikTok bio, Twitter DMs.

WooCommerce > UTM Link Builder lists every product with its URL and a copy button per campaign. Find the product you are about to share, click the button for the channel you are in, and the tagged URL lands on your clipboard with a brief 'Copied' confirmation, ready to paste into the message.

A Custom URL field at the top does the same for any other page on the site, such as a collection or a landing page. Links are built in the browser and nothing is stored in the database.

The plugin makes URLs and nothing else. It does not count clicks, store data or produce reports. The tags are read by whatever analytics runs on your store, usually GA4, when a visitor arrives.

To see which campaigns drove orders, not just visits, you need GA4 with ecommerce tracking, which attributes conversions to the session's source and campaign, or something like MonsterInsights that brings GA4 data into WordPress. WooCommerce Analytics alone cannot do it.

If every outbound link should be tagged automatically, that is a marketing automation platform's job. For having a tagged link ready the moment a DM turns into a product question, this is the quicker path.

What you get

Included

  • 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

Not included

  • 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 the things on the right. This build covers the part most sites use.

Build it in Steem

The button opens the builder with this guide's prompt filled in, so you can change anything before it runs. Nothing is built, and nothing is charged, until you send it.

Build this pluginAbout 55 credits. The free plan includes enough for one.
Read the prompt (190 words)

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.