Tracking of custom parameters not working?

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.

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

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

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

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

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

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

The campaign can then start based on the segment

1 Like

Thanks for your quick reply!

You could set a tag via the tracking code and create a segment using that maybe?
Manage segments | Mautic
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>

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.

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