# How are utm codes on mtracking.gif hits supposed to work?

**URL:** <https://forum.mautic.org/t/how-are-utm-codes-on-mtracking-gif-hits-supposed-to-work/18772>\
**Category:** Product Support\
**Created:** [March 30, 2021, 2:11pm UTC](https://forum.mautic.org/t/how-are-utm-codes-on-mtracking-gif-hits-supposed-to-work/18772 "2021-03-30T14:11:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steverobinson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/steverobinson/32/174_2.png) [@steverobinson](https://forum.mautic.org/u/steverobinson)\
**Post date:** [March 30, 2021, 2:11pm UTC](https://forum.mautic.org/t/how-are-utm-codes-on-mtracking-gif-hits-supposed-to-work/18772/1 "2021-03-30T14:11:06Z")

</div>

**Your software**  
My Mautic version is: 3.3.2  
My PHP version is: 7.4  
My Database type and version is: MariaDB latest

**Your problem**  
I am confused about how utm codes (utm\_campaign, utm\_source, utm\_medium, etc) on mtracking.gif pixel fires are supposed to work. The documentation implies that I should be able to create arbitrary entries in the contact’s timeline by passing utm\_campaign as the title and utm\_source to set an icon as url parameters to a pixel request.

In other words, if I fire the pixel like this:  
[https://my.mauticserver.com/mtracking.gif?utm\_medium=ad&utm\_campaign=campaign](https://my.mauticserver.com/mtracking.gif?utm_medium=ad&utm_campaign=campaign)

…I am expecting an entry in the timeline with a bullseye icon and a title of “campaign”.

However, in practice, all I can ever create is a pageview entry. Regardless of what I pass as utm\_campaign or utm\_medium, I can only set the title of the timeline entry with the page\_title or page\_url, and the icon is always the pageview icon (two chain links). If I omit page\_title and page\_url from my request, I get a blank entry with a pageview icon.

Before I go log an issue on GitHub, how is this supposed to work?

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [March 31, 2021, 7:16am UTC](https://forum.mautic.org/t/how-are-utm-codes-on-mtracking-gif-hits-supposed-to-work/18772/2 "2021-03-31T07:16:24Z")

</div>

Related to [https://github.com/mautic/mautic/pull/9265](https://github.com/mautic/mautic/pull/9265)

---

<div class="post-metadata">

**Author:** ![steverobinson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/steverobinson/32/174_2.png) [@steverobinson](https://forum.mautic.org/u/steverobinson)\
**Post date:** [April 2, 2021, 5:05pm UTC](https://forum.mautic.org/t/how-are-utm-codes-on-mtracking-gif-hits-supposed-to-work/18772/3 "2021-04-02T17:05:29Z")

</div>

@adiux Thanks for sharing that link. I read through the PR and it doesn’t look like it addresses my confusion, though it does look like I should retest the functionality after 4.0 drops because your PR does look like it will change how it works.

If I understand your PR correctly, it should pick up utm parameters when passed to mtracking.gif when included (urlencoded) in the page\_url parameter as part of the page\_url and not separate parameters pushed directly. Is that correct?

---

<div class="post-metadata">

**Author:** ![adiux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/adiux/32/5793_2.png) [@adiux](https://forum.mautic.org/u/adiux)\
**Post date:** [June 19, 2021, 6:13am UTC](https://forum.mautic.org/t/how-are-utm-codes-on-mtracking-gif-hits-supposed-to-work/18772/4 "2021-06-19T06:13:12Z")

</div>

Hi @steverobinson, once the PR is active Mautic will detect the UTM parameters in the url and automatically assign the UTM fields inside Mautic. It works with all urls: Website tracking and gif.

So no need to pass them in as separat parameters.
