reacting to events

Hi,

I am wondering how i modify a contact’s contact fields and custom fields in response to events on a mautic landing page, such as post a form or scroll to end of article. I would like to increment a custom field called say comments posted.

I know I can use mt() to set contact fields and custom fields. I also know I can use the tracking pixel to add and remove tags.

I don’t know how to get a cookied contacts current value from a custom field, increment it, then write it back.

Well I do know a way but it seems wrong. I could output the custom field in a hidden span using dynamic content. Grab it using jquery and paste it into a mautic hidden form hidden field. This would let me increment it, then post it back at the same time the event happened.

Is this really how other people are doing it?

Mike