# Contact tracking: optional custom parameters and transfer of url in mt() event

**URL:** <https://forum.mautic.org/t/contact-tracking-optional-custom-parameters-and-transfer-of-url-in-mt-event/26971>\
**Category:** Product Support\
**Created:** [February 7, 2023, 8:27am UTC](https://forum.mautic.org/t/contact-tracking-optional-custom-parameters-and-transfer-of-url-in-mt-event/26971 "2023-02-07T08:27:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stranger](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Stranger](https://forum.mautic.org/u/Stranger)\
**Post date:** [February 7, 2023, 8:27am UTC](https://forum.mautic.org/t/contact-tracking-optional-custom-parameters-and-transfer-of-url-in-mt-event/26971/1 "2023-02-07T08:27:23Z")

</div>

**Your software**  
My Mautic version is: 3.1.0  
Angular

**Your problem**  
I am currently using the standard script:

```auto
<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://myurl/mtc.js','mt');

    mt('send', 'pageview');
</script>

```

1. 

I want to track every user login to the site (user parameters must be displayed in the tracking), as well as every step of registering a new user (entering email, entering name and surname, etc.).

As far as I understand, I have to add a function to the standard script (or instead of it), which I will call in different parts of my project (user login, first login step, second login step, etc.), in which there will be something like

```auto
function sendEvent(email, name, surname, address, ...) {
mt('send', 'pageview', {email, name, surname, address});
}

```

I can’t figure out how to write such a function, how it should interact with the standard script above (it also has mt() event) and how to make parameters optional (for example, when registration has only email)

1. 

I want get url ‘[https://myurl/mtc.js](https://myurl/mtc.js)’ from backend (appsettings.json). How can this be implemented? Is it possible to transfer the url to the mt() event as a parameter?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [February 7, 2023, 9:06am UTC](https://forum.mautic.org/t/contact-tracking-optional-custom-parameters-and-transfer-of-url-in-mt-event/26971/2 "2023-02-07T09:06:48Z")

</div>

Hi, there is an article about this:  
[https://www.mautic.org/blog/developer/tracking-visitor-data-by-smart-url](https://www.mautic.org/blog/developer/tracking-visitor-data-by-smart-url)

---

<div class="post-metadata">

**Author:** ![Stranger](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Stranger](https://forum.mautic.org/u/Stranger)\
**Post date:** [February 8, 2023, 11:42am UTC](https://forum.mautic.org/t/contact-tracking-optional-custom-parameters-and-transfer-of-url-in-mt-event/26971/3 "2023-02-08T11:42:42Z")

</div>

**joeyk** , thank you for your answer, I got the 1st part. The question with transferring U(url) parameter from main function to mt remains open.
