# Tracking of custom parameters not working?

**URL:** <https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306>\
**Category:** Product Support\
**Created:** [March 9, 2020, 7:30pm UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306 "2020-03-09T19:30:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [March 9, 2020, 7:30pm UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/1 "2020-03-09T19:30:34Z")

</div>

Hello,

I want to set custom parameter with the js tracking code as described at [https://www.mautic.org/docs/en/contacts/contact\_monitoring.html](https://www.mautic.org/docs/en/contacts/contact_monitoring.html).

So I tried the following tracking code:

The visitor is tracked, a contact in mautic is created.

But in this contact there is just the company data, not the firstname, the lastname or the email.

So what is my mistake with this? Why is not all the data tracked an in the created contact?

Thanks for some help with this!

Best regards,

Timo

#############################################

**Your software**  
My Mautic version is: v2.16.0  
My PHP version is: 7.1.33

These errors are showing in the log: No errors in log

---

<div class="post-metadata">

**Author:** ![renzof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renzof/32/1738_2.png) [@renzof](https://forum.mautic.org/u/renzof)\
**Post date:** [March 9, 2020, 10:04pm UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/2 "2020-03-09T22:04:49Z")

</div>

Hi,

The code was not added to your post.

Anyway to be able to submit any parameter you need to make sure the custom field by publicly updatable

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [March 10, 2020, 4:39am UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/3 "2020-03-10T04:39:53Z")

</div>

Hi,

thanks for your reply and sorry with the missing code!

Your tip with the publicly updatable setting in the field helped and now the tracking code sets these values.

The only thing I don’t understand is why the tracking code was setting the primary company although it was not a public updateable field. Maybe an error in mautic?

Best regards,

Timo

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [March 10, 2020, 4:48am UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/4 "2020-03-10T04:48:38Z")

</div>

And let me ask one more question: Is it also possible to set a segmet for an contact via the js-tracking-snipped? Or event start a campaign for a contact?

Best regards,

Timo

---

<div class="post-metadata">

**Author:** ![renzof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renzof/32/1738_2.png) [@renzof](https://forum.mautic.org/u/renzof)\
**Post date:** [March 10, 2020, 7:20am UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/5 "2020-03-10T07:20:48Z")

</div>

> [@iparker](#):
>
> I don’t understand is why the tracking code was setting the primary company

Without the code I don’t even know if you were setting the company or not 🙂 maybe the company is being set from the IP?

> [@iparker](#):
>
> Is it also possible to set a segmet for an contact via the js-tracking-snipped? Or event start a campaign for a contact?

You could set a tag via the tracking code and create a segment using that maybe?

> **[Manage segments](https://docs.mautic.org/en/contacts/manage-segments)**
>
> . Lead lists were renamed to segments in Mautic 1.4.0.Segments provide ways to easily organize your contacts. These segments can be configured from a variety of fields.When viewing all segments you will notice the column on the right which shows the...

The campaign can then start based on the segment

---

<div class="post-metadata">

**Author:** ![iparker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/iparker/32/1936_2.png) [@iparker](https://forum.mautic.org/u/iparker)\
**Post date:** [March 10, 2020, 7:36am UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/6 "2020-03-10T07:36:27Z")

</div>

Thanks for your quick reply!

> You could set a tag via the tracking code and create a segment using that maybe?  
> [Manage segments | Mautic](https://www.mautic.org/docs/en/contacts/manage_segments.html)  
> The campaign can then start based on the segment

Yes - that could be a solution.

My tracking code was:

```
<script>
   (function(w,d,t,u,n,a,m){w['MauticTrackingObject']=n;
        w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)},a=d.createElement(t),
        m=d.getElementsByTagName(t)[0];a.async=1;a.src=u;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://mautic.ipark-media.de/mtc.js','mt');

    mt('send', 'pageview', {firstname: 'Vorname', lastname: 'Nachname', company: 'Firma'});
</script>

```

---

<div class="post-metadata">

**Author:** ![renzof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/renzof/32/1738_2.png) [@renzof](https://forum.mautic.org/u/renzof)\
**Post date:** [March 10, 2020, 8:19am UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/7 "2020-03-10T08:19:08Z")

</div>

Thanks for the tracking, yes I am not sure why the company is getting set by the tracking, I am not a my pc to test it.

---

<div class="post-metadata">

**Author:** ![kuzmany](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kuzmany/32/390_2.png) [@kuzmany](https://forum.mautic.org/u/kuzmany)\
**Post date:** [March 10, 2020, 12:29pm UTC](https://forum.mautic.org/t/tracking-of-custom-parameters-not-working/13306/8 "2020-03-10T12:29:59Z")

</div>

Did you enable update publicible for each custom field? It’s disabled by default
