• Resolved andrewwatson

    (@andrewwatson)


    Hi, I’m using UM and need (but can’t find) a simple solution to track on which page a user fills in the registration form.

    I’d like to create a custom field hidden from the user which is set to either the current page, or I could use a UTM code which will be stored in a cookie (like HandL UTM Grabber or UTM Tracker).

    The only part I don’t know is how to get either the page URL or the data stored by the fields from either of the UTM trackers above, into the custom field. (and for that matter, I can work out how to make a hidden field).

    I’m looking for the simplest solution and I would be very thankful for any suggestions.

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi,

    You can get the current Page URL with UM Register form by using the method get_the_permalink();

    Also see: https://wordpress.stackexchange.com/a/84049

    Regards,

    Thread Starter andrewwatson

    (@andrewwatson)

    Hi Thanks for your response, I really appreciate it!

    The goal has changed a little because we realized that people might migrate away for the page they land on, so recording the UTM code would be better.

    I think I’ll use UTM Tracker.

    See here: (under how do I use it)

    https://larryludwig.com/plugins/utm-tracker/

    I really appreciate the help I think this looks simple to do, but I don’t actually know how to write php and implement the method you gave.

    Are you able to tell me how to get the utm_source parameter into a custom UM field? I’m sure this would be of use to man other people too.

    Again many thanks for your help.

    Thread Starter andrewwatson

    (@andrewwatson)

    I have changed to UTM Grabber

    ( https://www.haktansuren.com/handl-utm-grabber/ )

    and I’ll use this code provided on the Ultimate Member website to create a hidden field:

    add_action('um_after_register_fields', 'add_a_hidden_field_to_register');
    function add_a_hidden_field_to_register( $args ) {
    	echo '<input type="hidden" name="field_id" id="field_id" value="HERE_GOES_THE_VALUE" />';
    }

    The only thing I don’t know is what to put for this:
    <input type=”hidden” name=”field_id” id=”field_id” value=”HERE_GOES_THE_VALUE” />

    (also, does this code go in functions.php ?)

    Thread Starter andrewwatson

    (@andrewwatson)

    ok. In the end it was easier than all of that. This will work for those who want to add UTM codes to Ultimate Member forms.

    I used use UTM grabber (a free plugin – https://wordpress.org/plugins/handl-utm-grabber/) record the UTM code and then added a custom shortcode field in Ultimate Member. There I added the shortcode: [utm_source]

    On the frontend I hid this with the following CSS:

    .um-field-shortcode {
    display: none;
    }

    Not the most elegant solution, but it works. The only problem is that this particular custom field doesn’t show up in the Mail chimp for Ultimate member that we purchased, I’ll open a different thread for that (I have check it wasn’t affected by the CSS).

    • This reply was modified 4 years, 5 months ago by andrewwatson.
    • This reply was modified 4 years, 5 months ago by andrewwatson.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Simple page track’ is closed to new replies.