# Tracking visits from a link with a custom variable

**URL:** <https://forum.mautic.org/t/tracking-visits-from-a-link-with-a-custom-variable/29708>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [October 18, 2023, 4:02pm UTC](https://forum.mautic.org/t/tracking-visits-from-a-link-with-a-custom-variable/29708 "2023-10-18T16:02:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stemautic88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stemautic88/32/690_2.png) [@stemautic88](https://forum.mautic.org/u/stemautic88)\
**Post date:** [October 18, 2023, 4:02pm UTC](https://forum.mautic.org/t/tracking-visits-from-a-link-with-a-custom-variable/29708/1 "2023-10-18T16:02:57Z")

</div>

**Your software**  
My Mautic version is: 4.4.9  
My PHP version is: 8.0.30  
My Database type and version is: MySQL 8.0.34

**Your problem**  
My problem is:  
I need to track visits to a specific page of my website while retrieving a specific variable ([www.example.com/specific-page/?pr=test](http://www.example.com/specific-page/?pr=test)). The visits will come from emails send from outside my Mautic installation.  
The Report I created does not show any page hits.

These errors are showing in the log:  
None, as there is no error.

Steps I have tried to fix the problem:

I used the information provided on the following website: [https://www.mautic.org/blog/developer/tracking-visitor-data-by-smart-url](https://www.mautic.org/blog/developer/tracking-visitor-data-by-smart-url)  
to adjust my tracking script. The custom field is publicly updatable, yet I couldn’t see any entries in the report I created.  
The custom field has the following settings:

- Label = Partner
- Alias = pr
- Object = Contact
- Group = Core
- Data Type = Text
- No Default Value

As of GDPR, the tracking script will only run, when the visitor agrees to the tracking with Mautic.  
On the report I created, I use filters to find any page hits from a specific partner. I tried using the filter column “Hit URL”, “Campaign”, “Contact Partner”, but did not get anything. Is there a way to check if Mautic received the variable from the website visit?

Any suggestions about setting this tracking up is highly appreciated.

Thanks,  
Stephan

---

<div class="post-metadata">

**Author:** ![stemautic88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stemautic88/32/690_2.png) [@stemautic88](https://forum.mautic.org/u/stemautic88)\
**Post date:** [October 19, 2023, 2:53pm UTC](https://forum.mautic.org/t/tracking-visits-from-a-link-with-a-custom-variable/29708/2 "2023-10-19T14:53:05Z")

</div>

Hi everyone,

as I did not get the smart links to work, I tried a different approach by using Mautic Landing Page Redirects.

This is how it works:

1. Create a New Landing Page URL that suites my needs (the custom variable, e.g. a title for a campaign)
2. LP category Redirects
3. LP is unpublished
4. Redirect Type 302 temporary
5. Redirect URL: the one where the traffic should go

Create a Report:

1. Data: Date hit, Hit URL, Hit referer, and what ever you need.
2. Filter: Hit URL contains “LP redirect name” from above.

This way I could create URLs to give someone else and still be able to track the traffic.

Maybe I get the smart link to work one day, but it’s not that important for me now.  
Hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [October 21, 2023, 2:53am UTC](https://forum.mautic.org/t/tracking-visits-from-a-link-with-a-custom-variable/29708/3 "2023-10-21T02:53:40Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
