UTM parameters in URL are removed in visit logs

UTM parameters in URL are removed in visit logs

We have a system to send mass emails to our users, there is a link (with our custom UTM parameters) for users to access our goal page.
This is the sample URL: https://ourdomain.com/our-goal-page?utm_source=sample_value&utm_medium=sample_value

However, when users click that URL to visit our page, the UTM values aren’t stored in the visit logs table, the referer URL is stored as https://ourdomain.com/our-goal-page.

We lose the data for our internal analytics.
Do you have any idea to solve this issue?

Thank you

Ithink thisis done by design, as such parameters “pollute” the pages dashboard (our-goal-page stays our-goal-page whatever the referrer is…).

You can install the free plugin Marketing Campaigns Reporting:

You can see it live there:
https://demo.matomo.cloud/index.php?module=CoreHome&action=index&idSite=1&period=day&date=2022-04-09&updated=1#?idSite=1&period=day&date=2022-04-09&category=Referrers_Referrers&subcategory=Referrers_Campaigns

Other solutions (but not the best ones)

If you want to discriminate pages with the referrer, you can otherwise add some personal parameters (eg. source and medium) to the utm_* ones:
https://ourdomain.com/our-goal-page?utm_source=sample_value&utm_medium=sample_value&source=sample_value&medium=sample_value

Or else you could remove the utm parameters from the ones detected as marketing campaign parameters (in the config/config.ini.php file), section Tracker, parameters campaign_keyword_var_name and campaign_var_name. (I don’t know it it will work, but it should…)

Thanks, Philippe

I tried your suggestion but it didn’t work :frowning:
I figured out that when users click on the URL from the email and redirect to our website, the referer URL is empty. Matomo bases on referer URL to determine the visit is direct, campaign, or social…
In this case, Matomo understands it’s a direct visit, then it strips all the UTM values before saving them to the database (direct visit shouldn’t have UTM values as they mentioned)

I’m still investigating on it

I found the root cause

There is a mechanism to redirect the URL from email to another page and remove all extra UTM values :joy:, that’s why we can’t see any data in the database

I’ll close this topic and thank you all

@heurteph-ei I just came across this because I’m also facing the issue that the URLs of the visits log is not showing the actual URLs / stripping the URL Parameters. So there’s no way to recover that information? Why would you strip and permanently delete UTM Parameters in a marketing analytics tool?? For example, if a specific campaign used the utm_term query parameter, this information is permanently lost if you didn’t tell Matomo explicitly to track that??

Also, can you confirm that a visit object exported through your API via getLastVisitsDetails holds the following properties that match as follows to the according utm query parameters:

  • campaignSource = utm_source
  • campaignMedium = utm_medium
  • campaignName = utm_campaign
  • ??? = utm_term

Hi @fulstadev

Because the Marketing Campaigns Reporting does that job, and in page report, thanks to te utm parameters cleaning, you won’t have duplicate pages for the same page.

Here is the list of supported params:

  • mtm_campaign (campaign name such as mailing_2017_03 or Easter_Sale),
  • mtm_source (campaign source such as google or facebook),
  • mtm_medium (campaign medium such as email or cpc),
  • mtm_keyword (campaign keyword),
  • mtm_content (campaign content),
  • mtm_cid (campaign ID code).
  • mtm_group (campaign group).
  • mtm_placement (campaign placement).

If you already have URLs tagged with Google Analytics parameters these are also supported:

  • utm_campaign,
  • utm_source,
  • utm_medium,
  • utm_term,
  • utm_content,
  • utm_id.

For the utm_* <> getLastVisitsDetails API equivalence, I think the best is to test with the visi of the page whose link has been generated by the Campaign URL generator: