WooCommerce Google Analytics Integration - Version 1.4.8

Version Description

  • 2019-03-04 =
  • Fix - Event for deleting from cart not sent after a cart update.
Download this release

Release Info

Developer royho
Plugin Icon 128x128 WooCommerce Google Analytics Integration
Version 1.4.8
Comparing to
See all releases

Code changes from version 1.4.7 to 1.4.8

Gruntfile.js DELETED
@@ -1,166 +0,0 @@
1
- /*jshint node:true */
2
- module.exports = function( grunt ) {
3
- 'use strict';
4
-
5
- grunt.initConfig({
6
-
7
- // Gets the package vars
8
- pkg: grunt.file.readJSON( 'package.json' ),
9
-
10
- // Setting folder templates
11
- dirs: {
12
- css: 'assets/css',
13
- fonts: 'assets/fonts',
14
- images: 'assets/images',
15
- js: 'assets/js'
16
- },
17
-
18
- // Minify all .css files.
19
- cssmin: {
20
- minify: {
21
- expand: true,
22
- cwd: '<%= dirs.css %>/',
23
- src: ['*.css'],
24
- dest: '<%= dirs.css %>/',
25
- ext: '.css'
26
- }
27
- },
28
-
29
- // Minify .js files.
30
- uglify: {
31
- options: {
32
- preserveComments: 'some'
33
- },
34
- jsfiles: {
35
- files: [{
36
- expand: true,
37
- cwd: '<%= dirs.js %>/',
38
- src: [
39
- '*.js',
40
- '!*.min.js',
41
- '!Gruntfile.js',
42
- ],
43
- dest: '<%= dirs.js %>/',
44
- ext: '.min.js'
45
- }]
46
- }
47
- },
48
-
49
- // Watch changes for assets
50
- watch: {
51
- less: {
52
- files: ['<%= dirs.css %>/*.less'],
53
- tasks: ['less', 'cssmin'],
54
- },
55
- js: {
56
- files: [
57
- '<%= dirs.js %>/*js',
58
- '!<%= dirs.js %>/*.min.js'
59
- ],
60
- tasks: ['uglify']
61
- }
62
- },
63
-
64
- // Shell scripts
65
- shell: {
66
- options: {
67
- stdout: true,
68
- stderr: true
69
- },
70
- txpull: {
71
- command: [
72
- 'tx pull -a -f', // Transifex download .po files
73
- ].join( '&&' )
74
- },
75
- txpush: {
76
- command: [
77
- 'tx push -s' // Transifex - send .pot file
78
- ].join( '&&' )
79
- }
80
- },
81
-
82
- // Generate POT files.
83
- makepot: {
84
- options: {
85
- type: 'wp-plugin',
86
- domainPath: 'languages',
87
- potHeaders: {
88
- 'report-msgid-bugs-to': 'https://github.com/woocommerce/woocommerce-google-analytics-integration/issues',
89
- 'language-team': 'LANGUAGE <EMAIL@ADDRESS>'
90
- }
91
- },
92
- dist: {
93
- options: {
94
- potFilename: 'woocommerce-google-analytics-integration.pot',
95
- exclude: [
96
- 'apigen/.*',
97
- 'tests/.*',
98
- 'tmp/.*'
99
- ]
100
- }
101
- }
102
- },
103
-
104
- // Check textdomain errors.
105
- checktextdomain: {
106
- options:{
107
- text_domain: 'woocommerce-google-analytics-integration',
108
- keywords: [
109
- '__:1,2d',
110
- '_e:1,2d',
111
- '_x:1,2c,3d',
112
- 'esc_html__:1,2d',
113
- 'esc_html_e:1,2d',
114
- 'esc_html_x:1,2c,3d',
115
- 'esc_attr__:1,2d',
116
- 'esc_attr_e:1,2d',
117
- 'esc_attr_x:1,2c,3d',
118
- '_ex:1,2c,3d',
119
- '_n:1,2,4d',
120
- '_nx:1,2,4c,5d',
121
- '_n_noop:1,2,3d',
122
- '_nx_noop:1,2,3c,4d'
123
- ]
124
- },
125
- files: {
126
- src: [
127
- '**/*.php', // Include all files
128
- '!apigen/**', // Exclude apigen/
129
- '!node_modules/**', // Exclude node_modules/
130
- '!tests/**', // Exclude tests/
131
- '!vendor/**', // Exclude vendor/
132
- '!tmp/**' // Exclude tmp/
133
- ],
134
- expand: true
135
- }
136
- },
137
- });
138
-
139
- // Load NPM tasks to be used here
140
- grunt.loadNpmTasks( 'grunt-shell' );
141
- grunt.loadNpmTasks( 'grunt-phpcs' );
142
- grunt.loadNpmTasks( 'grunt-rtlcss' );
143
- grunt.loadNpmTasks( 'grunt-postcss' );
144
- grunt.loadNpmTasks( 'grunt-wp-i18n' );
145
- grunt.loadNpmTasks( 'grunt-checktextdomain' );
146
- grunt.loadNpmTasks( 'grunt-contrib-uglify' );
147
- grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
148
- grunt.loadNpmTasks( 'grunt-contrib-concat' );
149
- grunt.loadNpmTasks( 'grunt-contrib-watch' );
150
- grunt.loadNpmTasks( 'grunt-contrib-clean' );
151
-
152
- // Register tasks
153
- grunt.registerTask( 'default', [
154
- 'js',
155
- 'i18n'
156
- ]);
157
-
158
- grunt.registerTask( 'js', [
159
- 'uglify'
160
- ]);
161
-
162
- grunt.registerTask( 'i18n', [
163
- 'checktextdomain',
164
- 'makepot'
165
- ]);
166
- };
changelog.txt ADDED
@@ -0,0 +1,79 @@
1
+ *** Changelog ***
2
+
3
+ = 1.4.8 - 2019-03-04 =
4
+ * Fix - Event for deleting from cart not sent after a cart update.
5
+
6
+ = 1.4.7 - 11/19/2018 =
7
+ * Tweak - WP 5.0 compatibility.
8
+
9
+ = 1.4.6 - 11/06/2018 =
10
+ * Fix - Check for active WooCommerce plugin.
11
+
12
+ = 1.4.5 - 10/16/2018 =
13
+ * Tweak - Mention Google Analytics Pro in certain cases.
14
+ * Tweak - WC 3.5 compatibility.
15
+
16
+ = 1.4.4 - 03/20/2018 =
17
+ * Fix - WC30 compatibility error when using deprecated get_product_from_item method.
18
+ * Fix - Check object before using methods to prevent errors.
19
+ * Fix - Variations not reporting category in cart tracking.
20
+ * Add - Filter woocommerce_ga_disable_tracking added to disable tracking.
21
+ * Tweak - Rebuilt languages pot file.
22
+
23
+ = 1.4.3 - 06/15/2018 =
24
+ * Fix - WC 3.x notice by using proper variation data.
25
+ * Add - Option to track 404 (Not found) errors.
26
+
27
+ = 1.4.2 - 09/05/2017 =
28
+ * Fix - Missing Google Analytics ID.
29
+
30
+ = 1.4.1 - 01/05/2017 =
31
+
32
+ * Add - Filters for GA snippet (woocommerce_ga_snippet_head, woocommerce_ga_snippet_create, woocommerce_ga_snippet_require, woocommerce_ga_snippet_output)
33
+ * Add - Option to toggle on/off Enhanced Link Attribution
34
+ * Fix - JavaScript break by wrapping it in quotes
35
+ * Fix - Use ID and SKU data in a consistent way so that all products are correctly tracked.
36
+ * Fix - Updates for WooCommerce 3.0 compatibility.
37
+ * Add - Settings link to the plugin in the Plugins screen
38
+ * Fix - Fatal error on shortcode usage for empty product
39
+
40
+ = 1.4.0 - 20/11/2015 =
41
+
42
+ * Feature - Support for enhanced eCommerce (tracking full store process from view to order)
43
+ * Tweak - Setting up the plugin is now clearer with some helpful links and clearer language
44
+ * Tweak - New filter on the ga global variable
45
+ * Refactor - JavaScript generation functions have been moved to their own class
46
+
47
+ = 1.3.0 - 12/11/2014 =
48
+
49
+ * Feature - Added the transaction currency in the tracking code
50
+ * Feature - Add data privacy option that are mandatory in some countries
51
+ * Tweak - Moved the tracking code to the head of the page
52
+ * Tweak - Remove the "SKU" prefix to the sku for addItem
53
+ * Refactor - Integration class reformulated
54
+
55
+ = 1.2.2 - 15/10/2014 =
56
+
57
+ * Feature - Adding option to anonymize IP addresses
58
+ * Feature - Adding gaOptOut function to be called from any page for OptOut
59
+
60
+ = 1.2.1 - 17/09/2014 =
61
+
62
+ * Tweak - Adding utmnooverride to return url for Google Adwords
63
+
64
+ = 1.2.0 - 28/07/2014 =
65
+
66
+ * Feature - Adding display advertising parameter to Universal Analytics
67
+ * Fix - Using get_total_shipping() instead of get_shipping
68
+ * Fix - Using wc_enqueue_js() instead of $woocommerce->add_inline_js(
69
+ * Tweak - Updating plugin FAQ
70
+ * Tweak - Adding parenthesis for clarity
71
+
72
+ = 1.1 - 29/05/2014 =
73
+
74
+ * Added option to enable Display Advertising
75
+ * Added compatibility support for WooCommerce 2.1 beta releases
76
+
77
+ = 1.0 - 22/11/2013 =
78
+
79
+ * Initial release
includes/class-wc-google-analytics-js.php CHANGED
@@ -155,26 +155,22 @@ class WC_Google_Analytics_JS {
155
$list = "Product List";
156
}
157
158
- echo( "
159
- <script>
160
- (function($) {
161
- $( '.products .post-" . esc_js( $product->get_id() ) . " a' ).click( function() {
162
- if ( true === $(this).hasClass( 'add_to_cart_button' ) ) {
163
- return;
164
- }
165
-
166
- " . self::tracker_var() . "( 'ec:addProduct', {
167
- 'id': '" . esc_js( $product->get_id() ) . "',
168
- 'name': '" . esc_js( $product->get_title() ) . "',
169
- 'category': " . self::product_get_category_line( $product ) . "
170
- 'position': '" . esc_js( $position ) . "'
171
- });
172
-
173
- " . self::tracker_var() . "( 'ec:setAction', 'click', { list: '" . esc_js( $list ) . "' });
174
- " . self::tracker_var() . "( 'send', 'event', 'UX', 'click', ' " . esc_js( $list ) . "' );
175
});
176
- })(jQuery);
177
- </script>
178
" );
179
}
180
@@ -244,7 +240,7 @@ class WC_Google_Analytics_JS {
244
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
245
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
246
})(window,document,'script','//www.google-analytics.com/analytics.js','" . self::tracker_var() . "');";
247
-
248
$ga_id = self::get( 'ga_id' );
249
$ga_snippet_create = self::tracker_var() . "( 'create', '" . esc_js( $ga_id ) . "', '" . $set_domain_name . "' );";
250
@@ -480,7 +476,7 @@ class WC_Google_Analytics_JS {
480
echo( "
481
<script>
482
(function($) {
483
- $( '.remove' ).click( function() {
484
" . self::tracker_var() . "( 'ec:addProduct', {
485
'id': ($(this).data('product_sku')) ? ($(this).data('product_sku')) : ('#' + $(this).data('product_id')),
486
'quantity': $(this).parent().parent().find( '.qty' ).val() ? $(this).parent().parent().find( '.qty' ).val() : '1',
155
$list = "Product List";
156
}
157
158
+ wc_enqueue_js( "
159
+ $( '.products .post-" . esc_js( $product->get_id() ) . " a' ).click( function() {
160
+ if ( true === $(this).hasClass( 'add_to_cart_button' ) ) {
161
+ return;
162
+ }
163
+
164
+ " . self::tracker_var() . "( 'ec:addProduct', {
165
+ 'id': '" . esc_js( $product->get_id() ) . "',
166
+ 'name': '" . esc_js( $product->get_title() ) . "',
167
+ 'category': " . self::product_get_category_line( $product ) . "
168
+ 'position': '" . esc_js( $position ) . "'
169
});
170
+
171
+ " . self::tracker_var() . "( 'ec:setAction', 'click', { list: '" . esc_js( $list ) . "' });
172
+ " . self::tracker_var() . "( 'send', 'event', 'UX', 'click', ' " . esc_js( $list ) . "' );
173
+ });
174
" );
175
}
176
240
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
241
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
242
})(window,document,'script','//www.google-analytics.com/analytics.js','" . self::tracker_var() . "');";
243
+
244
$ga_id = self::get( 'ga_id' );
245
$ga_snippet_create = self::tracker_var() . "( 'create', '" . esc_js( $ga_id ) . "', '" . $set_domain_name . "' );";
246
476
echo( "
477
<script>
478
(function($) {
479
+ $( document.body ).on( 'click', '.remove', function() {
480
" . self::tracker_var() . "( 'ec:addProduct', {
481
'id': ($(this).data('product_sku')) ? ($(this).data('product_sku')) : ('#' + $(this).data('product_id')),
482
'quantity': $(this).parent().parent().find( '.qty' ).val() ? $(this).parent().parent().find( '.qty' ).val() : '1',
languages/woocommerce-google-analytics-integration.pot CHANGED
@@ -2,11 +2,11 @@
2
# This file is distributed under the GPLv2 or later.
3
msgid ""
4
msgstr ""
5
- "Project-Id-Version: WooCommerce Google Analytics Integration 1.4.5\n"
6
"Report-Msgid-Bugs-To: "
7
"https://github.com/woocommerce/woocommerce-google-analytics-integration/"
8
"issues\n"
9
- "POT-Creation-Date: 2018-10-25 21:12:02+00:00\n"
10
"MIME-Version: 1.0\n"
11
"Content-Type: text/plain; charset=utf-8\n"
12
"Content-Transfer-Encoding: 8bit\n"
@@ -212,15 +212,15 @@ msgstr ""
212
msgid "ID:"
213
msgstr ""
214
215
- #: woocommerce-google-analytics-integration.php:75
216
msgid "Settings"
217
msgstr ""
218
219
- #: woocommerce-google-analytics-integration.php:76
220
msgid "Support"
221
msgstr ""
222
223
- #: woocommerce-google-analytics-integration.php:114
224
msgid "WooCommerce Google Analytics depends on the last version of %s to work!"
225
msgstr ""
226
@@ -228,11 +228,11 @@ msgstr ""
228
msgid "WooCommerce"
229
msgstr ""
230
231
- #: woocommerce-google-analytics-integration.php:146
232
msgid "Get detailed insights into your sales with Google Analytics Pro"
233
msgstr ""
234
235
- #: woocommerce-google-analytics-integration.php:149
236
#. translators: 1: href link to GA pro
237
msgid ""
238
"Add advanced tracking for your sales funnel, coupons and more. [<a "
2
# This file is distributed under the GPLv2 or later.
3
msgid ""
4
msgstr ""
5
+ "Project-Id-Version: WooCommerce Google Analytics Integration 1.4.7\n"
6
"Report-Msgid-Bugs-To: "
7
"https://github.com/woocommerce/woocommerce-google-analytics-integration/"
8
"issues\n"
9
+ "POT-Creation-Date: 2018-12-11 19:54:58+00:00\n"
10
"MIME-Version: 1.0\n"
11
"Content-Type: text/plain; charset=utf-8\n"
12
"Content-Transfer-Encoding: 8bit\n"
212
msgid "ID:"
213
msgstr ""
214
215
+ #: woocommerce-google-analytics-integration.php:76
216
msgid "Settings"
217
msgstr ""
218
219
+ #: woocommerce-google-analytics-integration.php:77
220
msgid "Support"
221
msgstr ""
222
223
+ #: woocommerce-google-analytics-integration.php:115
224
msgid "WooCommerce Google Analytics depends on the last version of %s to work!"
225
msgstr ""
226
228
msgid "WooCommerce"
229
msgstr ""
230
231
+ #: woocommerce-google-analytics-integration.php:147
232
msgid "Get detailed insights into your sales with Google Analytics Pro"
233
msgstr ""
234
235
+ #: woocommerce-google-analytics-integration.php:150
236
#. translators: 1: href link to GA pro
237
msgid ""
238
"Add advanced tracking for your sales funnel, coupons and more. [<a "
package.json DELETED
@@ -1,40 +0,0 @@
1
- {
2
- "name": "woocommerce-google-analytics-integration",
3
- "title": "WooCommerce Google Analytics Integration",
4
- "version": "1.4.4",
5
- "license": "GPL-2.0",
6
- "homepage": "http://wordpress.org/plugins/woocommerce-google-analytics-integration/",
7
- "repository": {
8
- "type": "git",
9
- "url": "git://github.com/woocommerce/woocommerce-google-analytics-integration.git"
10
- },
11
- "main": "Gruntfile.js",
12
- "scripts": {
13
- "build": "grunt",
14
- "update-deps": "npm install -g rimraf && rimraf node_modules && rimraf npm-shrinkwrap.json && npm install && npm shrinkwrap --dev"
15
- },
16
- "devDependencies": {
17
- "config": "^1.24.0",
18
- "cross-env": "^3.0.0",
19
- "grunt": "~1.0.1",
20
- "grunt-checktextdomain": "~1.0.1",
21
- "grunt-contrib-clean": "~1.1.0",
22
- "grunt-contrib-concat": "~1.0.1",
23
- "grunt-contrib-cssmin": "~2.2.1",
24
- "grunt-contrib-uglify": "~3.1.0",
25
- "grunt-contrib-watch": "~1.0.0",
26
- "grunt-phpcs": "~0.4.0",
27
- "grunt-postcss": "~0.9.0",
28
- "grunt-rtlcss": "~2.0.1",
29
- "grunt-shell": "~2.1.0",
30
- "grunt-wp-i18n": "~1.0.1",
31
- "shortid": "^2.2.8"
32
- },
33
- "engines": {
34
- "node": ">=8.9.3",
35
- "npm": ">=5.5.1"
36
- },
37
- "dependencies": {
38
- "npm": "^5.7.1"
39
- }
40
- }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: woocommerce, claudiosanches, bor0, royho, laurendavissmith001, c-s
3
Tags: woocommerce, google analytics
4
Requires at least: 3.8
5
Tested up to: 5.0
6
- Stable tag: 1.4.7
7
License: GPLv3
8
License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
@@ -68,6 +68,9 @@ Exact wording depends on the national data privacy laws and should be adjusted.
68
69
== Changelog ==
70
71
= 1.4.7 - 11/19/2018 =
72
* Tweak - WP 5.0 compatibility.
73
3
Tags: woocommerce, google analytics
4
Requires at least: 3.8
5
Tested up to: 5.0
6
+ Stable tag: 1.4.8
7
License: GPLv3
8
License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
68
69
== Changelog ==
70
71
+ = 1.4.8 - 2019-03-04 =
72
+ * Fix - Event for deleting from cart not sent after a cart update.
73
+
74
= 1.4.7 - 11/19/2018 =
75
* Tweak - WP 5.0 compatibility.
76
woocommerce-google-analytics-integration.php CHANGED
@@ -5,7 +5,7 @@
5
* Description: Allows Google Analytics tracking code to be inserted into WooCommerce store pages.
6
* Author: WooCommerce
7
* Author URI: https://woocommerce.com
8
- * Version: 1.4.7
9
* WC requires at least: 2.1
10
* WC tested up to: 3.5
11
* License: GPLv2 or later
@@ -29,7 +29,7 @@ if ( ! class_exists( 'WC_Google_Analytics_Integration' ) ) {
29
*
30
* @var string
31
*/
32
- const VERSION = '1.4.7';
33
34
/**
35
* Instance of this class.
5
* Description: Allows Google Analytics tracking code to be inserted into WooCommerce store pages.
6
* Author: WooCommerce
7
* Author URI: https://woocommerce.com
8
+ * Version: 1.4.8
9
* WC requires at least: 2.1
10
* WC tested up to: 3.5
11
* License: GPLv2 or later
29
*
30
* @var string
31
*/
32
+ const VERSION = '1.4.8';
33
34
/**
35
* Instance of this class.