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:

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:

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