Anyone know a way to add custom data attributes to the tag e.g.
<form method="post" data-gtm-location="footer">
Using the values in $field_values passed to the GF function call e.g.
gravity_form( 1, false, false, false, array( 'gtm_location' => 'footer' ), false);
The gform_form_tag
filter would be perfect, but it only receives the $form object, currently. Same with the gform_get_form_filter
filter.
I’m considering parsing the HTML in gform_get_form_filter
to get the $field_values saved in <input type="hidden" name="gform_field_values" />
. But I’m wondering if there’s a more elegant way to do this.