Event Tracking for Gravity Forms - Version 2.4.11

Version Description

  • Released 2022-01-28
  • WordPress 5.9 testing/compatibility
  • Testing with Gravity Forms 2.6 beta
  • Add option to disable beta banner under Advanced settings.
Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 Event Tracking for Gravity Forms
Version 2.4.11
Comparing to
See all releases

Code changes from version 2.4.10 to 2.4.11

README.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: ronalfy, bigwing, nmarks, kzeni
3
  Tags: gravity forms, google analytics, google tag manager, matomo, piwik, event tracking
4
  Requires at least: 5.5
5
- Tested up to: 5.8
6
- Stable tag: 2.4.10
7
  Requires PHP: 5.6
8
  Donate link: https://github.com/mediaron
9
  License: GPLv2 or later
@@ -13,6 +13,8 @@ Easily add event tracking using Gravity Forms and your Google Analytics or Googl
13
 
14
  == Description ==
15
 
 
 
16
  This plugin provides an easy way to add event tracking to your Gravity Forms using Google Analytics and Google Tag Manager.
17
 
18
  This plugin support Google Analytics 3 and <a href="https://mediaron.com/event-tracking-with-gravity-forms-and-google-analytics-4/">Google Analytics 4</a>.
@@ -48,6 +50,12 @@ Development happens on <a href="https://github.com/ronalfy/wordpress-gravity-for
48
 
49
  > Please <a href="https://wordpress.org/support/plugin/gravity-forms-google-analytics-event-tracking/reviews/#new-post">Rate the Plugin</a> or <a href="https://mediaron.com/give/">Give Back</a> to show support.
50
 
 
 
 
 
 
 
51
  == Installation ==
52
 
53
  = Minimum Requirements =
@@ -133,7 +141,13 @@ Check out the documentation on [github](https://github.com/ronalfy/wordpress-gra
133
 
134
  == Changelog ==
135
 
136
- = 2.4.10
 
 
 
 
 
 
137
  * Released 2021-08-23
138
  * Fixing a bug caused another. Fixing GTM not sending any events.
139
 
@@ -345,5 +359,5 @@ Check out the documentation on [github](https://github.com/ronalfy/wordpress-gra
345
 
346
  == Upgrade Notice ==
347
 
348
- = 2.4.10 =
349
- Fixing a bug caused another. Fixing GTM not sending any events.
2
  Contributors: ronalfy, bigwing, nmarks, kzeni
3
  Tags: gravity forms, google analytics, google tag manager, matomo, piwik, event tracking
4
  Requires at least: 5.5
5
+ Tested up to: 6.0
6
+ Stable tag: 2.4.11
7
  Requires PHP: 5.6
8
  Donate link: https://github.com/mediaron
9
  License: GPLv2 or later
13
 
14
  == Description ==
15
 
16
+ > Gravity Forms is launching their own <a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta/">official Google Analytics plugin</a>. It will be the successor to this plugin. <a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta/">Join the official beta.</a>
17
+
18
  This plugin provides an easy way to add event tracking to your Gravity Forms using Google Analytics and Google Tag Manager.
19
 
20
  This plugin support Google Analytics 3 and <a href="https://mediaron.com/event-tracking-with-gravity-forms-and-google-analytics-4/">Google Analytics 4</a>.
50
 
51
  > Please <a href="https://wordpress.org/support/plugin/gravity-forms-google-analytics-event-tracking/reviews/#new-post">Rate the Plugin</a> or <a href="https://mediaron.com/give/">Give Back</a> to show support.
52
 
53
+ <h2>Join the Gravity Forms Google Analytics Beta</h2>
54
+
55
+ The official Gravity Forms add-on is coming and will be the successor to this plugin.
56
+
57
+ Find out more details about the <a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta/">Gravity Forms Google Analytics Beta</a>.
58
+
59
  == Installation ==
60
 
61
  = Minimum Requirements =
141
 
142
  == Changelog ==
143
 
144
+ = 2.4.11 =
145
+ * Released 2022-01-28
146
+ * WordPress 5.9 testing/compatibility
147
+ * Testing with Gravity Forms 2.6 beta
148
+ * Add option to disable beta banner under Advanced settings.
149
+
150
+ = 2.4.10 =
151
  * Released 2021-08-23
152
  * Fixing a bug caused another. Fixing GTM not sending any events.
153
 
359
 
360
  == Upgrade Notice ==
361
 
362
+ = 2.4.11 =
363
+ Tested with WP 5.9, Gravity Forms 2.6. <a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta/">Try out the official Google Analytics beta from Gravity Forms</a>.
gravity-forms-event-tracking.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Gravity Forms Event Tracking
4
  * Plugin URI: https://wordpress.org/plugins/gravity-forms-google-analytics-event-tracking/
5
  * Description: Add event tracking to your Gravity Forms with ease using Google Analytics, Tag Manager, or Matomo
6
- * Version: 2.4.10
7
  * Author: Ronald Huereca
8
  * Author URI: https://mediaron.com
9
  * Text Domain: gravity-forms-google-analytics-event-tracking
@@ -19,7 +19,7 @@ if ( ! defined( 'WPINC' ) ) {
19
  }
20
 
21
  define( 'GFGAET_MIN_GFORMS_VERSION', '2.2.0' );
22
- define( 'GFGAET_VERSION', '2.4.10' );
23
  define( 'GFGAET_FILE', __FILE__ );
24
 
25
  class GFGAET {
3
  * Plugin Name: Gravity Forms Event Tracking
4
  * Plugin URI: https://wordpress.org/plugins/gravity-forms-google-analytics-event-tracking/
5
  * Description: Add event tracking to your Gravity Forms with ease using Google Analytics, Tag Manager, or Matomo
6
+ * Version: 2.4.11
7
  * Author: Ronald Huereca
8
  * Author URI: https://mediaron.com
9
  * Text Domain: gravity-forms-google-analytics-event-tracking
19
  }
20
 
21
  define( 'GFGAET_MIN_GFORMS_VERSION', '2.2.0' );
22
+ define( 'GFGAET_VERSION', '2.4.11' );
23
  define( 'GFGAET_FILE', __FILE__ );
24
 
25
  class GFGAET {
img/gf-blog-addon.jpg ADDED
Binary file
img/gravity-forms-logo-horizontal.png ADDED
Binary file
img/gravity-forms-logo-horizontal.svg ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 24.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 3384.1 435.1" style="enable-background:new 0 0 3384.1 435.1;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#414141;}
7
+ .st1{fill:#F15A2B;}
8
+ .st2{fill:#FFFFFF;}
9
+ .st3{fill:#828383;}
10
+ </style>
11
+ <g>
12
+ <g>
13
+ <path class="st0" d="M647.4,92.9c48.1,0,96.2,23,110,78.8h-50.9c-12.1-23.3-31.5-32.5-59.2-32.5c-45.3,0-70.9,33.9-70.9,76.7
14
+ c0,45.6,27.7,76.4,70.9,76.4c33.2,0,57.4-9.9,67.8-45.9h-66.1v-43.2h113.5c1.4,23,0.7,45.2-7.3,67.1
15
+ c-18.3,48.3-61.6,68.5-107.9,68.5c-64,0-123.5-43.5-123.5-123S583.7,92.9,647.4,92.9z"/>
16
+ <path class="st0" d="M1021.7,328.2v7.2h-55.3l-49.8-79.1h-43.3v79.1h-51.9V95.6c34.6,0,68.8-0.3,103.4,0
17
+ c55.3,0,85.4,39.7,85.4,82.2c0,30.5-15.6,57.2-43.2,70.6L1021.7,328.2z M924.5,214.1c21.8,0,36-16.8,35.6-37.3
18
+ c0-20.2-13.5-36.3-35.6-36.3h-51.9v73.7H924.5z"/>
19
+ <path class="st0" d="M1132.2,296l-18.7,39.7h-54v-6.9l111.4-235h23.9l110.7,235v6.9h-53.6l-19-39.7H1132.2z M1149.2,252.9h67.1
20
+ l-33.6-79.1L1149.2,252.9z"/>
21
+ <path class="st0" d="M1409.1,231.3l25.6-58.7l32.5-76.7h55v7.5l-103.1,232h-21.5l-104.1-232v-7.5h55l32.5,76.3l27,59.1H1409.1z"/>
22
+ <path class="st0" d="M1571.4,335.8V95.3h51.9v240.5H1571.4z"/>
23
+ <path class="st0" d="M1672.7,140.5V95.9h203.8v44.5h-76.6v195.3h-50.2V140.5H1672.7z"/>
24
+ <path class="st0" d="M2018.1,192.9l23.9-47.6l29.1-49.3h55v7.5l-83,136.4v95.9h-51.9v-95.9l-83.4-136.4v-7.5h55.7l30.1,51
25
+ l22.8,45.9H2018.1z"/>
26
+ </g>
27
+ <g>
28
+ <path class="st1" d="M395.3,293.4c0.1,19.8-13.7,44.3-30.9,54.3l-134.1,78.7c-17.1,10-45.2,10.2-62.4,0.4L32.7,350
29
+ c-17.2-9.8-31.5-34-31.6-53.9L0,140.6c-0.1-19.8,13.7-44.3,30.8-54.3L165,7.6c17.1-10,45.2-10.2,62.4-0.4L362.6,84
30
+ c17.2,9.8,31.5,34,31.6,53.9L395.3,293.4L395.3,293.4z"/>
31
+ <path class="st2" d="M159.7,181h177.6v-50.2H160.1c-25.3,0-46.3,8.7-62.4,25.9C59.1,198.1,58,302.3,58,302.3h277.9V208H286v44.1
32
+ H111.3c1.1-16.4,8.6-45.8,22.8-61C140.5,184.2,148.7,181,159.7,181L159.7,181z"/>
33
+ </g>
34
+ <g>
35
+ <path class="st3" d="M2299.2,123.2v85.7h104v21.9h-104v102.9h-23.5V101.3h132.5v21.9H2299.2z"/>
36
+ <path class="st3" d="M2445.1,217.5c0-66.4,53-120.2,121.4-120.2s121.4,53.8,121.4,120.2c0,66.4-53,120.2-121.4,120.2
37
+ S2445.1,283.9,2445.1,217.5z M2664.4,217.5c0-54.1-42.3-97.6-97.9-97.6s-97.9,43.5-97.9,97.6c0,54.1,42.3,97.6,97.9,97.6
38
+ S2664.4,271.6,2664.4,217.5z"/>
39
+ <path class="st3" d="M2827.4,240.7h-65.7v93h-23.5V101.3h93.9c38.9,0,70.4,31.2,70.4,69.7c0,31.5-21.5,58.4-50.6,66.7l57.3,96
40
+ h-26.8L2827.4,240.7z M2761.6,218.8h70.4c25.8,0,46.9-21.6,46.9-47.8c0-26.6-21.1-47.8-46.9-47.8h-70.4V218.8z"/>
41
+ <path class="st3" d="M3167.4,333.7h-23.5V136.5l-82.2,136.2h-3.4l-82.2-136.2v197.3h-23.5V101.3h29.2l78.1,129.5l78.1-129.5h29.2
42
+ V333.7z"/>
43
+ <path class="st3" d="M3214.4,280.9l20.1-11.6c8.4,27.9,30.5,45.8,67.4,45.8c35.5,0,55.3-16.9,55.3-41.8
44
+ c0-26.9-23.1-35.5-57.7-46.8c-38.2-12.6-75.1-22.6-75.1-65.4c0-40.8,33.2-63.8,72.1-63.8c38.6,0,65.4,22.6,77.5,50.1l-19.8,11
45
+ c-8.7-20.9-26.8-38.5-57.7-38.5c-28.2,0-48.6,14.6-48.6,40.2c0,25.2,20.1,33.2,52,43.5c42.6,13.9,80.8,25.9,80.8,69.1
46
+ c0,39.8-32.2,65.1-79.1,65.1C3258.3,337.7,3226.4,316.1,3214.4,280.9z"/>
47
+ </g>
48
+ </g>
49
+ </svg>
includes/GFGAET_Submission_Feeds.php CHANGED
@@ -97,7 +97,10 @@ class GFGAET_Submission_Feeds extends GFFeedAddOn {
97
  $links[] = $options_link;
98
  }
99
  $docs_link = sprintf( '<a href="%s" target="_blank">%s</a>', esc_url( 'https://mediaron.com/event-tracking-for-gravity-forms/?utm_source=wordpress_plugins_page&utm_medium=documentation&utm_campaign=event_tracking' ), _x( 'Documentation', 'Gravity Forms Event Tracking Documentation page', 'gravity-forms-google-analytics-event-tracking' ) );
 
 
100
  $links[] = $docs_link;
 
101
 
102
  return $links;
103
  }
@@ -1113,10 +1116,17 @@ gtag('config', '<?php echo esc_js( $ga_code ); ?>');
1113
  */
1114
  public function feed_settings_fields() {
1115
  $ga_id_placeholder = $this->get_ga_id();
 
 
 
 
 
 
1116
  return array(
1117
  array(
1118
  'title' => __( 'Feed Settings', 'gravity-forms-google-analytics-event-tracking' ),
1119
  'fields' => array(
 
1120
  array(
1121
  'label' => __( 'Feed Name', 'gravity-forms-google-analytics-event-tracking' ),
1122
  'type' => 'text',
@@ -1187,6 +1197,19 @@ gtag('config', '<?php echo esc_js( $ga_code ); ?>');
1187
  );
1188
  }
1189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1190
  /**
1191
  * Instruction field
1192
  *
97
  $links[] = $options_link;
98
  }
99
  $docs_link = sprintf( '<a href="%s" target="_blank">%s</a>', esc_url( 'https://mediaron.com/event-tracking-for-gravity-forms/?utm_source=wordpress_plugins_page&utm_medium=documentation&utm_campaign=event_tracking' ), _x( 'Documentation', 'Gravity Forms Event Tracking Documentation page', 'gravity-forms-google-analytics-event-tracking' ) );
100
+
101
+ $beta_link = sprintf( '<a href="%s" target="_blank" style="color: green; font-weight: 700;">%s</a>', esc_url( 'https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta/' ), _x( 'Join the Beta!', 'Gravity Forms Google Analytics Page', 'gravity-forms-google-analytics-event-tracking' ) );
102
  $links[] = $docs_link;
103
+ $links[] = $beta_link;
104
 
105
  return $links;
106
  }
1116
  */
1117
  public function feed_settings_fields() {
1118
  $ga_id_placeholder = $this->get_ga_id();
1119
+ $ua_options = get_option( 'gravityformsaddon_GFGAET_UA_settings', array() );
1120
+ $beta_notification = rgar( $ua_options, 'beta_notification');
1121
+ $beta_field = array(
1122
+ 'name' => 'gravityforms_ga',
1123
+ 'type' => $beta_notification === 'on' || rgblank( $beta_notification ) ? 'gforms_beta_cta' : 'hidden',
1124
+ );
1125
  return array(
1126
  array(
1127
  'title' => __( 'Feed Settings', 'gravity-forms-google-analytics-event-tracking' ),
1128
  'fields' => array(
1129
+ $beta_field,
1130
  array(
1131
  'label' => __( 'Feed Name', 'gravity-forms-google-analytics-event-tracking' ),
1132
  'type' => 'text',
1197
  );
1198
  }
1199
 
1200
+ public function settings_gforms_beta_cta() {
1201
+ ob_start();
1202
+ ?>
1203
+
1204
+ <div class="alert info">
1205
+ <div style="padding-top: 25px; padding-bottom: 25px"><a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta" target="_blank"><img src="<?php echo esc_url( GFGAET::get_plugin_url( '/img/gravity-forms-logo-horizontal.svg' ) ); ?>" width="800" height="103" /></a></div>
1206
+ <h3 style="font-size: 18px; line-height: 1.2; font-weight: 400">The team behind Gravity Forms is releasing their own Google Analytics plugin soon. Currently it is in beta and you are invited to try it out. It should make things so much easier.</h3>
1207
+ <p><a class="button primary" href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta" target="_blank">Check out the Beta Today</a>
1208
+ </div>
1209
+ <?php
1210
+ echo wp_kses_post( ob_get_clean() );
1211
+ }
1212
+
1213
  /**
1214
  * Instruction field
1215
  *
includes/GFGAET_UA.php CHANGED
@@ -44,6 +44,19 @@ class GFGAET_UA extends GFAddOn {
44
 
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Settings icon for Form settings.
49
  *
@@ -64,6 +77,16 @@ class GFGAET_UA extends GFAddOn {
64
  'title' => __( 'Google Analytics and Google Tag Manager', 'gravity-forms-google-analytics-event-tracking' ),
65
  'description' => '<p>' . __( 'By default, events are sent using the measurement protocol. You can change to using pure Google Analytics and Google Tag Manager if your forms are Ajax only.', 'gravity-forms-google-analytics-event-tracking' ) . '</p><p>' . __( 'Need help? <a target="_blank" href="https://mediaron.com/event-tracking-for-gravity-forms/?utm_source=wordpress_admin&utm_medium=documentation&utm_campaign=event_tracking">See our guide</a>.</p>', 'gravity-forms-google-analytics-event-tracking' ),
66
  'fields' => array(
 
 
 
 
 
 
 
 
 
 
67
  array(
68
  'type' => 'radio',
69
  'name' => 'mode',
@@ -363,6 +386,27 @@ class GFGAET_UA extends GFAddOn {
363
  ),
364
  ),
365
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  ),
367
  ),
368
 
44
 
45
  }
46
 
47
+ public function settings_gforms_beta_cta() {
48
+ ob_start();
49
+ ?>
50
+
51
+ <div class="alert info">
52
+ <div style="padding-top: 25px; padding-bottom: 25px"><a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta" target="_blank"><img src="<?php echo esc_url( GFGAET::get_plugin_url( '/img/gravity-forms-logo-horizontal.svg' ) ); ?>" width="800" height="103" /></a></div>
53
+ <h3 style="font-size: 18px; line-height: 1.2; font-weight: 400">The team behind Gravity Forms is releasing their own Google Analytics plugin soon. Currently it is in beta and you are invited to try it out. It should make things so much easier.</h3>
54
+ <p><a class="button primary" href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta" target="_blank">Check out the Beta Today</a>
55
+ </div>
56
+ <?php
57
+ echo wp_kses_post( ob_get_clean() );
58
+ }
59
+
60
  /**
61
  * Settings icon for Form settings.
62
  *
77
  'title' => __( 'Google Analytics and Google Tag Manager', 'gravity-forms-google-analytics-event-tracking' ),
78
  'description' => '<p>' . __( 'By default, events are sent using the measurement protocol. You can change to using pure Google Analytics and Google Tag Manager if your forms are Ajax only.', 'gravity-forms-google-analytics-event-tracking' ) . '</p><p>' . __( 'Need help? <a target="_blank" href="https://mediaron.com/event-tracking-for-gravity-forms/?utm_source=wordpress_admin&utm_medium=documentation&utm_campaign=event_tracking">See our guide</a>.</p>', 'gravity-forms-google-analytics-event-tracking' ),
79
  'fields' => array(
80
+ array(
81
+ 'name' => 'gravityforms_ga',
82
+ 'type' => 'gforms_beta_cta',
83
+ 'dependency' => array(
84
+ 'field' => 'beta_notification',
85
+ 'values' => array(
86
+ 'on',
87
+ ),
88
+ ),
89
+ ),
90
  array(
91
  'type' => 'radio',
92
  'name' => 'mode',
386
  ),
387
  ),
388
  ),
389
+ array(
390
+ 'type' => 'radio',
391
+ 'name' => 'beta_notification',
392
+ 'horizontal' => false,
393
+ 'default_value' => 'on',
394
+ 'label' => 'Beta Banner.',
395
+ 'choices' => array(
396
+ array(
397
+ 'name' => 'beta_notifications_on',
398
+ 'label' => esc_html__( 'Turn On', 'gravity-forms-google-analytics-event-tracking' ),
399
+ 'value' => 'on',
400
+ 'tooltip' => 'If you would like to join the beta, <a href="https://www.gravityforms.com/blog/google-analytics-add-on-install-the-beta" target="blank">please click here</a>.',
401
+ ),
402
+ array(
403
+ 'name' => 'beta_notifications_off',
404
+ 'label' => esc_html__( 'Turn Off', 'gravity-forms-google-analytics-event-tracking' ),
405
+ 'value' => 'off',
406
+ 'tooltip' => esc_html__( 'Turn off the beta notifications banner.', 'gravity-forms-google-analytics-event-tracking' ),
407
+ ),
408
+ ),
409
+ ),
410
  ),
411
  ),
412