Capture UTMs/Gclid in registration form

You can add any UTM fields and handl_ fields Native WP Shortcodes to your registration form.

Here we explain how to add gclid, but this can be extended to adding any utm or other fields.

function handl_woocommerce_add_fileds_to_register() {?>
	<input type="hidden" class="input-text" name="gclid" id="reg_gclid" value="<?php esc_attr_e( $_COOKIE['gclid'] ); ?>" />
	<?php
}
add_action( 'woocommerce_register_form_start', 'handl_woocommerce_add_fileds_to_register' );

You can add this code to your template file or functions.php


Revision #5
Created Mon, Jul 19, 2021 5:30 PM by Leman
Updated Mon, Jul 19, 2021 5:34 PM by Leman