gform_event_label

Filter: gform_event_label.

Description

apply_filters( 'gform_event_label', (string) $ga_event_data_gaeventlabel, (object) $form, (object) $entry ); 

Filter the event label dynamically

Parameters (3)

0. $ga_event_data_gaeventlabel (string)
The ga event data gaeventlabel.
1. $form (object)
Gravity Form form object
2. $entry (object)
Gravity Form Entry Object

Usage

To run the hook, copy the example below.
  1. $ga_event_data_gaeventlabel = apply_filters( 'gform_event_label', $ga_event_data_gaeventlabel, $form, $entry ); 
  2.  
  3. if ( !empty( $ga_event_data_gaeventlabel ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the gform_event_label callback 
  2. function filter_gform_event_label( $ga_event_data_gaeventlabel, $form, $entry ) { 
  3. // make filter magic happen here... 
  4. return $ga_event_data_gaeventlabel
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'gform_event_label', 'filter_gform_event_label', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'gform_event_label', 'filter_gform_event_label', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/class-gravity-forms-event-tracking-feed.php  
  1. $event->setEventLabel( apply_filters( 'gform_event_label', $ga_event_data['gaEventLabel'], $form, $entry ) );