Help with Rails

Currently my Ruby on Rails project uses Mautic through Javascript, as their show in the documentation:


    (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','http(s)://yourmautic.com/mtc.js','mt');

    mt('send', 'pageview', {email: ..., etc: ...});

However, we had some problems with that and I’ve been tasked to monitor the same information, but doing such on a Rails controller instead of doing it in the HTML through Javascript. I found the mautic gem, but it requires a newer version of Rails than what my project uses, so I cannot use it. Anyone have any ideas/suggestions of how I can monitor the exact same information through a Rails controller? Is it even possible?

I’m not the one who originally set up Mautic, and in fact, I never worked with Mautic before. So I’m quite clueless on how to achieve this.

Thanks in advance for your time & help.