• Resolved smartconsult

    (@smartconsult)


    Hello, I need to pass the Google Ads GCLID, which is stored in a cookie, through a hidden field in a form. I have tried to do it with JQuery but for some reason the value is not assigned to the field. Please can you help me with this matter? This is the JQuery I’m using:

    var $j = jQuery.noConflict();
    $j(document).ready(function() {
    // Read cookie
    function getCookie(name) {
    var match = document.cookie.match(new RegExp(‘(^| )’ + name + ‘=([^;]+)’));
    return match ? match[2] : null;
    }

    // Get gclid
    var gclidValue = getCookie(‘gclid’);

    // Assign the cookie value to the hidden field with class ‘mf_hidden_gclid_class’
    $j(‘.mf_hidden_gclid_class’).val(gclidValue).trigger(‘change’);
    });

    Thank you!!

Viewing 1 replies (of 1 total)
  • Plugin Support Moin Munna

    (@moinmunna)

    Hi @smartconsult,

    Thanks for reaching out to us.

    By default, the hidden fields do not support any dynamic values. So I understand the need for a custom code, but be informed that we do not provide support for these types of custom codes. I suggest you make a feature request describing what you need in the plugin’s details page>Useful Links section. We’ll try to provide the feature soon if we see a good demand.

    Let us know if there is anything else that you need help with.

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Add URL params to hidden field’ is closed to new replies.