Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 2.1.0

Version Description

  • 19/07/2018 =
    • New User Interface
    • Minor Bug Fixes
Download this release

Release Info

Developer Tatvic
Plugin Icon 128x128 Enhanced Ecommerce Google Analytics Plugin for WooCommerce
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.3 to 2.1.0

Files changed (37) hide show
  1. LICENSE.txt +339 -0
  2. admin/class-enhanced-ecommerce-google-analytics-admin.php +177 -0
  3. admin/class-enhanced-ecommerce-google-analytics-settings.php +71 -0
  4. admin/css/enhanced-ecommerce-google-analytics-admin.css +72 -0
  5. admin/images/adwords.png +0 -0
  6. admin/images/banner.png +0 -0
  7. admin/images/facebook.jpg +0 -0
  8. admin/images/google_optimize.png +0 -0
  9. admin/images/m1.png +0 -0
  10. admin/images/m2.png +0 -0
  11. admin/images/plugin_bk.png +0 -0
  12. admin/images/shopify_new.png +0 -0
  13. admin/images/tatvic_logo.png +0 -0
  14. admin/index.php +1 -0
  15. admin/js/enhanced-ecommerce-google-analytics-admin.js +33 -0
  16. admin/partials/about-plugin.php +154 -0
  17. admin/partials/enhanced-ecommerce-google-analytics-admin-display.php +46 -0
  18. admin/partials/general-fields.php +113 -0
  19. admin/partials/sidebar.php +29 -0
  20. enhanced-ecommerce-google-analytics.php +83 -0
  21. includes/aga_premium.png +0 -0
  22. includes/class-enhanced-ecommerce-google-analytics-activator.php +38 -0
  23. includes/class-enhanced-ecommerce-google-analytics-deactivator.php +37 -0
  24. includes/class-enhanced-ecommerce-google-analytics-i18n.php +47 -0
  25. includes/class-enhanced-ecommerce-google-analytics-loader.php +128 -0
  26. includes/class-enhanced-ecommerce-google-analytics.php +251 -0
  27. includes/index.php +1 -0
  28. index.php +1 -0
  29. languages/enhanced-ecommerce-google-analytics.pot +0 -0
  30. includes/class-wc-enhanced-ecommerce-google-analytics-integration.php → public/class-enhanced-ecommerce-google-analytics-public.php +77 -195
  31. public/css/enhanced-ecommerce-google-analytics-public.css +4 -0
  32. public/index.php +1 -0
  33. public/js/enhanced-ecommerce-google-analytics-public.js +32 -0
  34. public/partials/class-enhanced-ecommerce-google-analytics-public-display.php +16 -0
  35. readme.txt +321 -301
  36. uninstall.php +31 -0
  37. woocommerce-enhanced-ecommerce-google-analytics-integration.php +0 -59
LICENSE.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
admin/class-enhanced-ecommerce-google-analytics-admin.php ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The admin-specific functionality of the plugin.
5
+ *
6
+ * @link tatvic.com
7
+ * @since 1.0.0
8
+ *
9
+ * @package Enhanced_Ecommerce_Google_Analytics
10
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
11
+ */
12
+
13
+ /**
14
+ * The admin-specific functionality of the plugin.
15
+ *
16
+ * Defines the plugin name, version, and two examples hooks for how to
17
+ * enqueue the admin-specific stylesheet and JavaScript.
18
+ *
19
+ * @package Enhanced_Ecommerce_Google_Analytics
20
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
+ * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
+ */
23
+ class Enhanced_Ecommerce_Google_Analytics_Admin {
24
+
25
+ /**
26
+ * The ID of this plugin.
27
+ *
28
+ * @since 1.0.0
29
+ * @access private
30
+ * @var string $plugin_name The ID of this plugin.
31
+ */
32
+ private $plugin_name;
33
+
34
+ /**
35
+ * The version of this plugin.
36
+ *
37
+ * @since 1.0.0
38
+ * @access private
39
+ * @var string $version The current version of this plugin.
40
+ */
41
+ private $version;
42
+
43
+ /**
44
+ * Initialize the class and set its properties.
45
+ *
46
+ * @since 1.0.0
47
+ * @param string $plugin_name The name of this plugin.
48
+ * @param string $version The version of this plugin.
49
+ */
50
+ protected $ga_id;
51
+
52
+ protected $ga_LC;
53
+
54
+ protected $ga_eeT;
55
+
56
+ public function __construct( $plugin_name, $version ) {
57
+
58
+ $this->plugin_name = $plugin_name;
59
+ $this->version = $version;
60
+
61
+ }
62
+
63
+ /**
64
+ * Register the stylesheets for the admin area.
65
+ *
66
+ * @since 1.0.0
67
+ */
68
+ public function enqueue_styles() {
69
+
70
+ $screen = get_current_screen();
71
+ if ( $screen->id == 'tatvic-ee-plugin_page_enhanced-ecommerce-google-analytics-admin-display'){
72
+ wp_register_style('font_awesome','//use.fontawesome.com/releases/v5.0.13/css/all.css');
73
+ wp_enqueue_style('font_awesome');
74
+ wp_register_style('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
75
+ wp_enqueue_style('aga_bootstrap');
76
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all' );
77
+ }
78
+
79
+
80
+ }
81
+ /**
82
+ * Register the JavaScript for the admin area.
83
+ *
84
+ * @since 1.0.0
85
+ */
86
+ public function enqueue_scripts() {
87
+
88
+ $screen = get_current_screen();
89
+ if ( $screen->id == 'tatvic-ee-plugin_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
90
+ wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
91
+ wp_enqueue_script('popper_bootstrap');
92
+ wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
93
+ wp_enqueue_script('aga_bootstrap');
94
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/enhanced-ecommerce-google-analytics-admin.js', array( 'jquery' ), $this->version, false );
95
+ }
96
+
97
+ }
98
+
99
+ /**
100
+ * Display Admin Page.
101
+ *
102
+ * @since 1.0.0
103
+ */
104
+ public function display_admin_page() {
105
+ add_menu_page(
106
+ 'Tatvic EE Plugin',
107
+ 'Tatvic EE Plugin',
108
+ 'NULL',
109
+ 'ee',
110
+ '',
111
+ plugin_dir_url(__FILE__) . 'images/tatvic_logo.png',
112
+ 26
113
+ );
114
+ }
115
+
116
+ /**
117
+ * Display Tab page.
118
+ *
119
+ * @since 1.0.0
120
+ */
121
+ public function add_new_menu(){
122
+ add_submenu_page("ee",
123
+ "Enhanced Ecommerce Google Analytics for Woocommerce",
124
+ "Enhanced Ecommerce Google Analytics for Woocommerce",
125
+ "manage_options",
126
+ "enhanced-ecommerce-google-analytics-admin-display",
127
+ array($this,'showPage'),
128
+ 99);
129
+ }
130
+ public function showPage() {
131
+ require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
132
+ if(!empty($_GET['tab'])){
133
+ $get_action = $_GET['tab'];
134
+ }
135
+ else{
136
+ $get_action = "general_settings";
137
+ }
138
+ if(method_exists($this, $get_action)) {
139
+ $this->$get_action();
140
+ }
141
+
142
+ }
143
+
144
+ public function general_settings() {
145
+ require_once( 'partials/general-fields.php');
146
+ }
147
+
148
+ public function conversion_tracking() {
149
+ require_once( 'partials/conversion-tracking.php');
150
+ }
151
+
152
+ public function google_optimize() {
153
+ require_once( 'partials/google-optimize.php');
154
+ }
155
+
156
+ public function about_plugin() {
157
+ require_once( 'partials/about-plugin.php');
158
+ }
159
+
160
+ /**
161
+ * Plugin Activation Notice.
162
+ *
163
+ * @since 1.0.0
164
+ */
165
+ public function ee_check_activation_notice() {
166
+ if( get_transient( 'ee-admin-notice-activation' ) ) {
167
+ $setting_url = 'admin.php?page=enhanced-ecommerce-google-analytics-admin-display';
168
+ ?>
169
+ <div class="notice notice-warning is-dismissible">
170
+ <p>Due to the major updates with the latest version, Kindly verify all the <a href="<?php echo $setting_url; ?>" >Settings</a> again.</p>
171
+ </div>
172
+ <?php
173
+ delete_transient( 'ee-admin-notice-activation' );
174
+ }
175
+ }
176
+
177
+ }
admin/class-enhanced-ecommerce-google-analytics-settings.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The admin-setting functionality of the plugin.
4
+ *
5
+ * @link tatvic.com
6
+ * @since 1.0.0
7
+ *
8
+ * @package Enhanced_Ecommerce_Google_Analytics
9
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
10
+ */
11
+
12
+ /**
13
+ * The admin-setting functionality of the plugin.
14
+ *
15
+ * Defines the plugin name, version, and two examples hooks for how to
16
+ * enqueue the admin-specific stylesheet and JavaScript.
17
+ *
18
+ * @package Enhanced_Ecommerce_Google_Analytics
19
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
20
+ * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
21
+ */
22
+ if ( ! defined( 'ABSPATH' ) ) {
23
+ exit();
24
+ }
25
+
26
+ class Enhanced_Ecommerce_Google_Settings {
27
+
28
+ public static function add_update_settings($settings) {
29
+ if ( !get_option($settings)) {
30
+ $ee_options = array();
31
+ foreach ($_POST as $key => $value) {
32
+ if(!isset($_POST[$key])){
33
+ $_POST[$key] = '';
34
+ }
35
+ if(isset($_POST[$key])) {
36
+ $ee_options[$key] = $_POST[$key];
37
+ }
38
+ }
39
+ add_option( $settings, serialize( $ee_options ) );
40
+ }
41
+ else {
42
+ $get_ee_settings = unserialize(get_option($settings));
43
+ foreach ($get_ee_settings as $key => $value) {
44
+ if(!isset($_POST[$key])){
45
+ $_POST[$key] = '';
46
+ }
47
+ if( $_POST[$key] != $value ) {
48
+ $get_ee_settings[$key] = $_POST[$key];
49
+ }
50
+
51
+ }
52
+ foreach($_POST as $key=>$value){
53
+ if(!array_key_exists($key,$get_ee_settings)){
54
+ $get_ee_settings[$key] = $value;
55
+ }
56
+ }
57
+ update_option($settings, serialize( $get_ee_settings ));
58
+ }
59
+ self::admin_notice__success();
60
+ }
61
+
62
+ private static function admin_notice__success() {
63
+ $class = 'notice notice-success';
64
+ $message = __( 'Your settings have been saved.', 'sample-text-domain' );
65
+ printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
66
+
67
+ }
68
+
69
+ }
70
+
71
+ ?>
admin/css/enhanced-ecommerce-google-analytics-admin.css ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * All of the CSS for your admin-specific functionality should be
3
+ * included in this file.
4
+ */
5
+ *{
6
+ box-sizing: border-box;
7
+ margin:0px;
8
+ padding:0px;
9
+ }
10
+ body{
11
+ background: #f1f1f1 !important;
12
+ }
13
+ .nav-link.active{
14
+ color: #fff !important;
15
+ background-color: #2D73C5 !important;
16
+ }
17
+ a.aga-tab{
18
+ color:#4A4A4A !important;
19
+ line-height: 2em;
20
+ }
21
+ .table td{
22
+ vertical-align: middle !important;
23
+ }
24
+ td{
25
+ width:8%;
26
+ }
27
+ .popover{
28
+ max-width:500px !important;
29
+ }
30
+ .popover-body{
31
+ text-align: justify;
32
+ text-justify: inter-word;
33
+ }
34
+ input[type=text],input[type=email],input[type=number],textarea{
35
+ border:1.3px solid #b4b9be;
36
+ }
37
+ input[type=checkbox]{
38
+ border:1.2px solid #b4b9be;
39
+ background:#fff;
40
+ -webkit-transition: all 1.5s ease;
41
+ -moz-transition: all 1.5s ease;
42
+ -o-transition: all 1.5s ease;
43
+ -ms-transition: all 1.5s ease;
44
+ transition: all 1.5s ease;
45
+ }
46
+ input[type=checkbox]:checked::before {
47
+ height:16px;
48
+ width:16px;
49
+ background:#2D73C5;
50
+ color:white;
51
+ font:100 16px/1 dashicons !important;
52
+ margin:-1px;
53
+ }
54
+ h5{
55
+ margin-top: 5px;
56
+ }
57
+ @media only screen and (min-width: 1200px){
58
+ .container{
59
+ margin-left: 8% !important;
60
+ width:auto;
61
+ }
62
+ .banner{
63
+ width:100%;
64
+ }
65
+ }
66
+ @media only screen and (min-width: 1920px){
67
+ .container{
68
+ margin-left: 6% !important;
69
+ width:auto;
70
+ }
71
+
72
+ }
admin/images/adwords.png ADDED
Binary file
admin/images/banner.png ADDED
Binary file
admin/images/facebook.jpg ADDED
Binary file
admin/images/google_optimize.png ADDED
Binary file
admin/images/m1.png ADDED
Binary file
admin/images/m2.png ADDED
Binary file
admin/images/plugin_bk.png ADDED
Binary file
admin/images/shopify_new.png ADDED
Binary file
admin/images/tatvic_logo.png ADDED
Binary file
admin/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
admin/js/enhanced-ecommerce-google-analytics-admin.js ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * All of the code for your admin-facing JavaScript source
6
+ * should reside in this file.
7
+ *
8
+ * Note: It has been assumed you will write jQuery code here, so the
9
+ * $ function reference has been prepared for usage within the scope
10
+ * of this function.
11
+ *
12
+ * This enables you to define handlers, for when the DOM is ready:
13
+ *
14
+ * $(function() {
15
+ *
16
+ * });
17
+ *
18
+ * When the window is loaded:
19
+ *
20
+ * $( window ).load(function() {
21
+ *
22
+ * });
23
+ *
24
+ * ...and/or other possibilities.
25
+ *
26
+ * Ideally, it is not considered best practise to attach more than a
27
+ * single DOM-ready or window-load handler for a particular page.
28
+ * Although scripts in the WordPress core, Plugins and Themes may be
29
+ * practising this, we should strive to set a better example in our own work.
30
+ */
31
+
32
+
33
+ })( jQuery );
admin/partials/about-plugin.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ td{
3
+ text-align: center !important;
4
+ }
5
+ th{
6
+ text-align: center !important;
7
+ }
8
+ .fa-times{
9
+ color:red;
10
+ }
11
+ .fa-check{
12
+ color:green;
13
+ }
14
+ </style>
15
+ <div class="container">
16
+ <div class="row" style="margin-left:-11%; !important;">
17
+ <div class= "col col-9">
18
+ <div class="card mw-100" style="padding:0;">
19
+ <div class="card-header">
20
+ <h5>Feature difference between <span style="font-weight: 800;">Free & Premium</span> Plugin</h5>
21
+ </div>
22
+ <div class="card-body">
23
+ <div class="row">
24
+ <div class="col-md-10 my-4 mx-auto">
25
+ <div class="row">
26
+ <div class="col-lg-12">
27
+ <div class="table-responsve">
28
+ <table class="table table-striped table-hover">
29
+ <thead class="thead-inverse">
30
+ <tr>
31
+ <th class="w-25" style="font-weight: 900;">Features</th>
32
+ <th class="" style="font-weight: 900;">Free</th>
33
+ <th class="" style="font-weight: 900;">Premium</th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <tr>
38
+ <td class="w-25 option">Basic UA Tracking</td>
39
+ <td><i class="fa fa-check"></i></td>
40
+ <td><i class="fa fa-check"></i></td>
41
+ </tr>
42
+ <tr>
43
+ <td class="option">Enhanced Ecommerce</td>
44
+ <td><strong>Only 4 Reports</strong></td>
45
+ <td><strong>All reports</strong></td>
46
+ </tr>
47
+ <tr>
48
+ <td class="option">I.P. Anonymization</td>
49
+ <td><i class="fa fa-check"></i></td>
50
+ <td><i class="fa fa-check"></i></td>
51
+ </tr>
52
+ <tr>
53
+ <td class="option">Google Opt-Out</td>
54
+ <td><i class="fa fa-check"></i></td>
55
+ <td><i class="fa fa-check"></i></td>
56
+ </tr>
57
+ <tr>
58
+ <td class="option">Product List Performance</td>
59
+ <td><i class="fa fa-times"></i></td>
60
+ <td><i class="fa fa-check"></i></td>
61
+ </tr>
62
+ <tr>
63
+ <td class="option">Display Feature</td>
64
+ <td><i class="fa fa-times"></i></td>
65
+ <td><i class="fa fa-check"></i></td>
66
+ </tr>
67
+ <tr>
68
+ <td class="option">Product Variation</td>
69
+ <td><i class="fa fa-times"></i></td>
70
+ <td><i class="fa fa-check"></i></td>
71
+ </tr>
72
+ <tr>
73
+ <td class="option">Automated Product Refund</td>
74
+ <td><i class="fa fa-times"></i></td>
75
+ <td><i class="fa fa-check"></i></td>
76
+ </tr>
77
+ <tr>
78
+ <td class="option">Google Adwords Conversion Tracking</td>
79
+ <td><i class="fa fa-times"></i></td>
80
+ <td><i class="fa fa-check"></i></td>
81
+ </tr>
82
+ <tr>
83
+ <td class="option">Facebook Pixel Implementation</td>
84
+ <td><i class="fa fa-times"></i></td>
85
+ <td><i class="fa fa-check"></i></td>
86
+ </tr>
87
+ <tr>
88
+ <td class="option">Add Google Optimize Snippet</td>
89
+ <td><i class="fa fa-times"></i></td>
90
+ <td><i class="fa fa-check"></i></td>
91
+ </tr>
92
+ <tr>
93
+ <td class="option">User ID Tracking</td>
94
+ <td><i class="fa fa-times"></i></td>
95
+ <td><i class="fa fa-check"></i></td>
96
+ </tr>
97
+ <tr>
98
+ <td class="option">Form Field Tracking</td>
99
+ <td><i class="fa fa-times"></i></td>
100
+ <td><i class="fa fa-check"></i></td>
101
+ </tr>
102
+ <tr>
103
+ <td class="option">Content Grouping</td>
104
+ <td><i class="fa fa-times"></i></td>
105
+ <td><i class="fa fa-check"></i></td>
106
+ </tr>
107
+
108
+ <tr>
109
+ <td class="option">Internal Promotion</td>
110
+ <td><i class="fa fa-times"></i></td>
111
+ <td><i class="fa fa-check"></i></td>
112
+ </tr>
113
+ <tr>
114
+ <td class="option">15+ Ready to Use Custom Dimensions/ Metrics</td>
115
+ <td><i class="fa fa-times"></i></td>
116
+ <td><i class="fa fa-check"></i></td>
117
+ </tr>
118
+ <tr>
119
+ <td class="option">Child / Custom Theme Support</td>
120
+ <td><i class="fa fa-times"></i></td>
121
+ <td><i class="fa fa-check"></i></td>
122
+ </tr>
123
+ <tr>
124
+ <td class="option">Quick Expert Support ( Query Support)</td>
125
+ <td><i class="fa fa-times"></i></td>
126
+ <td><i class="fa fa-check"></i></td>
127
+ </tr>
128
+ <tr>
129
+ <td class="option">Paid Customization</td>
130
+ <td><i class="fa fa-times"></i></td>
131
+ <td><i class="fa fa-check"></i></td>
132
+ </tr>
133
+ </tbody>
134
+ <tfoot class="thead-inverse">
135
+ <tr>
136
+ <th class="w-25"></th>
137
+ <th class=""></th>
138
+ <th class=""><a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank"><button class="btn btn-primary">Upgrade to Premium</button></a></th>
139
+ </tr>
140
+ </tfoot>
141
+ </table>
142
+ <p class="description" style="font-size: 15px;"><strong>For more information on Premium Version, feel free to reach out to us at analytics2@tatvic.com</strong></p>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </div>
148
+ <hr>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ <?php require_once('sidebar.php');?>
153
+ </div>
154
+ </div>
admin/partials/enhanced-ecommerce-google-analytics-admin-display.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Provide a admin area view for the plugin
5
+ *
6
+ * This file is used to markup the admin-facing aspects of the plugin.
7
+ *
8
+ * @link tatvic.com
9
+ * @since 1.0.0
10
+ *
11
+ * @package Enhanced_Ecommerce_Google_Analytics
12
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/admin/partials
13
+ *
14
+ */
15
+ if (!defined('ABSPATH')) {
16
+ exit;
17
+ }
18
+
19
+ $site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
20
+
21
+ if(isset($_GET['tab']) && $_GET['tab'] == 'general_settings'){
22
+ $general_class_active = "active";
23
+ }
24
+ else{
25
+ $general_class_active = "";
26
+ }
27
+ if(isset($_GET['tab']) && $_GET['tab'] == 'about_plugin'){
28
+ $advanced_class_active = "active";
29
+ }
30
+ else{
31
+ $advanced_class_active = "";
32
+ }
33
+ if(empty($_GET['tab'])){
34
+ $general_class_active = "active";
35
+ }
36
+
37
+ ?>
38
+ <header class='background-color:#E8E8E8;height:500px;width:auto;margin-top:100px;margin-left:20px;'>
39
+ <img class ="banner" src='<?php echo plugins_url('../images/banner.png', __FILE__ ) ?>' style="margin-left:10px;">
40
+ </header>
41
+ <ul class="nav nav-tabs nav-pills" style="margin-left: 10px;margin-top:20px;">
42
+ <li class="nav-item">
43
+ <a href="<?php echo $site_url.'general_settings'; ?>" class="border-left aga-tab nav-link <?php echo $general_class_active; ?>">General Setting</a>
44
+ </li>
45
+ <li class="nav-item"><a href="<?php echo $site_url.'about_plugin'; ?>" class="border-left aga-tab nav-link <?php echo $advanced_class_active; ?>">Premium Plugin</a></li>
46
+ </ul>
admin/partials/general-fields.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(isset($_POST['ee_submit_plugin'])){
3
+ Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
4
+ }
5
+ $data = unserialize(get_option('ee_options'));
6
+ ?>
7
+ <div class="container">
8
+ <div class="row" style="margin-left:-11%; !important;">
9
+ <div class= "col col-9" >
10
+ <div class="card mw-100" style="padding:0px;">
11
+ <div class="card-header">
12
+ <h5>Enhanced Ecommerce Google Analytics</h5>
13
+ </div>
14
+ <div class="card-body">
15
+ <form id="ee_plugin_form" method="post" action="" enctype="multipart/form-data" >
16
+ <table class="table table-bordered">
17
+ <tbody>
18
+
19
+ <tr>
20
+ <td>
21
+ <label class="align-middle" for="woocommerce_ee_google_analytics_ga_id">Google Analytics ID</label>
22
+ </td>
23
+ <td>
24
+ <input type="text" id="ga_id" name = "ga_id" required = "required" value="<?php echo $data['ga_id'];?>">
25
+ <i style="cursor: help;" class="fas fa-question-circle" title="Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g. UA-XXXXXX-XX"></i>
26
+ </td>
27
+ </tr>
28
+ <tr>
29
+ <td>
30
+ <label class="align-middle" for="tracking_code">Tracking Code</label>
31
+ </td>
32
+ <td>
33
+ <label class = "align-middle" for="ga_code">
34
+ <?php $ga_ST = !empty($data['ga_ST'])? 'checked' : ''; ?>
35
+ <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo $ga_ST; ?> >
36
+ Add Global Site Tracking Code 'gtag.js' (Optional)
37
+ <p class="description">This feature adds New gtag.js Tracking Code to your Store. You don't need to enable this if gtag.js implemented via a 3rd party analytics plugin.</p>
38
+ </label><br/>
39
+ <label class = "align-middle" for="ga_enhance_ecommerce">
40
+ <?php $ga_eeT = !empty($data['ga_eeT'])? 'checked' : ''; ?>
41
+ <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo $ga_eeT; ?> >
42
+ Add Enhanced Ecommerce Tracking Code
43
+ <p class="description">This feature adds Enhanced Ecommerce Tracking Code to your Store</p>
44
+ </label><br/>
45
+ <label class = "align-middle" for="ga_login_step">
46
+ <?php $ga_gUser = !empty($data['ga_gUser'])? 'checked' : ''; ?>
47
+ <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo $ga_gUser; ?> >
48
+ Add Code to Track the Login Step of Guest Users (Optional)
49
+ <p class="description">If you have Guest Check out enable, we recommend you to add this code</p>
50
+ </label><br/>
51
+ </td>
52
+ </tr>
53
+ <tr>
54
+ <td>
55
+ <label for="ga_Impr">Impression Thresold</label>
56
+ </td>
57
+ <td>
58
+ <?php $ga_Impr = !empty($data['ga_Impr'])? $data['ga_Impr'] : 6; ?>
59
+ <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo $ga_Impr; ?>"><br/>
60
+ <p class="description">This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions.</p>
61
+ </td>
62
+ </tr>
63
+ <tr>
64
+ <td>
65
+ <label class = "align-middle" for="ga_IPA">I.P. Anoymization</label>
66
+ </td>
67
+ <td>
68
+ <label class = "align-middle" for="ga_IPA">
69
+ <?php $ga_IPA = !empty($data['ga_IPA'])? 'checked' : ''; ?>
70
+ <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo $ga_IPA; ?>>
71
+ Enable I.P. Anonymization
72
+ <p class="description">Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance</p>
73
+ </label>
74
+ </td>
75
+ </tr>
76
+ <tr>
77
+ <td>
78
+ <label class = "align-middle" for="ga_OPTOUT">Google Analytics Opt Out</label>
79
+ </td>
80
+ <td>
81
+ <label class = "align-middle" for="ga_OPTOUT">
82
+ <?php $ga_OPTOUT = !empty($data['ga_OPTOUT'])? 'checked' : ''; ?>
83
+ <input class="" type="checkbox" name="ga_OPTOUT" id="ga_OPTOUT" <?php echo $ga_OPTOUT; ?>>
84
+ Enable Google Analytics Opt Out (Optional)
85
+ <p class="description">Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the documentation to check the setup</p>
86
+ </label>
87
+ </td>
88
+ </tr>
89
+ <tr>
90
+ <td>
91
+ <label class = "align-middle" for="ga_PrivacyPolicy">Privacy Policy</label>
92
+ </td>
93
+ <td>
94
+ <label class = "align-middle" for="ga_PrivacyPolicy">
95
+ <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy'])? 'checked' : ''; ?>
96
+ <input type="checkbox" onchange="enableSubmit();" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo $ga_PrivacyPolicy; ?>>
97
+ Accept Privacy Policy of Plugin
98
+ <p class="description">By using Tatvic Plugin, you agree to Tatvic plugin's <a href= "https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></p>
99
+ </label>
100
+ </td>
101
+ </tr>
102
+ </tbody>
103
+ </table>
104
+ <p class="submit save-for-later" id="save-for-later">
105
+ <button type="submit" class="btn btn-primary btn-success" id="ee_submit_plugin" name="ee_submit_plugin">Submit</button>
106
+ </p>
107
+ </form>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ <?php require_once('sidebar.php');?>
112
+ </div>
113
+ </div>
admin/partials/sidebar.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="col col-xs-3">
2
+ <div class="card" style="padding: 0px;">
3
+ <div class="card-header">
4
+ <h5> Important Links</h5>
5
+ </div>
6
+ <div class="card-body">
7
+ <ul>
8
+ <li style="padding-bottom:5px;"><a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Installation Instructions</a></li>
9
+ <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" target="_blank">FAQ</a></li>
10
+ <li style="padding-bottom:5px;"><a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">Support</a></li>
11
+ <li style="padding-bottom:5px;"><a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></li>
12
+ <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#developers" target="_blank">Change Logs</a></li>
13
+ </ul>
14
+ </div>
15
+ </div>
16
+ <div class="card" style="padding: 0px;">
17
+ <div class="card-header">
18
+ <h5>Tatvic also Offers</h5>
19
+ </div>
20
+ <div class="card-body">
21
+ <ul>
22
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m1.png', __FILE__ ) ?>' />&nbsp;<a href="https://codecanyon.net/item/actionable-google-analytics-for-magento/9899649?ref=mage_tatvic" target="_blank">Actionable Google Analytics for Magento</a></li>
23
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m2.png', __FILE__ ) ?>' />&nbsp;<a href="https://marketplace.magento.com/tatvic-actionablegoogleanalytics.html" target="_blank">Actionable Google Analytics for Magento2</a></li>
24
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/shopify_new.png', __FILE__ ) ?>' />&nbsp;<a href="https://apps.shopify.com/google-universal-analytics-enhanced-ecommerce" target="_blank">Actionable Google Analytics for Shopify</a></li>
25
+ <li style="padding-bottom:5px;"><img style="width:25px;height: 25px;" src='<?php echo plugins_url('../images/tatvic_logo.png', __FILE__ ) ?>' />&nbsp;<a href="https://www.tatvic.com/excel-add-in-google-analytics/?utm_source=excel_tool_signup&utm_medium=woo_free_plugin&utm_campaign=excel_free_trial" target="_blank">Tatvic Ninja Excel AddIn</a></li>
26
+ </ul>
27
+ </div>
28
+ </div>
29
+ </div>
enhanced-ecommerce-google-analytics.php ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The plugin bootstrap file
5
+ *
6
+ * This file is read by WordPress to generate the plugin information in the plugin
7
+ * admin area. This file also includes all of the dependencies used by the plugin,
8
+ * registers the activation and deactivation functions, and defines a function
9
+ * that starts the plugin.
10
+ *
11
+ * @link tatvic.com
12
+ * @since 1.0.0
13
+ * @package Enhanced E-commerce for Woocommerce store
14
+ *
15
+ * @wordpress-plugin
16
+ * Plugin Name: Enhanced E-commerce for Woocommerce store
17
+ * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
+ * Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
19
+ * Version: 2.1.0
20
+ * Author: Tatvic
21
+ * Author URI: tatvic.com
22
+ * License: GPL-2.0+
23
+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24
+ * Text Domain: tatvic.com
25
+ * Domain Path: /languages
26
+ * WC requires at least: 1.4.1
27
+ * WC tested up to: 3.4.0
28
+ */
29
+
30
+ // If this file is called directly, abort.
31
+ if ( ! defined( 'WPINC' ) ) {
32
+ die;
33
+ }
34
+
35
+ /**
36
+ * Currently plugin version.
37
+ * Start at version 1.0.0 and use SemVer - https://semver.org
38
+ * Rename this for your plugin and update it as you release new versions.
39
+ */
40
+ define( 'PLUGIN_NAME_VERSION', '2.1.0' );
41
+ /**
42
+ * The code that runs during plugin activation.
43
+ * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
44
+ */
45
+ function activate_enhanced_ecommerce_google_analytics() {
46
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-activator.php';
47
+ Enhanced_Ecommerce_Google_Analytics_Activator::activate();
48
+ }
49
+
50
+ /**
51
+ * The code that runs during plugin deactivation.
52
+ * This action is documented in includes/class-enhanced-ecommerce-google-analytics-deactivator.php
53
+ */
54
+ function deactivate_enhanced_ecommerce_google_analytics() {
55
+ require_once plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics-deactivator.php';
56
+ Enhanced_Ecommerce_Google_Analytics_Deactivator::deactivate();
57
+ }
58
+ register_activation_hook( __FILE__, 'activate_enhanced_ecommerce_google_analytics' );
59
+ register_deactivation_hook( __FILE__, 'deactivate_enhanced_ecommerce_google_analytics' );
60
+
61
+ /**
62
+ * The core plugin class that is used to define internationalization,
63
+ * admin-specific hooks, and public-facing site hooks.
64
+ */
65
+ require plugin_dir_path( __FILE__ ) . 'includes/class-enhanced-ecommerce-google-analytics.php';
66
+
67
+ /**
68
+ * Begins execution of the plugin.
69
+ *
70
+ * Since everything within the plugin is registered via hooks,
71
+ * then kicking off the plugin from this point in the file does
72
+ * not affect the page life cycle.
73
+ *
74
+ * @since 1.0.0
75
+ */
76
+
77
+ function run_enhanced_ecommerce_google_analytics() {
78
+
79
+ $plugin = new Enhanced_Ecommerce_Google_Analytics();
80
+ $plugin->run();
81
+
82
+ }
83
+ run_enhanced_ecommerce_google_analytics();
includes/aga_premium.png DELETED
Binary file
includes/class-enhanced-ecommerce-google-analytics-activator.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Fired during plugin activation
5
+ *
6
+ * @link test.com
7
+ * @since 1.0.0
8
+ *
9
+ * @package Enhanced_Ecommerce_Google_Analytics_Activator
10
+ * @subpackage Enhanced_Ecommerce_Google_Analytics_Activator/includes
11
+ */
12
+
13
+ /**
14
+ * Fired during plugin activation.
15
+ *
16
+ * This class defines all code necessary to run during the plugin's activation.
17
+ *
18
+ * @since 1.0.0
19
+ * @package Enhanced_Ecommerce_Google_Analytics_Activator
20
+ * @subpackage Enhanced_Ecommerce_Google_Analytics_Activator/includes
21
+ * @author Chiranjiv Pathak <chiranijv@tatvic.com>
22
+ */
23
+
24
+ class Enhanced_Ecommerce_Google_Analytics_Activator {
25
+
26
+ /**
27
+ * Short Description. (use period)
28
+ *
29
+ * Long Description.
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ public static function activate() {
34
+ set_transient( 'ee-admin-notice-activation', true, 5 );
35
+ }
36
+
37
+
38
+ }
includes/class-enhanced-ecommerce-google-analytics-deactivator.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Fired during plugin deactivation
5
+ *
6
+ * @link test.com
7
+ * @since 1.0.0
8
+ *
9
+ * @package Enhanced_Ecommerce_Google_Analytics
10
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
11
+ */
12
+
13
+ /**
14
+ * Fired during plugin deactivation.
15
+ *
16
+ * This class defines all code necessary to run during the plugin's deactivation.
17
+ *
18
+ * @since 1.0.0
19
+ * @package Enhanced_Ecommerce_Google_Analytics
20
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
21
+ * @author Chiranjiv Pathak <chiranijv@tatvic.com>
22
+ */
23
+ class Enhanced_Ecommerce_Google_Analytics_Deactivator {
24
+
25
+ /**
26
+ * Short Description. (use period)
27
+ *
28
+ * Long Description.
29
+ *
30
+ * @since 1.0.0
31
+ */
32
+ public static function deactivate() {
33
+ if (!current_user_can('activate_plugins'))
34
+ return;
35
+ }
36
+
37
+ }
includes/class-enhanced-ecommerce-google-analytics-i18n.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Define the internationalization functionality
5
+ *
6
+ * Loads and defines the internationalization files for this plugin
7
+ * so that it is ready for translation.
8
+ *
9
+ * @link tatvic.com
10
+ * @since 1.0.0
11
+ *
12
+ * @package Enhanced_Ecommerce_Google_Analytics
13
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
14
+ */
15
+
16
+ /**
17
+ * Define the internationalization functionality.
18
+ *
19
+ * Loads and defines the internationalization files for this plugin
20
+ * so that it is ready for translation.
21
+ *
22
+ * @since 1.0.0
23
+ * @package Enhanced_Ecommerce_Google_Analytics
24
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
25
+ * @author Chiranjiv Pathak <chiranijv@tatvic.com>
26
+ */
27
+ class Enhanced_Ecommerce_Google_Analytics_i18n {
28
+
29
+
30
+ /**
31
+ * Load the plugin text domain for translation.
32
+ *
33
+ * @since 1.0.0
34
+ */
35
+ public function load_plugin_textdomain() {
36
+
37
+ load_plugin_textdomain(
38
+ 'enhanced-ecommerce-google-analytics',
39
+ false,
40
+ dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
41
+ );
42
+
43
+ }
44
+
45
+
46
+
47
+ }
includes/class-enhanced-ecommerce-google-analytics-loader.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Register all actions and filters for the plugin
5
+ *
6
+ * @link tatvic.com
7
+ * @since 1.0.0
8
+ *
9
+ * @package Enhanced_Ecommerce_Google_Analytics
10
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
11
+ */
12
+
13
+ /**
14
+ * Register all actions and filters for the plugin.
15
+ *
16
+ * Maintain a list of all hooks that are registered throughout
17
+ * the plugin, and register them with the WordPress API. Call the
18
+ * run function to execute the list of actions and filters.
19
+ *
20
+ * @package Enhanced_Ecommerce_Google_Analytics
21
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
22
+ * @author Chiranjiv Pathak <chiranijv@tatvic.com>
23
+ */
24
+ class Enhanced_Ecommerce_Google_Analytics_Loader {
25
+
26
+ /**
27
+ * The array of actions registered with WordPress.
28
+ *
29
+ * @since 1.0.0
30
+ * @access protected
31
+ * @var array $actions The actions registered with WordPress to fire when the plugin loads.
32
+ */
33
+ protected $actions;
34
+
35
+ /**
36
+ * The array of filters registered with WordPress.
37
+ *
38
+ * @since 1.0.0
39
+ * @access protected
40
+ * @var array $filters The filters registered with WordPress to fire when the plugin loads.
41
+ */
42
+ protected $filters;
43
+
44
+ /**
45
+ * Initialize the collections used to maintain the actions and filters.
46
+ *
47
+ * @since 1.0.0
48
+ */
49
+ public function __construct() {
50
+
51
+ $this->actions = array();
52
+ $this->filters = array();
53
+
54
+ }
55
+
56
+ /**
57
+ * Add a new action to the collection to be registered with WordPress.
58
+ *
59
+ * @since 1.0.0
60
+ * @param string $hook The name of the WordPress action that is being registered.
61
+ * @param object $component A reference to the instance of the object on which the action is defined.
62
+ * @param string $callback The name of the function definition on the $component.
63
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
64
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
65
+ */
66
+ public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
67
+ $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
68
+ }
69
+
70
+ /**
71
+ * Add a new filter to the collection to be registered with WordPress.
72
+ *
73
+ * @since 1.0.0
74
+ * @param string $hook The name of the WordPress filter that is being registered.
75
+ * @param object $component A reference to the instance of the object on which the filter is defined.
76
+ * @param string $callback The name of the function definition on the $component.
77
+ * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
78
+ * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
79
+ */
80
+ public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
81
+ $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
82
+ }
83
+
84
+ /**
85
+ * A utility function that is used to register the actions and hooks into a single
86
+ * collection.
87
+ *
88
+ * @since 1.0.0
89
+ * @access private
90
+ * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
91
+ * @param string $hook The name of the WordPress filter that is being registered.
92
+ * @param object $component A reference to the instance of the object on which the filter is defined.
93
+ * @param string $callback The name of the function definition on the $component.
94
+ * @param int $priority The priority at which the function should be fired.
95
+ * @param int $accepted_args The number of arguments that should be passed to the $callback.
96
+ * @return array The collection of actions and filters registered with WordPress.
97
+ */
98
+ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
99
+
100
+ $hooks[] = array(
101
+ 'hook' => $hook,
102
+ 'component' => $component,
103
+ 'callback' => $callback,
104
+ 'priority' => $priority,
105
+ 'accepted_args' => $accepted_args
106
+ );
107
+ return $hooks;
108
+
109
+ }
110
+
111
+ /**
112
+ * Register the filters and actions with WordPress.
113
+ *
114
+ * @since 1.0.0
115
+ */
116
+ public function run() {
117
+
118
+ foreach ( $this->filters as $hook ) {
119
+ add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
120
+ }
121
+
122
+ foreach ( $this->actions as $hook ) {
123
+ add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
124
+ }
125
+
126
+ }
127
+
128
+ }
includes/class-enhanced-ecommerce-google-analytics.php ADDED
@@ -0,0 +1,251 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The file that defines the core plugin class
5
+ *
6
+ * A class definition that includes attributes and functions used across both the
7
+ * public-facing side of the site and the admin area.
8
+ *
9
+ * @link tatvic.com
10
+ * @since 1.0.0
11
+ *
12
+ * @package Enhanced_Ecommerce_Google_Analytics
13
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
14
+ */
15
+
16
+ /**
17
+ * The core plugin class.
18
+ *
19
+ * This is used to define internationalization, admin-specific hooks, and
20
+ * public-facing site hooks.
21
+ *
22
+ * Also maintains the unique identifier of this plugin as well as the current
23
+ * version of the plugin.
24
+ *
25
+ * @since 1.0.0
26
+ * @package Enhanced_Ecommerce_Google_Analytics
27
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
28
+ * @author Chiranjiv Pathak <chiranijv@tatvic.com>
29
+ */
30
+ class Enhanced_Ecommerce_Google_Analytics {
31
+
32
+ /**
33
+ * The loader that's responsible for maintaining and registering all hooks that power
34
+ * the plugin.
35
+ *
36
+ * @since 1.0.0
37
+ * @access protected
38
+ * @var Enhanced_Ecommerce_Google_Analytics_Loader $loader Maintains and registers all hooks for the plugin.
39
+ */
40
+ protected $loader;
41
+
42
+ /**
43
+ * The unique identifier of this plugin.
44
+ *
45
+ * @since 1.0.0
46
+ * @access protected
47
+ * @var string $plugin_name The string used to uniquely identify this plugin.
48
+ */
49
+ protected $plugin_name;
50
+
51
+ /**
52
+ * The current version of the plugin.
53
+ *
54
+ * @since 1.0.0
55
+ * @access protected
56
+ * @var string $version The current version of the plugin.
57
+ */
58
+ protected $version;
59
+
60
+ /**
61
+ * Define the core functionality of the plugin.
62
+ *
63
+ * Set the plugin name and the plugin version that can be used throughout the plugin.
64
+ * Load the dependencies, define the locale, and set the hooks for the admin area and
65
+ * the public-facing side of the site.
66
+ *
67
+ * @since 1.0.0
68
+ */
69
+ public function __construct() {
70
+ if ( defined( 'PLUGIN_NAME_VERSION' ) ) {
71
+ $this->version = PLUGIN_NAME_VERSION;
72
+ } else {
73
+ $this->version = '2.1.0';
74
+ }
75
+ $this->plugin_name = 'enhanced-ecommerce-google-analytics';
76
+ $this->load_dependencies();
77
+ $this->set_locale();
78
+ $this->define_admin_hooks();
79
+ $this->define_public_hooks();
80
+ add_filter( 'plugin_action_links_' .plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ), array($this,'tvc_plugin_action_links'),10 );
81
+ }
82
+
83
+ /**
84
+ * Load the required dependencies for this plugin.
85
+ *
86
+ * Include the following files that make up the plugin:
87
+ *
88
+ * - Enhanced_Ecommerce_Google_Analytics_Loader. Orchestrates the hooks of the plugin.
89
+ * - Enhanced_Ecommerce_Google_Analytics_i18n. Defines internationalization functionality.
90
+ * - Enhanced_Ecommerce_Google_Analytics_Admin. Defines all hooks for the admin area.
91
+ * - Enhanced_Ecommerce_Google_Analytics_Public. Defines all hooks for the public side of the site.
92
+ *
93
+ * Create an instance of the loader which will be used to register the hooks
94
+ * with WordPress.
95
+ *
96
+ * @since 1.0.0
97
+ * @access private
98
+ */
99
+ private function load_dependencies() {
100
+
101
+ /**
102
+ * The class responsible for orchestrating the actions and filters of the
103
+ * core plugin.
104
+ */
105
+
106
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-loader.php';
107
+
108
+ /**
109
+ * The class responsible for defining internationalization functionality
110
+ * of the plugin.
111
+ */
112
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-enhanced-ecommerce-google-analytics-i18n.php';
113
+
114
+ /**
115
+ * The class responsible for defining all actions that occur in the admin area.
116
+ */
117
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-enhanced-ecommerce-google-analytics-admin.php';
118
+
119
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-enhanced-ecommerce-google-analytics-settings.php';
120
+
121
+ /**
122
+ * The class responsible for defining all actions that occur in the public-facing
123
+ * side of the site.
124
+ */
125
+
126
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public.php';
127
+ $this->loader = new Enhanced_Ecommerce_Google_Analytics_Loader();
128
+
129
+ }
130
+
131
+ /**
132
+ * Define the locale for this plugin for internationalization.
133
+ *
134
+ * Uses the Enhanced_Ecommerce_Google_Analytics_i18n class in order to set the domain and to register the hook
135
+ * with WordPress.
136
+ *
137
+ * @since 1.0.0
138
+ * @access private
139
+ */
140
+ private function set_locale() {
141
+
142
+ $plugin_i18n = new Enhanced_Ecommerce_Google_Analytics_i18n();
143
+
144
+ $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
145
+
146
+ }
147
+
148
+ /**
149
+ * Register all of the hooks related to the admin area functionality
150
+ * of the plugin.
151
+ *
152
+ * @since 1.0.0
153
+ * @access private
154
+ */
155
+ private function define_admin_hooks() {
156
+
157
+ $plugin_admin = new Enhanced_Ecommerce_Google_Analytics_Admin( $this->get_plugin_name(), $this->get_version() );
158
+ $this->loader->add_action( 'admin_menu', $plugin_admin, 'display_admin_page' );
159
+ $this->loader->add_action("admin_menu", $plugin_admin, "add_new_menu");
160
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
161
+ $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
162
+ $this->loader->add_action( 'admin_notices', $plugin_admin, 'ee_check_activation_notice' );
163
+ }
164
+
165
+ /**
166
+ * Register all of the hooks related to the public-facing functionality
167
+ * of the plugin.
168
+ *
169
+ * @since 1.0.0
170
+ * @access private
171
+ */
172
+ private function define_public_hooks() {
173
+
174
+ $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
175
+
176
+ $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
177
+ $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
178
+ $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
179
+ $this->loader->add_action("woocommerce_after_shop_loop_item", $plugin_public, "bind_product_metadata");
180
+ $this->loader->add_action("woocommerce_after_single_product", $plugin_public, "product_detail_view");
181
+ $this->loader->add_action("woocommerce_after_cart",$plugin_public, "remove_cart_tracking");
182
+ //check out step 1,2,3
183
+ $this->loader->add_action("woocommerce_before_checkout_billing_form", $plugin_public, "checkout_step_1_tracking");
184
+ $this->loader->add_action("woocommerce_after_checkout_billing_form", $plugin_public, "checkout_step_2_tracking");
185
+ $this->loader->add_action("woocommerce_after_checkout_billing_form", $plugin_public, "checkout_step_3_tracking");
186
+ $this->loader->add_action("woocommerce_after_add_to_cart_button", $plugin_public, "add_to_cart");
187
+
188
+ //Advanced Store data Tracking
189
+ //add version details in footer
190
+ $this->loader->add_action("wp_footer", $plugin_public, "add_plugin_details");
191
+
192
+ //Add Dev ID
193
+ $this->loader->add_action("wp_head", $plugin_public, "add_dev_id");
194
+ $this->loader->add_action("wp_footer",$plugin_public, "tvc_store_meta_data");
195
+ }
196
+
197
+ /**
198
+ * Run the loader to execute all of the hooks with WordPress.
199
+ *
200
+ * @since 1.0.0
201
+ */
202
+ public function run() {
203
+ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
204
+ add_action('woocommerce_init' , function (){
205
+ $this->loader->run();
206
+ });
207
+ }
208
+ }
209
+
210
+ /**
211
+ * The name of the plugin used to uniquely identify it within the context of
212
+ * WordPress and to define internationalization functionality.
213
+ *
214
+ * @since 1.0.0
215
+ * @return string The name of the plugin.
216
+ */
217
+ public function get_plugin_name() {
218
+ return $this->plugin_name;
219
+ }
220
+
221
+ /**
222
+ * The reference to the class that orchestrates the hooks with the plugin.
223
+ *
224
+ * @since 1.0.0
225
+ * @return Enhanced_Ecommerce_Google_Analytics_Loader Orchestrates the hooks of the plugin.
226
+ */
227
+ public function get_loader() {
228
+ return $this->loader;
229
+ }
230
+
231
+ /**
232
+ * Retrieve the version number of the plugin.
233
+ *
234
+ * @since 1.0.0
235
+ * @return string The version number of the plugin.
236
+ */
237
+ public function get_version() {
238
+ return $this->version;
239
+ }
240
+
241
+ public function tvc_plugin_action_links($links) {
242
+ $setting_url = 'admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=general_settings';
243
+ $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>';
244
+ $links[] = '<a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#faq" target="_blank">FAQ</a>';
245
+ $links[] = '<a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Documentation</a>';
246
+ $links[] = '<a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank"><b>Upgrade to Premium</b></a>';
247
+ return $links;
248
+ }
249
+
250
+
251
+ }
includes/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
languages/enhanced-ecommerce-google-analytics.pot ADDED
File without changes
includes/class-wc-enhanced-ecommerce-google-analytics-integration.php → public/class-enhanced-ecommerce-google-analytics-public.php RENAMED
@@ -1,35 +1,59 @@
1
  <?php
2
 
3
  /**
4
- * Enhanced Ecommerce for Woo-commerce stores
5
  *
6
- * Allows tracking code to be inserted into store pages.
 
7
  *
8
- * @class WC_Enhanced_Ecommerce_Google_Analytics
9
- * @extends WC_Integration
10
- * @author Jigar Navadiya <jigar@tatvic.com>
11
  */
12
- class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
13
 
14
- /**
 
 
 
 
 
 
 
 
 
 
 
15
  * Init and hook in the integration.
16
  *
17
  * @access public
18
  * @return void
19
  */
20
  //set plugin version
21
- public $tvc_eeVer = '2.0.3';
22
- public function __construct() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
- //Set Global Variables
25
- global $homepage_json_fp,$homepage_json_ATC_link, $homepage_json_rp,$prodpage_json_relProd,$catpage_json,
26
- $prodpage_json_ATC_link,$catpage_json_ATC_link,$woocommerce;
27
- if (version_compare($woocommerce->version, "2.1", ">="))
28
- //define plugin ID
29
- $this->id = "enhanced_ecommerce_google_analytics";
30
- $this->method_title = __("Enhanced Ecommerce Google Analytics", "enhanced-e-commerce-for-woocommerce-store");
31
- $this->method_description = __("Enhanced Ecommerce is a new feature of Universal Analytics that generates detailed statistics about the users journey from product page to thank you page on your e-store. <br/><a href='http://www.tatvic.com/blog/enhanced-ecommerce/' target='_blank'>Know more about Enhanced Ecommerce.</a><br/><br/><b>Quick Tip:</b> We also have an Advanced Google Analytics Plugin for WooCommerce! The plugin offers tracking of 9 Reports of Enhanced Ecommerce, User ID Tracking, Add Google Optimize Snippet, 15+ Custom Dimenensions & Metrics, Content Grouping & much more. <a href='https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic' target='_blank'>Learn More</a>", "woocommerce");
32
-
33
  //session for product position count
34
  //session_start inserted bcoz it gives warning
35
  if (session_status() == PHP_SESSION_NONE) {
@@ -37,62 +61,43 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
37
  }
38
  $_SESSION['t_npcnt']=0;
39
  $_SESSION['t_fpcnt']=0;
40
- // Load the integration form
41
- $this->init_form_fields();
42
- //load all the settings
43
- $this->init_settings();
44
-
45
- // Define user set variables -- Always use short names
46
  $this->tvc_aga = $this->get_option("tvc_aga");
47
  $this->ga_id = $this->get_option("ga_id");
48
- $this->ga_Dname = $this->get_option("ga_Dname");
49
- $this->ga_LC = get_woocommerce_currency(); //Local Currency yuppi! Got from Back end
50
- //set local currency variable on all page
51
- $this->wc_version_compare("tvc_lc=" . json_encode($this->ga_LC) . ";");
52
  $this->ga_ST = $this->get_option("ga_ST");
53
- $this->ga_gCkout = $this->get_option("ga_gCkout") == "yes" ? true : false; //guest checkout
54
- $this->ga_gUser = $this->get_option("ga_gUser") == "yes" ? true : false; //guest checkout
55
  $this->ga_eeT = $this->get_option("ga_eeT");
56
- $this->ga_DF = $this->get_option("ga_DF") == "yes" ? true : false;
57
  $this->ga_imTh = $this->get_option("ga_imTh") == "" ? 6 : $this->get_option("ga_imTh");
58
- $this->ga_OPTOUT = $this->get_option("ga_OPTOUT") == "yes" ? true : false; //Google Analytics Opt Out
59
- $this->ga_PrivacyPolicy = $this->get_option("ga_PrivacyPolicy") == "yes" ? true : false;
60
- $this->ga_IPA = $this->get_option("ga_IPA") == "yes" ? true : false; //IP Anony.
61
- //Save Changes action for admin settings
62
- add_action("woocommerce_update_options_integration_" . $this->id, array($this, "process_admin_options"));
63
-
64
- // API Call to LS with e-mail
65
- // Tracking code
66
- add_action("wp_head", array($this, "ee_settings"));
67
-
68
- add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
69
-
70
- // Enhanced Ecommerce product impression hook
71
- add_action("wp_footer", array($this, "t_products_impre_clicks"));
72
-
73
- add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata")); //for cat, shop, prod(related),search and home page
74
- add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
75
- add_action("woocommerce_after_cart", array($this, "remove_cart_tracking"));
76
- add_action("woocommerce_before_checkout_billing_form", array($this, "checkout_step_1_tracking"));
77
- add_action("woocommerce_after_checkout_billing_form", array($this, "checkout_step_2_tracking"));
78
- add_action("woocommerce_after_checkout_billing_form", array($this, "checkout_step_3_tracking"));
79
-
80
- // Event tracking code
81
- add_action("woocommerce_after_add_to_cart_button", array($this, "add_to_cart"));
82
-
83
- //Enable display feature code checkbox
84
- add_action("admin_footer", array($this, "admin_check_UA_enabled"));
85
-
86
- //add version details in footer
87
- add_action("wp_footer", array($this, "add_plugin_details"));
88
-
89
- //Add Dev ID
90
- add_action("wp_head", array($this, "add_dev_id"), 1);
91
-
92
- //Advanced Store data Tracking
93
- add_action("wp_footer", array($this, "tvc_store_meta_data"));
94
-
95
  }
 
 
 
 
 
 
 
 
 
 
 
 
96
  /**
97
  * Get store meta data for trouble shoot
98
  * @access public
@@ -140,34 +145,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
140
  function add_plugin_details() {
141
  echo '<!--Enhanced Ecommerce Google Analytics Plugin for Woocommerce by Tatvic Plugin Version:'.$this->tvc_eeVer.'-->';
142
  }
143
- /**
144
- * check UA is enabled or not
145
- *
146
- * @access public
147
- */
148
- function admin_check_UA_enabled() {
149
-
150
- if(isset($_GET['tab']) && $_GET['tab'] =='integration' ){
151
-
152
- echo '<script>
153
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_ST").change(function(){
154
- t_ga_chk=jQuery(this).is(":checked");
155
-
156
- if(t_ga_chk){
157
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").removeAttr("disabled");
158
- }else{
159
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").attr("disabled",true);
160
- t_display_chk=jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").is(":checked");
161
- if(t_display_chk){
162
- jQuery("#woocommerce_enhanced_ecommerce_google_analytics_ga_DF").removeAttr("checked");
163
- } }
164
- });
165
- //Pugin Promotion
166
- jQuery("form#mainform").after("<a href=https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic target=_blank><img src='.plugins_url( '/aga_premium.png' , __FILE__ ).' title=Actionable Google Analytics Plugin by Tatvic alt=Actionable Google Analytics Plugin by Tatvic></a>");
167
- </script>';
168
- }
169
- }
170
-
171
  /**
172
  * Check if tracking is disabled
173
  *
@@ -176,7 +154,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
176
  * @return bool
177
  */
178
  private function disable_tracking($type) {
179
- if (is_admin() || current_user_can("manage_options") || (!$this->ga_id ) || "no" == $type) {
180
  return true;
181
  }
182
  }
@@ -206,7 +184,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
206
  global $woocommerce;
207
 
208
  //common validation----start
209
- if (is_admin() || current_user_can("manage_options") || $this->ga_ST == "no") {
210
  return;
211
  }
212
  $tracking_id = $this->ga_id;
@@ -215,12 +193,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
215
  return;
216
  }
217
  //common validation----end
218
-
219
- if (!empty($this->ga_Dname)) {
220
- $set_domain_name = esc_js($this->ga_Dname);
221
- } else {
222
  $set_domain_name = "auto";
223
- }
224
  // IP Anonymization
225
  if ($this->ga_IPA) {
226
  $ga_ip_anonymization = '"anonymize_ip":true,';
@@ -242,7 +215,7 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
242
  function gaOptout() {
243
  var expDate = new Date;
244
  expDate.setMonth(expDate.getMonth() + 26);
245
- document.cookie = disableStr + "=true; expires="+expDate.toGMTString();+"path=/";
246
  window[disableStr] = true;
247
  }
248
  </script>';
@@ -257,96 +230,6 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
257
  ';
258
  echo $code;
259
  }
260
-
261
- /**
262
- * Initialise Settings Form Fields
263
- *
264
- * @access public
265
- * @return void
266
- */
267
- function init_form_fields() {
268
- $this->form_fields = array(
269
- "ga_id" => array(
270
- "title" => __("Google Analytics ID", "woocommerce"),
271
- "description" => __("Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g.<code>UA-XXXXX-X</code>", "woocommerce"),
272
- "type" => "text",
273
- "placeholder" => "UA-XXXXX-X",
274
- "desc_tip" => true,
275
- "default" => get_option("ga_id") // Backwards compat
276
- ),
277
- "ga_Dname" => array(
278
- "title" => __("Set Domain Name", "woocommerce"),
279
- "description" => sprintf(__("Enter your domain name here (Optional)")),
280
- "type" => "text",
281
- "placeholder" => "",
282
- "desc_tip" => true,
283
- "default" => get_option("ga_Dname") ? get_option("ga_Dname") : "auto"
284
- ),
285
- "ga_ST" => array(
286
- "title" => __("Tracking code", "woocommerce"),
287
- "label" => __("Add Global Site Tracking Code 'gtag.js' (Optional)", "woocommerce"),
288
- "description" => sprintf(__("This feature adds New gtag.js Tracking Code to your Store. You don't need to enable this if gtag.js implemented via a 3rd party analytics plugin.", "woocommerce")),
289
- "type" => "checkbox",
290
- "checkboxgroup" => "start",
291
- "desc_tip" => true,
292
- "default" => get_option("ga_ST") ? get_option("ga_ST") : "no" // Backwards compat
293
- ),
294
- "ga_eeT" => array(
295
- "label" => __("Add Enhanced Ecommerce Tracking Code", "woocommerce"),
296
- "type" => "checkbox",
297
- "checkboxgroup" => "",
298
- "desc_tip" => true,
299
- "description" => sprintf(__("This feature adds Enhanced Ecommerce Tracking Code to your Store", "woocommerce")),
300
- "default" => get_option("ga_eeT") ? get_option("ga_eeT") : "no" // Backwards compat
301
- ),
302
- "ga_gUser" => array(
303
- "label" => __("Add Code to Track the Login Step of Guest Users (Optional)", "woocommerce"),
304
- "type" => "checkbox",
305
- "checkboxgroup" => "",
306
- "desc_tip" => true,
307
- "description" => sprintf(__("If you have Guest Check out enable, we recommend you to add this code", "woocommerce")),
308
- "default" => get_option("ga_gUser") ? get_option("ga_gUser") : "no" // Backwards compat
309
- ),
310
- "ga_imTh" => array(
311
- "title" => __("Impression Threshold", "woocommerce"),
312
- "description" => sprintf(__("This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions", "woocommerce")),
313
- "type" => "number",
314
- "desc_tip" => true,
315
- "css"=>"width:112px !important;",
316
- 'custom_attributes' => array(
317
- 'min' => "1",
318
- ),
319
- "default" => get_option("ga_imTh") ? get_option("ga_imTh") : "6" // Backwards compat
320
- ),
321
- "ga_IPA" => array(
322
- "title" => __("IP Anonymization", "woocommerce"),
323
- "label" => __("Enable IP Anonymization (Optional)", "woocommerce"),
324
- "type" => "checkbox",
325
- "checkboxgroup" => "",
326
- "description" => sprintf(__("Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance", "woocommerce")),
327
- "default" => get_option("ga_IPA") ? get_option("ga_IPA") : "no" // Backwards compat
328
- ),
329
- "ga_OPTOUT" => array(
330
- "title" => __("Google Analytics Opt Out", "woocommerce"),
331
- "label" => __("Enable Google Analytics Opt Out (Optional)", "woocommerce"),
332
- "type" => "checkbox",
333
- "checkboxgroup" => "",
334
- "description" => sprintf(__("Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the <a href='http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf' target='_blank' >documentation</a> to check the setup", "woocommerce")),
335
- "default" => get_option("ga_OPTOUT") ? get_option("ga_OPTOUT") : "no" // Backwards compat
336
- ),
337
- "ga_PrivacyPolicy" => array(
338
- "title" => __("Privacy Policy", "woocommerce"),
339
- "label" => __("Accept Privacy Policy of Plugin", "woocommerce"),
340
- "type" => "checkbox",
341
- "checkboxgroup" => "",
342
- 'custom_attributes' => array(
343
- 'required' => "required",
344
- ),
345
- "description" => sprintf(__("By using Tatvic Plugin, you agree to Tatvic plugin's <a href='https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woocommerce_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins' target='_blank'>Privacy Policy</a>", "woocommerce")),
346
- "default" => get_option("ga_PrivacyPolicy") ? get_option("ga_PrivacyPolicy") : "no" // Backwards compat
347
- ),
348
- );
349
- }
350
 
351
  /**
352
  * Google Analytics eCommerce tracking
@@ -1301,4 +1184,3 @@ class WC_Enhanced_Ecommerce_Google_Analytics extends WC_Integration {
1301
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1302
  }
1303
  }
1304
- ?>
1
  <?php
2
 
3
  /**
4
+ * The public-facing functionality of the plugin.
5
  *
6
+ * @link tatvic.com
7
+ * @since 1.0.0
8
  *
9
+ * @package Enhanced_Ecommerce_Google_Analytics
10
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/public
 
11
  */
 
12
 
13
+ /**
14
+ * The public-facing functionality of the plugin.
15
+ *
16
+ * Defines the plugin name, version, and two examples hooks for how to
17
+ * enqueue the public-facing stylesheet and JavaScript.
18
+ *
19
+ * @package Enhanced_Ecommerce_Google_Analytics
20
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
+ * @author Chiranjiv Pathak <chiranijv@tatvic.com>
22
+ */
23
+ class Enhanced_Ecommerce_Google_Analytics_Public {
24
+ /**
25
  * Init and hook in the integration.
26
  *
27
  * @access public
28
  * @return void
29
  */
30
  //set plugin version
31
+ public $tvc_eeVer = '2.1.0';
32
+
33
+ protected $tvc_aga;
34
+
35
+ protected $ga_id;
36
+
37
+ protected $ga_LC;
38
+
39
+ protected $ga_ST;
40
+
41
+ protected $ga_gCkout;
42
+
43
+ protected $ga_eeT;
44
+
45
+ protected $ga_DF;
46
+
47
+ protected $ga_imTh;
48
+
49
+ protected $ga_OPTOUT;
50
+
51
+ protected $ga_PrivacyPolicy;
52
+
53
+ protected $ga_IPA;
54
+ public function __construct($plugin_name, $version) {
55
 
56
+
 
 
 
 
 
 
 
 
57
  //session for product position count
58
  //session_start inserted bcoz it gives warning
59
  if (session_status() == PHP_SESSION_NONE) {
61
  }
62
  $_SESSION['t_npcnt']=0;
63
  $_SESSION['t_fpcnt']=0;
64
+ // Define user set variables -- Always use short names
65
+ $this->plugin_name = $plugin_name;
66
+ $this->version = $version;
 
 
 
67
  $this->tvc_aga = $this->get_option("tvc_aga");
68
  $this->ga_id = $this->get_option("ga_id");
 
 
 
 
69
  $this->ga_ST = $this->get_option("ga_ST");
70
+ $this->ga_gCkout = $this->get_option("ga_gCkout") == "on" ? true : false; //guest checkout
71
+ $this->ga_gUser = $this->get_option("ga_gUser") == "on" ? true : false; //guest checkout
72
  $this->ga_eeT = $this->get_option("ga_eeT");
73
+ $this->ga_DF = $this->get_option("ga_DF") == "on" ? true : false;
74
  $this->ga_imTh = $this->get_option("ga_imTh") == "" ? 6 : $this->get_option("ga_imTh");
75
+ $this->ga_OPTOUT = $this->get_option("ga_OPTOUT") == "on" ? true : false; //Google Analytics Opt Out
76
+ $this->ga_PrivacyPolicy = $this->get_option("ga_PrivacyPolicy") == "on" ? true : false;
77
+ $this->ga_IPA = $this->get_option("ga_IPA") == "on" ? true : false; //IP Anony.
78
+ if (is_admin() ) {
79
+ return;
80
+ }
81
+ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
82
+ // Put your plugin code here
83
+ add_action('woocommerce_init' , function (){
84
+ $this->ga_LC = get_woocommerce_currency(); //Local Currency from Back end
85
+ $this->wc_version_compare("tvc_lc=" . json_encode($this->ga_LC) . ";");
86
+ });
87
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
+
90
+ public function get_option($key){
91
+ $ee_options = array();
92
+
93
+ if(!empty(unserialize(get_option('ee_options')))){
94
+ $ee_options = unserialize(get_option('ee_options'));
95
+ }
96
+ $ee_admin_settings = array_merge($ee_options);
97
+ if(isset($ee_options[$key])){
98
+ return $ee_options[$key];
99
+ }
100
+ }
101
  /**
102
  * Get store meta data for trouble shoot
103
  * @access public
145
  function add_plugin_details() {
146
  echo '<!--Enhanced Ecommerce Google Analytics Plugin for Woocommerce by Tatvic Plugin Version:'.$this->tvc_eeVer.'-->';
147
  }
148
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  /**
150
  * Check if tracking is disabled
151
  *
154
  * @return bool
155
  */
156
  private function disable_tracking($type) {
157
+ if (is_admin() || (!$this->ga_id ) || "" == $type) {
158
  return true;
159
  }
160
  }
184
  global $woocommerce;
185
 
186
  //common validation----start
187
+ if (is_admin() || $this->ga_ST == "") {
188
  return;
189
  }
190
  $tracking_id = $this->ga_id;
193
  return;
194
  }
195
  //common validation----end
 
 
 
 
196
  $set_domain_name = "auto";
 
197
  // IP Anonymization
198
  if ($this->ga_IPA) {
199
  $ga_ip_anonymization = '"anonymize_ip":true,';
215
  function gaOptout() {
216
  var expDate = new Date;
217
  expDate.setMonth(expDate.getMonth() + 26);
218
+ document.cookie = disableStr + "=true; expires="+expDate.toGMTString()+";path=/";
219
  window[disableStr] = true;
220
  }
221
  </script>';
230
  ';
231
  echo $code;
232
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
  /**
235
  * Google Analytics eCommerce tracking
1184
  $this->wc_version_compare("tvc_ch=" . json_encode($chkout_json) . ";");
1185
  }
1186
  }
 
public/css/enhanced-ecommerce-google-analytics-public.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ /**
2
+ * All of the CSS for your public-facing functionality should be
3
+ * included in this file.
4
+ */
public/index.php ADDED
@@ -0,0 +1 @@
 
1
+ <?php // Silence is golden
public/js/enhanced-ecommerce-google-analytics-public.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function( $ ) {
2
+ 'use strict';
3
+
4
+ /**
5
+ * All of the code for your public-facing JavaScript source
6
+ * should reside in this file.
7
+ *
8
+ * Note: It has been assumed you will write jQuery code here, so the
9
+ * $ function reference has been prepared for usage within the scope
10
+ * of this function.
11
+ *
12
+ * This enables you to define handlers, for when the DOM is ready:
13
+ *
14
+ * $(function() {
15
+ *
16
+ * });
17
+ *
18
+ * When the window is loaded:
19
+ *
20
+ * $( window ).load(function() {
21
+ *
22
+ * });
23
+ *
24
+ * ...and/or other possibilities.
25
+ *
26
+ * Ideally, it is not considered best practise to attach more than a
27
+ * single DOM-ready or window-load handler for a particular page.
28
+ * Although scripts in the WordPress core, Plugins and Themes may be
29
+ * practising this, we should strive to set a better example in our own work.
30
+ */
31
+
32
+ })( jQuery );
public/partials/class-enhanced-ecommerce-google-analytics-public-display.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Provide a public-facing view for the plugin
5
+ *
6
+ * This file is used to markup the public-facing aspects of the plugin.
7
+ *
8
+ * @link tatvic.com
9
+ * @since 1.0.0
10
+ *
11
+ * @package Enhanced_Ecommerce_Google_Analytics
12
+ * @subpackage Enhanced_Ecommerce_Google_Analytics/public/partials
13
+ */
14
+ ?>
15
+
16
+ <!-- This file should primarily consist of HTML with a little bit of PHP. -->
readme.txt CHANGED
@@ -1,302 +1,322 @@
1
- === Enhanced Ecommerce Google Analytics Plugin for WooCommerce ===
2
- Contributors: Tatvic
3
- Plugin Name: Enhanced Ecommerce for Woocommerce store
4
- Plugin URI: http://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
- Tags: Google Analytics, Universal Analytics, Enhanced E-commerce, E-commerce, e-commerce, woo-commerce,Ecommerce,woocommerce, commerce, Wordpress Enhanced Ecommerce, Woocommerce Enhanced Ecommerce, Woocommerce Google Analytics, Google Analytics Plugin, Enhanced Ecommerce Plugin
6
- Author URI: http://www.tatvic.com/
7
- Author: Tatvic
8
- Requires at least: 3.6
9
- Tested up to: 4.9
10
- Stable tag: 2.0.3
11
- Version: 2.0.3
12
- License: GPLv3
13
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
-
15
- Provides integration between Enhanced Ecommerce feature of Google Analytics and WooCommerce.
16
-
17
- == Description ==
18
- <a href="http://www.tatvic.com/enhanced-ecommerce-google-analytics-plugin-woocommerce/">Enhanced Ecommerce Google Analytics</a> is a Free Plugin for Woocommerce stores which allows you to use the newly launched feature of Google Analytics – Enhanced Ecommerce.You can track the user behavior across your e-commerce store starting from product views to thank you page. Enhanced Ecommerce is only supported by Universal Analytics.
19
-
20
- = Features of Plugin =
21
- 1. Quick & Easy installation from the wordpress interface
22
- 2. Supports four New Reports in Enhanced Ecommerce
23
- * Shopping Behaviour Report
24
- * Checkout Behaviour Report
25
- * Product Performance Report
26
- * Sales Performance Report
27
- 3. Supports Guest checkout functionality
28
- 4. Supports Display Advertising Feature
29
- 5. Captures Product Impressions, Add to Cart & Product Clicks events on category page
30
- 6. Captures Product Impressions, Add to Cart & Product Clicks events on product page
31
- 7. Captures Product Impressions, Add to Cart & Product Clicks events on featured Product Section on Homepage
32
- 8. Captures Product Impressions, Add to Cart & Product Clicks events on Recent Product Section on Homepage
33
- 9. Captures Product Impressions, Add to Cart & Product Clicks events on Related Product Section on Productpage
34
- 10. Set your local currency
35
- 11. Google Analytics Opt Out
36
- 12. IP Anonymization
37
-
38
-
39
- = Installation Instructions =
40
- * Enable Enhanced E-commerce for your profile/view. This is a profile / view level setting and can be accessed under Admin > View > E-commerce Settings
41
-
42
- * Add meaningful labels for your checkout steps. We recommend you to label as, Step 1 : Checkout View; Step 2 : Billing Info; Step 3 : Proceed to payment
43
-
44
- * Activate our plug-in from the Settings page. You can access the setting page from here WooCommerce -> Settings ->Integration ->Enhanced Ecommerce Google Analytics.
45
-
46
- * Find “Add Enhanced Ecommerce Tracking Code” in the settings page and check the box to add the tracking code
47
-
48
- * If you have a guest checkout on your WooCommerce store, then Check the box “Add Code to Track the Login Step of Guest Users”. If you have a guest login but you do not check the box, then it might cause an uneven funnel reporting in Google Analytics.
49
-
50
- * All the product sections on homepage other than feature product will be fired as Recent Product and will be available in product list performance report.
51
-
52
- * All the product sections on product page will be fired as Related Product and will be available in product list performance report.
53
-
54
- = Need an Advanced Google Analytics Plugin? =
55
- We have an Advanced Google Analytics Plugin for WooCommerce which includes tracking of 9 Reports of Enhanced Ecommerce, User ID Tracking, Product Refund, I.P. Anonymization, 15+ Custom Dimenensions & Metrics, Form Field Tracking, Content Grouping, Google Optimize & much more. <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">Learn More</a>
56
-
57
- == Note : ==
58
- == Our plugin does not support the below features out of the box ==
59
- * Highly Customized store
60
- * Product types other than Simple Product
61
- * Store with the Subscription product for Orders.
62
- * Ecommerce Pages with Shortcodes
63
- * Not fully compatible with the child/custom Theme
64
-
65
- == Installation ==
66
- 1. Download the plugin file to your computer and unzip it
67
- 2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation’s wp-content/plugins/ directory
68
- 3. Activate the plugin from the Plugins menu within the WordPress admin
69
- 4. Enter your Universal Analytics ID for the plugin to enable the tracking code
70
-
71
- == Screenshots ==
72
- 1. Enable Enhanced E-commerce for your profile/view. This is a profile / view level setting and can be accessed under Admin > View > E-commerce Settings. Also, add meaningful labels for your checkout steps. We recommend you to label as, Step 1 : Checkout View; Step 2 : Login; Step 3 : Proceed to payment;
73
- 2. Next, you need to activate your plugin from the Settings page by clicking the checkbox – “Add Enhanced Ecommerce Tracking Code". You can access the same from: WooCommerce > Settings > Integration > Enhanced Ecommerce Google Analytics.
74
- 3. To Track Guest Users, Check the box – Add Code to Track the Login Steps of Guest Users. If you have a Guest Check out & if it’s Unchecked, then it might cause an uneven funnel reporting in Google Analytics.
75
-
76
- == Frequently Asked Questions ==
77
- = Where can I find the setting for this plugin? =
78
-
79
- This plugin will add the settings to the Integration tab, to be found in the WooCommerce > Settings menu.
80
-
81
- = Does this conflict with the WooCommerce? =
82
-
83
- Starting the WooCommerce 2.1 release there are no conflicts. However for earlier the plugin might conflict with the default Google Analytics integration for WooCommerce.
84
-
85
- = Do I Need to add any custom code for it? =
86
-
87
- As our plugin automatically tracks all the Enhanced Ecommerce data ( including product name, price, etc dynamically) for your store, you don't need to add any custom/manual code to trackEcommerce events on your store from your end.
88
-
89
- = Does this plugin match with GDPR compliance? =
90
-
91
- Yes, our plugin is under GDPR complaince. For more information, read the <a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woocommerce_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">privacy policy</a> of our plugin.
92
-
93
- = Why are my PayPal transaction data not getting recorded in GA? =
94
-
95
- If you are facing this issue, please check if you have configured auto return in PayPal settings. Configuring auto return will resolve your issue. Here’s a PayPal <a href="https://www.paypal.com/in/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside" target="_blank">documentation</a> & WooCommerce <a href="http://docs.woothemes.com/document/paypal-standard/#section-5" target="_blank">documentation</a> on understanding & setting up Auto Return.
96
-
97
- In case you have already configured auto return for your store, we request you to create a new support thread <a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">here</a> & reach out to us.
98
-
99
- = I’ve install the plugin but I do not see any data in my GA =
100
-
101
- Following are one or more reasons:
102
-
103
- * Please make sure that you have Enabled Enhanced Ecommerce setting in your GA Account. Check out the Step 1 of this <a href="http://www.tatvic.com/blog/enhanced-ecommerce/#steps" target="_blank">blogpost</a>.
104
-
105
- * If you have just installed our plugin, then please wait for at-least 24 hours before you start seeing any data in your GA. If you still face this issue after 24 hours, please reach out to us via <a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">support thread</a>.
106
-
107
- = Since I have Implemented GA Script (UA tag) Via GTM, I didn't enable Add Global site Tracking Code option, but seems that it is not working. =
108
-
109
- When you have the UA script/tag implemented via your GTM, it may happen sometimes that the script might take/make any delay in loading on your store, due to which our plugin may not work well on your store.
110
-
111
- Reason :
112
-
113
- * Our Plugin's script works/fetches the data based on the GTAG's default tracker ('gtag' in the case of Universal Analytics script used in our plugin). While you implement the UA tracking script from your GTM, the script in your store may not be able to initialize the tracker, which in turn will hinder the plugin from populating insights in your Analytics account.
114
-
115
- = Does your plugin supports new Global Site Tag (gtag.js)? =
116
-
117
- Yes our plugin supports new Global Site Tag (gtag.js).
118
-
119
- = Since I have Implemented Old GA Script (UA Script) Manually in my store, I didn't enable Add Global site Tracking Code option gtag.js, but seems that it is not working. =
120
-
121
- When you have the Old UA script implemented Manually in your store, it is not working with our plugin.
122
-
123
- Reason :
124
-
125
- * Our Plugin's script works/fetches the data based on the GTAG's default tracker ('gtag' in the case of Universal Analytics script used in our plugin). While you implement the Old UA tracking script manually, the script in your store may not be able to initialize the tracker, which in turn will hinder the plugin from populating insights in your Analytics account.
126
-
127
- = Where I can see my all Enhanced Ecommerce Reports (Eg. Sales Report,Product Performance Report)? =
128
-
129
- You can Find all The Enhanced Ecommerce Reports in your Analytics Account under Conversions --> Ecommerce.
130
-
131
- = Products with variant not getting recorded in GA =
132
-
133
- Currently our plugin does not support products with variant & hence you may not see their transaction data in GA. This feature is only available with the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin.
134
-
135
- = I have noticed that some transactions are missing in my GA account, compared to my Woocmmerce backend (Orders) =
136
-
137
- Possible reasons for not getting the accurate Transactions (in sales performance report) are as below :
138
-
139
- * If a user completes the transaction via a 3rd party payment gateway and is not redirected back to your store’s thank you page.
140
-
141
- * If any javascript error is detected on the "thank you" page of your store which may restrict plugin's code to get executed further.
142
-
143
- * Some browsers and common ad blocking programs block certain JavaScripts
144
- (including GA's script), which means Google Analytics is unable to record transactions.
145
-
146
- * The user has left the page before the transaction has had a chance to send to Google Analytics.
147
-
148
- Additionally, GA is a trend analysis tool, and as such cannot be expected to be 100% accurate. However, if the variance is greater than 12%, we request you to contact us!
149
-
150
- = My Ecommerce transaction data are not getting recorded in GA =
151
-
152
- Please check if you have auto return configured in your payment gateway settings. If a user completes the transaction via a 3rd party payment gateway and is not redirected back to your store’s thank you page, our plugin will not be able to send the transaction data.
153
-
154
- Hence, this may result into missing transaction data in your GA. You can resolve this issue by configuring auto return in your payment gateway settings.
155
-
156
- = Does this plugin help me create/configure goals/funnels in my GA account? =
157
-
158
- Configuring goals are out of the scope of our plugin. Our plugin is designed to track checkout funnels only.
159
-
160
- = Does your Plugin support Product Refund? =
161
-
162
- Our existing plugin does not track product refund data, however you can buy our <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium plugin</a> to get access to product Refund data
163
-
164
- = Does your plugin supports Multilingual Wordpress site? =
165
-
166
- Our plugin does not support Multilingual Wordpress site.
167
-
168
- = Does your plugin supports Child/Custom Theme? =
169
-
170
- The free version of our plugin is not fully compatible with the child/custom theme. Request you to go through the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin which is fully compatible with the child/custom theme. We are not providing any kind of support for Child/Custom Theme in the Free version of our plugin. For more information kindly contact us at analytics2(at)tatvic(dot)com.
171
-
172
- = Have you Provided Full support for the free version plugin? =
173
-
174
- We have a limited support policy for the free version of our plugin. Kindly go through the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin to get full support for the product or you can also contact us at analytics2(at)tatvic(dot)com.
175
-
176
- = How to verify if you have implemented the Plugin well? =
177
-
178
- To verify if you have implemented the plugin well, just log in to your Google Analytics account & check if the data is coming well in your Enhanced Ecommerce Reports.
179
-
180
- = How much time will it take to see the data in Google Analytics? =
181
-
182
- It generally depends upon the traffic of the store. But in general it may take max up to 24 hours & min 4 hours to see the data in Google Analytics.
183
-
184
- = Why the plugin does not sent data when I am logged in as Admin? =
185
-
186
- To avoid sending your own transaction data or sessions data in Google Analytics, our plugin doesn't sent the data to GA when you are logged in. Having said, if you are logged in as Shop Manager, plugin will send the data to GA.
187
-
188
- == Changelog ==
189
-
190
- = 1.0 - 25/06/2014 =
191
- * Initial release
192
-
193
- = 1.0.6.1 - 15/08/2014 =
194
- * Added new feature - Product impressions and Product click on category page view , including the default pagination
195
- * Fixed-Allow Special Characters in javascript
196
-
197
- = 1.0.7 - 28/08/2014 =
198
- * Added new feature - Display Advertising Feature
199
- * Fixed-Allow back quotes and single quotes in product name, category name etc.
200
-
201
- = 1.0.8 - 09/09/2014 =
202
- * Fixed- Minor bugs
203
-
204
- = 1.0.9.1 - 09/11/2014 =
205
- * Fixed- Minor bug on order page
206
-
207
- = 1.0.10 - 26/09/2014 =
208
- * Allows user to set local currency
209
- * Captures Impressions, Product Clicks and Add to Cart on Featured Product section and Recent Product section on Homepage
210
- * Captures Impressions, Product Clicks and Add to Cart on Related Product section on Product Page
211
-
212
- = 1.0.11 - 28/10/2014 =
213
- * Fixed - Minor bugs
214
-
215
- = 1.0.12 - 19/11/2014 =
216
- * Fixed - Settings not getting saved on few stores
217
- * Fixed - Broken layout issue
218
-
219
- Important Note: When you update the plugin, please save your settings again.
220
-
221
- = 1.0.13 - 19/12/2014 =
222
- * Currency as field removed from the plugin. Reason: we now automatically passed the currency which you may have set in WooCommerce store
223
- * Fixed - Minor bugs
224
-
225
- = 1.0.14 - 10/02/2015 =
226
- * Fixed - session_start() function warning
227
- * Fixed - Notice: Undefined variable: coupons_list
228
- * Fixed - woocommerce deprecated function warning
229
-
230
- = 1.0.15 - 28/03/2015 =
231
- * Email Field made optional
232
-
233
- = 1.0.16 - 01/04/2015 =
234
- * Minor Bug Fixes as per Wordpress Guidlines
235
-
236
- = 1.0.17 - 19/02/2016 =
237
- * Fixed - Notice: Undefined index: tab
238
- * Minor Bug Fixes as per Wordpress Guidlines
239
-
240
- = 1.0.18 - 11/04/2016 =
241
- * Fixed - Compatibility with Google Tag Manager for Wordpress by DuracellTomi
242
-
243
- = 1.0.19 - 21/12/2016 =
244
- * Fixed - Compatibility with Wordpress 4.7 & Woocommerce 2.6.x
245
- * Minor Bug Fixes.
246
-
247
- = 1.0.20 - 14/04/2017 =
248
- * Fixed - Compatibility with Woocommerce 3.x
249
- * Minor Bug Fixes.
250
-
251
- = 1.0.21 - 12/05/2017 =
252
- * Minor Bug Fixes.
253
-
254
- = 1.0.21.1 - 13/07/2017 =
255
- * Minor Changes.
256
-
257
- = 1.1.0 - 08/08/2017 =
258
- * Minor Bug Fixes & Optimization.
259
-
260
- = 1.1.1 - 04/09/2017 =
261
- * Minor Optimization on Order-Received Page.
262
-
263
- = 1.1.2 - 04/09/2017 =
264
- * Quick Fix of Minor Bugs.
265
-
266
- = 1.2.0 - 17/10/2017 =
267
- * Compatibility with Woocommerce 3.2
268
- * Minor Bug Fixes & Optimization.
269
-
270
- = 1.2.0.1 - 06/11/2017 =
271
- * Quick Bug Fixes.
272
-
273
- = 1.2.1 - 12/12/2017 =
274
- * Improvisation for Product Page
275
- * Minor Bug Fixes
276
-
277
- = 1.2.1.1 - 20/12/2017 =
278
- * Quick Fixes for Product Page & ATC
279
- * Minor Bug Fixes
280
-
281
- = 1.2.1.2 - 26/12/2017 =
282
- * Minor Fixes
283
-
284
- = 1.2.2 - 31/01/2018 =
285
- * Compatibility with Woocommerce 3.3
286
- * Minor Bug Fixes & Optimization.
287
-
288
- = 2.0.0 - 07/03/2018 =
289
- * New Implementation with Global Site Tag (gtag.js)
290
- * gtag.js supported
291
- * Minor Bug Fixes & Optimization.
292
-
293
- = 2.0.1 - 24/04/2018 =
294
- * Minor Bug Fixes & Optimization.
295
-
296
- = 2.0.2 - 23/05/2018 =
297
- * IP Anonymization Feature
298
- * Google Analytics Opt Out
299
- * Update the Privacy Policy under GDPR Compliance
300
-
301
- = 2.0.3 - 04/06/2018 =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
302
  * Minor Bug Fixes
1
+ === Enhanced Ecommerce Google Analytics Plugin for WooCommerce ===
2
+ Contributors: Tatvic
3
+ Plugin Name: Enhanced Ecommerce for Woocommerce store
4
+ Plugin URI: http://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
+ Tags: Google Analytics, Universal Analytics, Enhanced E-commerce, E-commerce, e-commerce, woo-commerce,Ecommerce,woocommerce, commerce, Wordpress Enhanced Ecommerce, Woocommerce Enhanced Ecommerce, Woocommerce Google Analytics, Google Analytics Plugin, Enhanced Ecommerce Plugin
6
+ Author URI: https://www.tatvic.com/
7
+ Author: Tatvic
8
+ Requires at least: 3.6
9
+ Tested up to: 4.9
10
+ Stable tag: 2.1.0
11
+ Version: 2.1.0
12
+ License: GPLv3
13
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
14
+
15
+ Provides integration between Enhanced Ecommerce feature of Google Analytics and WooCommerce.
16
+
17
+ == Description ==
18
+ <a href="https://www.tatvic.com/enhanced-ecommerce-google-analytics-plugin-woocommerce/" target="_blank">Enhanced Ecommerce Google Analytics</a> is a Free Plugin for Woocommerce stores which allows you to use the newly launched feature of Google Analytics – Enhanced Ecommerce.You can track the user behavior across your e-commerce store starting from product views to thank you page. Enhanced Ecommerce is only supported by Universal Analytics.
19
+
20
+ == Note : ==
21
+ == For the Latest Release must follow <a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#installation" target="_blank" >these</a>installation instruction. Also Go through the <a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank" > documentation </a>First ==
22
+
23
+ = Features of Plugin =
24
+ 1. Quick & Easy installation from the wordpress interface
25
+ 2. Supports four New Reports in Enhanced Ecommerce
26
+ * Shopping Behaviour Report
27
+ * Checkout Behaviour Report
28
+ * Product Performance Report
29
+ * Sales Performance Report
30
+ 3. Supports Guest checkout functionality
31
+ 4. Captures Product Impressions, Add to Cart & Product Clicks events on category page
32
+ 5. Captures Product Impressions, Add to Cart & Product Clicks events on product page
33
+ 6. Captures Product Impressions, Add to Cart & Product Clicks events on featured Product Section on Homepage
34
+ 7. Captures Product Impressions, Add to Cart & Product Clicks events on Recent Product Section on Homepage
35
+ 8. Captures Product Impressions, Add to Cart & Product Clicks events on Related Product Section on Productpage
36
+ 9. Set your local currency
37
+ 10. Google Analytics Opt Out
38
+ 11. IP Anonymization
39
+
40
+
41
+ = Installation Instructions =
42
+ * Enable Enhanced E-commerce for your profile/view. This is a profile / view level setting and can be accessed under Admin > View > E-commerce Settings
43
+
44
+ * Add meaningful labels for your checkout steps. We recommend you to label as, Step 1 : Checkout View; Step 2 : Billing Info; Step 3 : Proceed to payment
45
+
46
+ * Activate our plug-in from the Settings page. You can access the setting page from sidebar Tatvic EE Plugin > Enhanced Ecommerce for Woocommerce.
47
+
48
+ * Find “Add Enhanced Ecommerce Tracking Code in the settings page and check the box to add the tracking code
49
+
50
+ * If you have a guest checkout on your WooCommerce store, then Check the box “Add Code to Track the Login Step of Guest Users”. If you have a guest login but you do not check the box, then it might cause an uneven funnel reporting in Google Analytics.
51
+
52
+
53
+ = Need an Advanced Google Analytics Plugin? =
54
+ We have an Advanced Google Analytics Plugin for WooCommerce which includes tracking of 9 Reports of Enhanced Ecommerce, User ID Tracking, Product Refund, I.P. Anonymization, Adwords Conversion Tracking, Facebook Pixel Tracking, 15+ Custom Dimenensions & Metrics & much more. <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">Learn More</a>
55
+
56
+ == Note : ==
57
+ == Our plugin does not support the below features out of the box ==
58
+ * Highly Customized store
59
+ * Product types other than Simple Product
60
+ * Store with the Subscription product for Orders.
61
+ * Ecommerce Pages with Shortcodes
62
+ * Not fully compatible with the child/custom Theme
63
+
64
+ == Installation ==
65
+ 1. Deactivate & Delete the Older version of the Plugin
66
+ 2. Download the new plugin file to your computer and unzip it
67
+ 3. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your WordPress installation’s wp-content/plugins/ directory
68
+ 4. Activate the plugin from the Plugins menu within the WordPress admin
69
+ 5. Enter your Universal Analytics ID for the plugin to enable the tracking code
70
+
71
+ == Screenshots ==
72
+ 1. Enable Enhanced E-commerce for your profile/view. This is a profile / view level setting and can be accessed under Admin > View > E-commerce Settings. Also, add meaningful labels for your checkout steps. We recommend you to label as, Step 1 : Checkout View; Step 2 : Login; Step 3 : Proceed to payment;
73
+ 2. Next, you need to activate your plugin from the Settings page by clicking the checkbox – “Add Enhanced Ecommerce Tracking Code". You can access the same from: Tatvic EE Plugin > Enhanced Ecommerce for Woocommerce.
74
+ 3. To Track Guest Users, Check the box – Add Code to Track the Login Steps of Guest Users. If you have a Guest Check out & if it’s Unchecked, then it might cause an uneven funnel reporting in Google Analytics.
75
+
76
+ == Frequently Asked Questions ==
77
+ = Where can I find the setting for this plugin? =
78
+
79
+ This plugin will add the settings to the Integration tab, to be found in the WooCommerce > Settings menu.
80
+
81
+ = Does this conflict with the WooCommerce? =
82
+
83
+ Starting the WooCommerce 2.1 release there are no conflicts. However for earlier the plugin might conflict with the default Google Analytics integration for WooCommerce.
84
+
85
+ = Getting Error After Updating with the Latest version of the Plugin 2.1.0 =
86
+
87
+ We have done the Major updates with the latest version so first you need to deactivate & delete the older version & add the latest version of the plugin again.
88
+
89
+ = Do I Need to add any custom code for it? =
90
+
91
+ As our plugin automatically tracks all the Enhanced Ecommerce data ( including product name, price, etc dynamically) for your store, you don't need to add any custom/manual code to trackEcommerce events on your store from your end.
92
+
93
+ = Does this plugin match with GDPR compliance? =
94
+
95
+ Yes, our plugin is under GDPR complaince. For more information, read the <a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woocommerce_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">privacy policy</a> of our plugin.
96
+
97
+ = Why are my PayPal transaction data not getting recorded in GA? =
98
+
99
+ If you are facing this issue, please check if you have configured auto return in PayPal settings. Configuring auto return will resolve your issue. Here’s a PayPal <a href="https://www.paypal.com/in/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside" target="_blank">documentation</a> & WooCommerce <a href="http://docs.woothemes.com/document/paypal-standard/#section-5" target="_blank">documentation</a> on understanding & setting up Auto Return.
100
+
101
+ In case you have already configured auto return for your store, we request you to create a new support thread <a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">here</a> & reach out to us.
102
+
103
+ = I’ve install the plugin but I do not see any data in my GA =
104
+
105
+ Following are one or more reasons:
106
+
107
+ * Please make sure that you have Enabled Enhanced Ecommerce setting in your GA Account. Check out the Step 1 of this <a href="http://www.tatvic.com/blog/enhanced-ecommerce/#steps" target="_blank">blogpost</a>.
108
+
109
+ * If you have just installed our plugin, then please wait for at-least 24 hours before you start seeing any data in your GA. If you still face this issue after 24 hours, please reach out to us via <a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">support thread</a>.
110
+
111
+ = Since I have Implemented GA Script (UA tag) Via GTM, I didn't enable Add Global site Tracking Code option, but seems that it is not working. =
112
+
113
+ When you have the UA script/tag implemented via your GTM, it may happen sometimes that the script might take/make any delay in loading on your store, due to which our plugin may not work well on your store.
114
+
115
+ Reason :
116
+
117
+ * Our Plugin's script works/fetches the data based on the GTAG's default tracker ('gtag' in the case of Universal Analytics script used in our plugin). While you implement the UA tracking script from your GTM, the script in your store may not be able to initialize the tracker, which in turn will hinder the plugin from populating insights in your Analytics account.
118
+
119
+ = Does your plugin supports new Global Site Tag (gtag.js)? =
120
+
121
+ Yes our plugin supports new Global Site Tag (gtag.js).
122
+
123
+ = Since I have Implemented Old GA Script (UA Script) Manually in my store, I didn't enable Add Global site Tracking Code option gtag.js, but seems that it is not working. =
124
+
125
+ When you have the Old UA script implemented Manually in your store, it is not working with our plugin.
126
+
127
+ Reason :
128
+
129
+ * Our Plugin's script works/fetches the data based on the GTAG's default tracker ('gtag' in the case of Universal Analytics script used in our plugin). While you implement the Old UA tracking script manually, the script in your store may not be able to initialize the tracker, which in turn will hinder the plugin from populating insights in your Analytics account.
130
+
131
+ = Where I can see my all Enhanced Ecommerce Reports (Eg. Sales Report,Product Performance Report)? =
132
+
133
+ You can Find all The Enhanced Ecommerce Reports in your Analytics Account under Conversions --> Ecommerce.
134
+
135
+ = Products with variant not getting recorded in GA =
136
+
137
+ Currently our plugin does not support products with variant & hence you may not see their transaction data in GA. This feature is only available with the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin.
138
+
139
+ = Does this plugin provide Adwords Conversion Tracking? =
140
+
141
+ The free version of our plugin does not provide Adwords Conversion Tracking feature. This feature is only available with the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin.
142
+
143
+ = Does this plugin provide Facebook Pixel Tracking? =
144
+
145
+ The free version of our plugin does not provide Facebook Pixel Tracking feature. This feature is only available with the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin.
146
+
147
+ = Does this plugin provide Google Optimize Snippet Adding Support? =
148
+
149
+ The free version of our plugin does not provide Google Optimize Snippet Adding Support. This feature is only available with the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin.
150
+
151
+ = I have noticed that some transactions are missing in my GA account, compared to my Woocmmerce backend (Orders) =
152
+
153
+ Possible reasons for not getting the accurate Transactions (in sales performance report) are as below :
154
+
155
+ * If a user completes the transaction via a 3rd party payment gateway and is not redirected back to your store’s thank you page.
156
+
157
+ * If any javascript error is detected on the "thank you" page of your store which may restrict plugin's code to get executed further.
158
+
159
+ * Some browsers and common ad blocking programs block certain JavaScripts
160
+ (including GA's script), which means Google Analytics is unable to record transactions.
161
+
162
+ * The user has left the page before the transaction has had a chance to send to Google Analytics.
163
+
164
+ Additionally, GA is a trend analysis tool, and as such cannot be expected to be 100% accurate. However, if the variance is greater than 12%, we request you to contact us!
165
+
166
+ = My Ecommerce transaction data are not getting recorded in GA =
167
+
168
+ Please check if you have auto return configured in your payment gateway settings. If a user completes the transaction via a 3rd party payment gateway and is not redirected back to your store’s thank you page, our plugin will not be able to send the transaction data.
169
+
170
+ Hence, this may result into missing transaction data in your GA. You can resolve this issue by configuring auto return in your payment gateway settings.
171
+
172
+ = Does this plugin help me create/configure goals/funnels in my GA account? =
173
+
174
+ Configuring goals are out of the scope of our plugin. Our plugin is designed to track checkout funnels only.
175
+
176
+ = Does your Plugin support Product Refund? =
177
+
178
+ Our existing plugin does not track product refund data, however you can buy our <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium plugin</a> to get access to product Refund data
179
+
180
+ = Does your plugin supports Multilingual Wordpress site? =
181
+
182
+ Our plugin does not support Multilingual Wordpress site.
183
+
184
+ = Does your plugin supports Child/Custom Theme? =
185
+
186
+ The free version of our plugin is not fully compatible with the child/custom theme. Request you to go through the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin which is fully compatible with the child/custom theme. We are not providing any kind of support for Child/Custom Theme in the Free version of our plugin. For more information kindly contact us at analytics2(at)tatvic(dot)com.
187
+
188
+ = Have you Provided Full support for the free version plugin? =
189
+
190
+ We have a limited support policy for the free version of our plugin. Kindly go through the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">premium version</a> of our plugin to get full support for the product or you can also contact us at analytics2(at)tatvic(dot)com.
191
+
192
+ = How to verify if you have implemented the Plugin well? =
193
+
194
+ To verify if you have implemented the plugin well, just log in to your Google Analytics account & check if the data is coming well in your Enhanced Ecommerce Reports.
195
+
196
+ = How much time will it take to see the data in Google Analytics? =
197
+
198
+ It generally depends upon the traffic of the store. But in general it may take max up to 24 hours & min 4 hours to see the data in Google Analytics.
199
+
200
+ = Why the plugin does not sent data when I am logged in as Admin? =
201
+
202
+ To avoid sending your own transaction data or sessions data in Google Analytics, our plugin doesn't sent the data to GA when you are logged in. Having said, if you are logged in as Shop Manager, plugin will send the data to GA.
203
+
204
+ == Changelog ==
205
+
206
+ = 1.0 - 25/06/2014 =
207
+ * Initial release
208
+
209
+ = 1.0.6.1 - 15/08/2014 =
210
+ * Added new feature - Product impressions and Product click on category page view , including the default pagination
211
+ * Fixed-Allow Special Characters in javascript
212
+
213
+ = 1.0.7 - 28/08/2014 =
214
+ * Added new feature - Display Advertising Feature
215
+ * Fixed-Allow back quotes and single quotes in product name, category name etc.
216
+
217
+ = 1.0.8 - 09/09/2014 =
218
+ * Fixed- Minor bugs
219
+
220
+ = 1.0.9.1 - 09/11/2014 =
221
+ * Fixed- Minor bug on order page
222
+
223
+ = 1.0.10 - 26/09/2014 =
224
+ * Allows user to set local currency
225
+ * Captures Impressions, Product Clicks and Add to Cart on Featured Product section and Recent Product section on Homepage
226
+ * Captures Impressions, Product Clicks and Add to Cart on Related Product section on Product Page
227
+
228
+ = 1.0.11 - 28/10/2014 =
229
+ * Fixed - Minor bugs
230
+
231
+ = 1.0.12 - 19/11/2014 =
232
+ * Fixed - Settings not getting saved on few stores
233
+ * Fixed - Broken layout issue
234
+
235
+ Important Note: When you update the plugin, please save your settings again.
236
+
237
+ = 1.0.13 - 19/12/2014 =
238
+ * Currency as field removed from the plugin. Reason: we now automatically passed the currency which you may have set in WooCommerce store
239
+ * Fixed - Minor bugs
240
+
241
+ = 1.0.14 - 10/02/2015 =
242
+ * Fixed - session_start() function warning
243
+ * Fixed - Notice: Undefined variable: coupons_list
244
+ * Fixed - woocommerce deprecated function warning
245
+
246
+ = 1.0.15 - 28/03/2015 =
247
+ * Email Field made optional
248
+
249
+ = 1.0.16 - 01/04/2015 =
250
+ * Minor Bug Fixes as per Wordpress Guidlines
251
+
252
+ = 1.0.17 - 19/02/2016 =
253
+ * Fixed - Notice: Undefined index: tab
254
+ * Minor Bug Fixes as per Wordpress Guidlines
255
+
256
+ = 1.0.18 - 11/04/2016 =
257
+ * Fixed - Compatibility with Google Tag Manager for Wordpress by DuracellTomi
258
+
259
+ = 1.0.19 - 21/12/2016 =
260
+ * Fixed - Compatibility with Wordpress 4.7 & Woocommerce 2.6.x
261
+ * Minor Bug Fixes.
262
+
263
+ = 1.0.20 - 14/04/2017 =
264
+ * Fixed - Compatibility with Woocommerce 3.x
265
+ * Minor Bug Fixes.
266
+
267
+ = 1.0.21 - 12/05/2017 =
268
+ * Minor Bug Fixes.
269
+
270
+ = 1.0.21.1 - 13/07/2017 =
271
+ * Minor Changes.
272
+
273
+ = 1.1.0 - 08/08/2017 =
274
+ * Minor Bug Fixes & Optimization.
275
+
276
+ = 1.1.1 - 04/09/2017 =
277
+ * Minor Optimization on Order-Received Page.
278
+
279
+ = 1.1.2 - 04/09/2017 =
280
+ * Quick Fix of Minor Bugs.
281
+
282
+ = 1.2.0 - 17/10/2017 =
283
+ * Compatibility with Woocommerce 3.2
284
+ * Minor Bug Fixes & Optimization.
285
+
286
+ = 1.2.0.1 - 06/11/2017 =
287
+ * Quick Bug Fixes.
288
+
289
+ = 1.2.1 - 12/12/2017 =
290
+ * Improvisation for Product Page
291
+ * Minor Bug Fixes
292
+
293
+ = 1.2.1.1 - 20/12/2017 =
294
+ * Quick Fixes for Product Page & ATC
295
+ * Minor Bug Fixes
296
+
297
+ = 1.2.1.2 - 26/12/2017 =
298
+ * Minor Fixes
299
+
300
+ = 1.2.2 - 31/01/2018 =
301
+ * Compatibility with Woocommerce 3.3
302
+ * Minor Bug Fixes & Optimization.
303
+
304
+ = 2.0.0 - 07/03/2018 =
305
+ * New Implementation with Global Site Tag (gtag.js)
306
+ * gtag.js supported
307
+ * Minor Bug Fixes & Optimization.
308
+
309
+ = 2.0.1 - 24/04/2018 =
310
+ * Minor Bug Fixes & Optimization.
311
+
312
+ = 2.0.2 - 23/05/2018 =
313
+ * IP Anonymization Feature
314
+ * Google Analytics Opt Out
315
+ * Update the Privacy Policy under GDPR Compliance
316
+
317
+ = 2.0.3 - 04/06/2018 =
318
+ * Minor Bug Fixes
319
+
320
+ = 2.1.0 - 19/07/2018 =
321
+ * New User Interface
322
  * Minor Bug Fixes
uninstall.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Fired when the plugin is uninstalled.
5
+ *
6
+ * When populating this file, consider the following flow
7
+ * of control:
8
+ *
9
+ * - This method should be static
10
+ * - Check if the $_REQUEST content actually is the plugin name
11
+ * - Run an admin referrer check to make sure it goes through authentication
12
+ * - Verify the output of $_GET makes sense
13
+ * - Repeat with other user roles. Best directly by using the links/query string parameters.
14
+ * - Repeat things for multisite. Once for a single site in the network, once sitewide.
15
+ *
16
+ * This file may be updated more in future version of the Boilerplate; however, this is the
17
+ * general skeleton and outline for how the file should work.
18
+ *
19
+ * For more information, see the following discussion:
20
+ * https://github.com/tommcfarlin/WordPress-Plugin-Boilerplate/pull/123#issuecomment-28541913
21
+ *
22
+ * @link tatvic.com
23
+ * @since 1.0.0
24
+ *
25
+ * @package Enhanced Ecommerce Google Analytics
26
+ */
27
+
28
+ // If uninstall not called from WordPress, then exit.
29
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
30
+ exit;
31
+ }
woocommerce-enhanced-ecommerce-google-analytics-integration.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- /* Copyright 2017 Tatvic
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License, version 2, as
7
- published by the Free Software Foundation.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU General Public License for more details.
13
-
14
- You should have received a copy of the GNU General Public License
15
- along with this program; if not, write to the Free Software
16
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
- */
18
- /*
19
- Plugin Name: Enhanced E-commerce for Woocommerce store
20
- Plugin URI: http://www.tatvic.com/enhanced-ecommerce-google-analytics-plugin-woocommerce/
21
- Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
22
- Author: Tatvic
23
- Author URI: http://www.tatvic.com
24
- Version: 2.0.3
25
- */
26
- if (!defined('ABSPATH')) {
27
- exit; // Exit if accessed directly
28
- }
29
-
30
- // Add the integration to WooCommerce
31
- function wc_enhanced_ecommerce_google_analytics_add_integration($integrations) {
32
- global $woocommerce;
33
-
34
- if (is_object($woocommerce)) {
35
- include_once( 'includes/class-wc-enhanced-ecommerce-google-analytics-integration.php' );
36
- $integrations[] = 'WC_Enhanced_Ecommerce_Google_Analytics';
37
- }
38
- return $integrations;
39
- }
40
-
41
- add_filter('woocommerce_integrations', 'wc_enhanced_ecommerce_google_analytics_add_integration', 10);
42
-
43
- //plugin action links on plugin page
44
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'tvc_ee_plugin_action_links');
45
-
46
- function tvc_ee_plugin_action_links($links) {
47
- global $woocommerce;
48
- if (version_compare($woocommerce->version, "2.1", ">=")) {
49
- $setting_url = 'admin.php?page=wc-settings&tab=integration';
50
- } else {
51
- $setting_url = 'admin.php?page=woocommerce_settings&tab=integration';
52
- }
53
- $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>';
54
- $links[] = '<a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" target="_blank">FAQ</a>';
55
- $links[] = '<a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Documentation</a>';
56
- $links[] = '<b><a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?ref=tatvic" target="_blank">Upgrade to Premium</a></b>';
57
- return $links;
58
- }
59
- ?>