My Mautic version is: 4.4.1
My PHP version is: PHP Version 7.4.30
My Database type and version is: 10.6.8-MariaDB
Hi,
I am trying to use URL parameters to populate fields in forms, but it is not working.
I tried doing it as detailed here:
But it is not working. Fields have “Auto fill data” to Yes and I saw a lot of other ideas in this forum but none is working.
Another problem which I think is related is “Record UTM tags in a Form” isn’t working also.
I am using a AMI in AWS provided by Bitnami.
Any ideas?
César
mikew
August 30, 2022, 10:19am
2
Hi
A few basics that maybe you are already taken care of here:
Make sure the custom fields are set as Publicly Updatable
Make sure you are testing on a browser where you are not logged into Mautic.
Hi @mikew ,
Thanks for your help. But still not working.
Custom fields were with “Publicly updatable” = Yes
and I tested in several browsers (Safari, Firefox and Chrome) with no results. None of them connected to Mautic.
I am new to Mautic, so I installed Bitnami 4.4.1 version on AWS. I do not know if this (because is very recent) could be a problem.
And my experience tells me this is related with the problem of not recording when I select the action “Record UTM tags in a Form”, but I have no idea where is the problem.
This is the page I am testing with an embebed form:
Clases semanales sobre anuncios en Google, Facebook - MAUTIC - Gestión de Anuncios on-line ?
This is something I am using with Active Campaign and I want to move to Mautic, but I need this working first.
César
Hi,
I had also some problems with exactly this subject and I could solve it by adding this script to the page:
<script>
(new URL(window.location.href)).searchParams.forEach((x, y) =>document.getElementById(y).value = x);
</script>
After you will add the script to the page you mentioned, you will be able to call the page with the prefilled fields like this (we will be using the IDs of the input fields):
https://www.cimborrio5.com/mautic-clases-semanales?mauticform_input_capturaleadsevento1_nombre=Ionut&mauticform_input_capturaleadsevento1_tu_mejor_email=test@test.de
JoeyK mentioned that fields should be filled without the script … by me this did not worked, so I am using the script.
Greetings from Germany,
Ionut
Thanks @IonutOjicaDe
Not working… and I cannot understand why. You can check that your code is in the page but not working.
I have a doubt… not and expert on JS, but the pair of key=value params… x is the name of the param and y the value? if so, it has to be changed: getElementById(x).value = y.
But I also tried this change with no luck.
And also is the problem of recording utm values…
I’ll keep fighting. Thanks for your time.
César
mikew
September 5, 2022, 5:46am
6
Hi. I am not sure what your custom fields are called, so maybe what you have is correct, but in the off case that it is not so you should use the custom field like Gestión de anuncios on-line - Gestión de Anuncios on-line
What are your custom field names for firstname and email ?
Inside your form are you linking the fields you are making to a field like email or firstname.
Can you send screenshots of your form, the fields inside, and then the settings of the fields from custom fields
Hi @mikew
This is the screenshot for the form:
This for the fields:
Field number one is the name of the contact. I think I have to use a text field and link with “First name”. So…
Field 1-> General
Field 1 → Contact field
Field 1 → Behavior
Same for field 2 which is used for email… Contact field
But regarding custom fields, I did not create any new custom field. I understand I have to use the first name and email.
Do you mean I need to put those as “Publicly updatable”?
Because I already did that but nothing changed…
Here you can see First name:
I just need to populate the name and email when url is called like
Am I wrong on something?
Many thanks!
César
mikew
September 7, 2022, 6:16am
8
Hi @cesarcimborrio5
It looks like you have done everything correctly. I am unfamiliar with the Bitnami install, from what I see it all looks good.
I could not find the page where your form is at the moment, the last thing to try is to manually push the data into the form via a url so something like https://yourdomain.com/page-with-form?firstname=mike
Test that and see if that populates.
When doing that have a look at all the logs to see if there are any errors. There are a few logs to look at:
The console log
The Mautic System log from the Mautic interface (System Info->logs)
The mautic.error log which usually site in /var/log/nginx/mautic.errror or /var/log/apache2/mautic.error
robm
September 7, 2022, 7:30am
9
Definitely check out this post
acording with this code the name of the field is campaign not accountType, so in the URL you should have ?campaign=ProspectFreeClass1,
what my script will do is look at all the parameters passed in the URL (eg: campaign). then check if there is a mautic form field with that name (or name=“mauticform[campaign]”) and set the value of the field in this example ProspectFreeClass, the user is free to change the form field (unless you define the field as “readonly” or “hidden” , and the value will …
Leo’s script worked for me
1 Like
system
Closed
September 10, 2022, 11:28am
10
This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.