Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more - Version 1.5.5

Version Description

  • Tweak: Made the conversion ID and label validation code more robust
Download this release

Release Info

Developer alekv
Plugin Icon 128x128 Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more
Version 1.5.5
Comparing to
See all releases

Code changes from version 1.4.17 to 1.5.5

Files changed (2) hide show
  1. readme.txt +12 -2
  2. wgact.php +16 -17
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: alekv
3
  Donate link: http://www.wolfundbaer.ch/donations/
4
  Tags: woocommerce, woocommerce conversion tracking, google adwords, adwords, conversion, conversion value, conversion tag, conversion pixel, conversion value tracking, conversion tracking, conversion tracking adwords, conversion tracking pixel, conversion tracking script, track conversions, tracking code manager, google ads
5
  Requires at least: 3.7
6
- Tested up to: 5.1
7
- Stable tag: 1.4.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -64,6 +64,16 @@ You can send the link to the front page of your shop too if you think it would b
64
  1. Settings page
65
 
66
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
67
  = 1.4.17 =
68
  * Info: Tested up to WP 5.1
69
  = 1.4.16 =
3
  Donate link: http://www.wolfundbaer.ch/donations/
4
  Tags: woocommerce, woocommerce conversion tracking, google adwords, adwords, conversion, conversion value, conversion tag, conversion pixel, conversion value tracking, conversion tracking, conversion tracking adwords, conversion tracking pixel, conversion tracking script, track conversions, tracking code manager, google ads
5
  Requires at least: 3.7
6
+ Tested up to: 5.2
7
+ Stable tag: 1.5.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
64
  1. Settings page
65
 
66
  == Changelog ==
67
+ = 1.5.5 =
68
+ * Tweak: Made the conversion ID and label validation code more robust
69
+ = 1.5.4 =
70
+ * Tweak: Updated function that inserts the settings link on the plugins overview page
71
+ = 1.5.3 =
72
+ * Info: Tested up to WP 5.2
73
+ = 1.5.2 =
74
+ * Fix: Correctly calculate the value when no filter is active
75
+ = 1.5.1 =
76
+ * Tweak: Re-enabled order value filter
77
  = 1.4.17 =
78
  * Info: Tested up to WP 5.1
79
  = 1.4.16 =
wgact.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Google Ads Conversion Tracking
4
- * Plugin URI: https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-tag/
5
  * Description: Google Ads dynamic conversion value tracking for WooCommerce.
6
  * Author: Wolf+Bär Agency
 
7
  * Author URI: https://wolfundbaer.ch
8
- * Version: 1.4.17
9
  * License: GPLv2 or later
10
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
11
- * WC requires at least: 2.6.0
12
- * WC tested up to: 3.5.4
13
  **/
14
 
15
  // TODO Try to use jQuery validation in the form.
@@ -59,7 +59,7 @@ class WGACT {
59
  add_action( 'admin_init', array( $this, 'wgact_plugin_admin_init' ) );
60
 
61
  // add a settings link on the plugins page
62
- add_filter( 'plugin_action_links', array( $this, 'wgact_settings_link' ), 10, 2 );
63
 
64
  // Load textdomain
65
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
@@ -233,13 +233,14 @@ class WGACT {
233
  load_plugin_textdomain( 'woocommerce-google-adwords-conversion-tracking-tag', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
234
  }
235
 
236
- // adds a link on the plugins page for the wgact settings
237
- function wgact_settings_link( $links, $file ) {
238
- if ( $file == plugin_basename( __FILE__ ) ) {
239
- $links[] = '<a href="' . admin_url( "admin.php?page=wgact" ) . '">' . __( 'Settings' ) . '</a>';
240
- }
241
 
242
- return $links;
 
 
 
 
 
 
243
  }
244
 
245
  // add the admin options page
@@ -379,7 +380,7 @@ class WGACT {
379
  function wgact_plugin_options_validate( $input ) {
380
 
381
  // Create our array for storing the validated options
382
- $output = array();
383
 
384
  // validate and sanitize conversion_id
385
 
@@ -396,8 +397,6 @@ class WGACT {
396
 
397
  $output['conversion_label'] = wp_strip_all_tags( str_ireplace( $needles_cl, $replacements_cl, $input['conversion_label'] ) );
398
 
399
- $output['order_total_logic'] = $input['order_total_logic'];
400
-
401
  // Return the array processing any additional functions filtered by this action
402
  // return apply_filters( 'sandbox_theme_validate_input_examples', $output, $input );
403
  return $output;
@@ -451,8 +450,8 @@ class WGACT {
451
  $order_currency = $this->woocommerce_3_and_above() ? $order->get_currency() : $order->get_order_currency();
452
 
453
 
454
- // the filter is deprecated
455
- // $order_total_filtered = apply_filters( 'wgact_conversion_value_filter', $order_total, $order );
456
 
457
 
458
  ?>
@@ -471,7 +470,7 @@ class WGACT {
471
  <script>
472
  gtag('event', 'conversion', {
473
  'send_to': 'AW-<?php echo esc_html( $conversion_id ) ?>/<?php echo esc_html( $conversion_label ) ?>',
474
- 'value': <?php echo $order_total; ?>,
475
  'currency': <?php echo json_encode( $order_currency ); ?>,
476
  'transaction_id': '<?php echo $order->get_order_number(); ?>',
477
  });
1
  <?php
2
  /**
3
  * Plugin Name: WooCommerce Google Ads Conversion Tracking
 
4
  * Description: Google Ads dynamic conversion value tracking for WooCommerce.
5
  * Author: Wolf+Bär Agency
6
+ * Plugin URI: https://wordpress.org/plugins/woocommerce-google-adwords-conversion-tracking-tag/
7
  * Author URI: https://wolfundbaer.ch
8
+ * Version: 1.5.5
9
  * License: GPLv2 or later
10
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
11
+ * WC requires at least: 2.6
12
+ * WC tested up to: 3.7
13
  **/
14
 
15
  // TODO Try to use jQuery validation in the form.
59
  add_action( 'admin_init', array( $this, 'wgact_plugin_admin_init' ) );
60
 
61
  // add a settings link on the plugins page
62
+ add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'wgact_settings_link' ) );
63
 
64
  // Load textdomain
65
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
233
  load_plugin_textdomain( 'woocommerce-google-adwords-conversion-tracking-tag', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
234
  }
235
 
 
 
 
 
 
236
 
237
+ // adds a link on the plugins page for the wgdr settings
238
+ function wgact_settings_link( $links ) {
239
+
240
+ $mylinks = array(
241
+ '<a href="' . admin_url( 'admin.php?page=wgact' ) . '">Settings</a>',
242
+ );
243
+ return array_merge( $links, $mylinks );
244
  }
245
 
246
  // add the admin options page
380
  function wgact_plugin_options_validate( $input ) {
381
 
382
  // Create our array for storing the validated options
383
+ $output = $input;
384
 
385
  // validate and sanitize conversion_id
386
 
397
 
398
  $output['conversion_label'] = wp_strip_all_tags( str_ireplace( $needles_cl, $replacements_cl, $input['conversion_label'] ) );
399
 
 
 
400
  // Return the array processing any additional functions filtered by this action
401
  // return apply_filters( 'sandbox_theme_validate_input_examples', $output, $input );
402
  return $output;
450
  $order_currency = $this->woocommerce_3_and_above() ? $order->get_currency() : $order->get_order_currency();
451
 
452
 
453
+ // filter to adjust the order value
454
+ $order_total_filtered = apply_filters( 'wgact_conversion_value_filter', $order_total, $order );
455
 
456
 
457
  ?>
470
  <script>
471
  gtag('event', 'conversion', {
472
  'send_to': 'AW-<?php echo esc_html( $conversion_id ) ?>/<?php echo esc_html( $conversion_label ) ?>',
473
+ 'value': <?php echo $order_total_filtered; ?>,
474
  'currency': <?php echo json_encode( $order_currency ); ?>,
475
  'transaction_id': '<?php echo $order->get_order_number(); ?>',
476
  });