Version Description
- Fixed: JavaScript error with the newly added console logging to debug code placement issues
- Fixed: possible XSS Vulnerability if Cloudflare country code option enabled. Thanks Guillaume Fortier
- Fixed: proven XSS Vulnerability if adding site search into the data layer was enabled. Original report by not_stoppable. Root cause analysis by Cory Buecker.
- Removed: deprecated feature Google Ads remarketing. This is the outdated, classic way using the google_tag_params variable.
- Dev: removed PHP constant GTM4WP_WPFILTER_COMPILE_REMARKTING (related to removed Google Ads remarketing feature)
- Dev: removed gtm4wp_compile_remarkering WordPress filter (related to removed Google Ads remarketing feature)
Note to plugin users: I sincerely appologize for the vulnerabilities. To make sure, such cases do not happen again, the next version will be fully dedicacted to go through every peace of code and make sure proper data processing is happening in GTM4WP.
Download this release
Release Info
Developer | duracelltomi |
Plugin | DuracellTomi's Google Tag Manager for WordPress |
Version | 1.15.1 |
Comparing to | |
See all releases |
Code changes from version 1.15 to 1.15.1
- admin/admin.php +1564 -1570
- common/readoptions.php +151 -122
- duracelltomi-google-tag-manager-for-wordpress.php +33 -14
- public/frontend.php +9 -41
- readme.txt +17 -5
- uninstall.php +19 -9
admin/admin.php
CHANGED
@@ -1,1570 +1,1564 @@
|
|
1 |
-
<?php
|
2 |
-
define( 'GTM4WP_ADMINSLUG', 'gtm4wp-settings' );
|
3 |
-
define( 'GTM4WP_ADMIN_GROUP', 'gtm4wp-admin-group' );
|
4 |
-
|
5 |
-
define( 'GTM4WP_ADMIN_GROUP_GENERAL', 'gtm4wp-admin-group-general' );
|
6 |
-
define( 'GTM4WP_ADMIN_GROUP_GTMID', 'gtm4wp-admin-group-gtm-id' );
|
7 |
-
define( 'GTM4WP_ADMIN_GROUP_CONTAINERON', 'gtm4wp-admin-container-on' );
|
8 |
-
define( 'GTM4WP_ADMIN_GROUP_COMPATMODE', 'gtm4wp-admin-compat-mode' );
|
9 |
-
define( 'GTM4WP_ADMIN_GROUP_INFO', 'gtm4wp-admin-group-datalayer-info' );
|
10 |
-
|
11 |
-
define( 'GTM4WP_ADMIN_GROUP_INCLUDES', 'gtm4wp-admin-group-includes' );
|
12 |
-
define( 'GTM4WP_ADMIN_GROUP_EVENTS', 'gtm4wp-admin-group-events' );
|
13 |
-
define( 'GTM4WP_ADMIN_GROUP_SCROLLER', 'gtm4wp-admin-group-scroller' );
|
14 |
-
define( 'GTM4WP_ADMIN_GROUP_BLACKLIST', 'gtm4wp-admin-group-blacklist-tags' );
|
15 |
-
define( 'GTM4WP_ADMIN_GROUP_INTEGRATION', 'gtm4wp-admin-group-integration' );
|
16 |
-
define( 'GTM4WP_ADMIN_GROUP_ADVANCED', 'gtm4wp-admin-group-advanced' );
|
17 |
-
define( 'GTM4WP_ADMIN_GROUP_CREDITS', 'gtm4wp-admin-group-credits' );
|
18 |
-
|
19 |
-
define( 'GTM4WP_USER_NOTICES_KEY', 'gtm4wp_user_notices_dismisses' );
|
20 |
-
|
21 |
-
define( 'GTM4WP_PHASE_STABLE', 'gtm4wp-phase-stable' );
|
22 |
-
define( 'GTM4WP_PHASE_BETA', 'gtm4wp-phase-beta' );
|
23 |
-
define( 'GTM4WP_PHASE_EXPERIMENTAL', 'gtm4wp-phase-experimental' );
|
24 |
-
define( 'GTM4WP_PHASE_DEPRECATED', 'gtm4wp-phase-deprecated' );
|
25 |
-
|
26 |
-
$GLOBALS['gtm4wp_def_user_notices_dismisses'] = array(
|
27 |
-
'enter-gtm-code' => false,
|
28 |
-
'wc-ga-plugin-warning' => false,
|
29 |
-
'wc-gayoast-plugin-warning' => false,
|
30 |
-
'php72-warning' => false,
|
31 |
-
'deprecated-warning' => false,
|
32 |
-
);
|
33 |
-
|
34 |
-
$GLOBALS['gtm4wp_includefieldtexts'] = array(
|
35 |
-
GTM4WP_OPTION_INCLUDE_POSTTYPE => array(
|
36 |
-
'label' => __( 'Posttype of current post/archive', 'duracelltomi-google-tag-manager' ),
|
37 |
-
'description' => __( 'Check this option to include the type of the current post or archive page (post, page or any custom post type).', 'duracelltomi-google-tag-manager' ),
|
38 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
39 |
-
),
|
40 |
-
GTM4WP_OPTION_INCLUDE_CATEGORIES => array(
|
41 |
-
'label' => __( 'Category list of current post/archive', 'duracelltomi-google-tag-manager' ),
|
42 |
-
'description' => __( 'Check this option to include the category names of the current post or archive page', 'duracelltomi-google-tag-manager' ),
|
43 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
44 |
-
),
|
45 |
-
GTM4WP_OPTION_INCLUDE_TAGS => array(
|
46 |
-
'label' => __( 'Tags of current post', 'duracelltomi-google-tag-manager' ),
|
47 |
-
'description' => __( 'Check this option to include the tags of the current post.', 'duracelltomi-google-tag-manager' ),
|
48 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
49 |
-
),
|
50 |
-
GTM4WP_OPTION_INCLUDE_AUTHORID => array(
|
51 |
-
'label' => __( 'Post author ID', 'duracelltomi-google-tag-manager' ),
|
52 |
-
'description' => __( 'Check this option to include the ID of the author on the current post or author page.', 'duracelltomi-google-tag-manager' ),
|
53 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
54 |
-
),
|
55 |
-
GTM4WP_OPTION_INCLUDE_AUTHOR => array(
|
56 |
-
'label' => __( 'Post author name', 'duracelltomi-google-tag-manager' ),
|
57 |
-
'description' => __( 'Check this option to include the name of the author on the current post or author page.', 'duracelltomi-google-tag-manager' ),
|
58 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
59 |
-
),
|
60 |
-
GTM4WP_OPTION_INCLUDE_POSTDATE => array(
|
61 |
-
'label' => __( 'Post date', 'duracelltomi-google-tag-manager' ),
|
62 |
-
'description' => __( 'Check this option to include the date of the current post. This will include 4 dataLayer variables: full date, post year, post month, post date.', 'duracelltomi-google-tag-manager' ),
|
63 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
64 |
-
),
|
65 |
-
GTM4WP_OPTION_INCLUDE_POSTTITLE => array(
|
66 |
-
'label' => __( 'Post title', 'duracelltomi-google-tag-manager' ),
|
67 |
-
'description' => __( 'Check this option to include the title of the current post.', 'duracelltomi-google-tag-manager' ),
|
68 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
69 |
-
),
|
70 |
-
GTM4WP_OPTION_INCLUDE_POSTCOUNT => array(
|
71 |
-
'label' => __( 'Post count', 'duracelltomi-google-tag-manager' ),
|
72 |
-
'description' => __( 'Check this option to include the count of the posts currently shown on the page and the total number of posts in the category/tag/any taxonomy.', 'duracelltomi-google-tag-manager' ),
|
73 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
74 |
-
),
|
75 |
-
GTM4WP_OPTION_INCLUDE_POSTID => array(
|
76 |
-
'label' => __( 'Post ID', 'duracelltomi-google-tag-manager' ),
|
77 |
-
'description' => __( 'Check this option to include the post id.', 'duracelltomi-google-tag-manager' ),
|
78 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
79 |
-
),
|
80 |
-
GTM4WP_OPTION_INCLUDE_POSTFORMAT => array(
|
81 |
-
'label' => __( 'Post Format', 'duracelltomi-google-tag-manager' ),
|
82 |
-
'description' => __( 'Check this option to include the post format.', 'duracelltomi-google-tag-manager' ),
|
83 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
84 |
-
),
|
85 |
-
GTM4WP_OPTION_INCLUDE_POSTTERMLIST => array(
|
86 |
-
"label" => __( "Post Terms", 'duracelltomi-google-tag-manager' ),
|
87 |
-
"description" => __( "Check this option to include taxonomy values associated with a given post.", 'duracelltomi-google-tag-manager' ),
|
88 |
-
"phase" => GTM4WP_PHASE_STABLE
|
89 |
-
),
|
90 |
-
GTM4WP_OPTION_INCLUDE_SEARCHDATA => array(
|
91 |
-
'label' => __( 'Search data', 'duracelltomi-google-tag-manager' ),
|
92 |
-
'description' => __( 'Check this option to include the search term, referring page URL and number of results on the search page.', 'duracelltomi-google-tag-manager' ),
|
93 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
94 |
-
),
|
95 |
-
GTM4WP_OPTION_INCLUDE_LOGGEDIN => array(
|
96 |
-
'label' => __( 'Logged in status', 'duracelltomi-google-tag-manager' ),
|
97 |
-
'description' => __( 'Check this option to include whether there is a logged in user on your website.', 'duracelltomi-google-tag-manager' ),
|
98 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
99 |
-
),
|
100 |
-
GTM4WP_OPTION_INCLUDE_USERROLE => array(
|
101 |
-
'label' => __( 'Logged in user role', 'duracelltomi-google-tag-manager' ),
|
102 |
-
'description' => __( 'Check this option to include the role of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
103 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
104 |
-
),
|
105 |
-
GTM4WP_OPTION_INCLUDE_USERID => array(
|
106 |
-
'label' => __( 'Logged in user ID', 'duracelltomi-google-tag-manager' ),
|
107 |
-
'description' => __( 'Check this option to include the ID of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
108 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
109 |
-
),
|
110 |
-
GTM4WP_OPTION_INCLUDE_USERNAME => array(
|
111 |
-
'label' => __( 'Logged in user name', 'duracelltomi-google-tag-manager' ),
|
112 |
-
'description' => __( 'Check this option to include the username of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
113 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
114 |
-
),
|
115 |
-
GTM4WP_OPTION_INCLUDE_USEREMAIL => array(
|
116 |
-
'label' => __( 'Logged in user email', 'duracelltomi-google-tag-manager' ),
|
117 |
-
'description' => __( 'Check this option to include the email address of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
118 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
119 |
-
),
|
120 |
-
GTM4WP_OPTION_INCLUDE_USERREGDATE => array(
|
121 |
-
'label' => __( 'Logged in user creation date', 'duracelltomi-google-tag-manager' ),
|
122 |
-
'description' => __( 'Check this option to include the date of creation (registration) of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
123 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
124 |
-
),
|
125 |
-
GTM4WP_OPTION_INCLUDE_VISITOR_IP => array(
|
126 |
-
'label' => __( 'Visitor IP', 'duracelltomi-google-tag-manager' ),
|
127 |
-
'description' => __( 'Check this option to include the IP address of the visitor. You might use this to filter internal traffic inside your GTM container. Please be aware that per GDPR its not allowed to transmit this full IP address to Google Analytics or to any other measurement system without explicit consent from the visitor.', 'duracelltomi-google-tag-manager' ),
|
128 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
129 |
-
),
|
130 |
-
|
131 |
-
'label' => __( '
|
132 |
-
'description' => __( 'Check this option to include
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
'
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
'
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
'
|
145 |
-
'
|
146 |
-
),
|
147 |
-
|
148 |
-
'label' => __( '
|
149 |
-
'description' => __( '
|
150 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
151 |
-
),
|
152 |
-
|
153 |
-
'label' => __( '
|
154 |
-
'description' =>
|
155 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
156 |
-
),
|
157 |
-
|
158 |
-
'label' => __( '
|
159 |
-
'description' =>
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
'
|
167 |
-
|
168 |
-
'
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
),
|
178 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
179 |
-
),
|
180 |
-
|
181 |
-
'label' => __( '
|
182 |
-
'description' => __( '
|
183 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
184 |
-
),
|
185 |
-
|
186 |
-
'label' => __( '
|
187 |
-
'description' =>
|
188 |
-
'phase' =>
|
189 |
-
),
|
190 |
-
|
191 |
-
'label' => __( 'Site
|
192 |
-
'description' => __( '
|
193 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
194 |
-
),
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
)
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
'label' => __( '
|
205 |
-
'description' => __( 'Check this option to include a Tag Manager event when a
|
206 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
207 |
-
),
|
208 |
-
|
209 |
-
'label' => __( '
|
210 |
-
'description' => __( 'Check this option to include a Tag Manager event when
|
211 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
212 |
-
),
|
213 |
-
|
214 |
-
'label' => __( '
|
215 |
-
'description' => __( 'Check this option to include a Tag Manager event when
|
216 |
-
'phase' =>
|
217 |
-
),
|
218 |
-
|
219 |
-
'label' => __( '
|
220 |
-
'description' => __( 'Check this option to include a Tag Manager event when a visitor interacts with a
|
221 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
222 |
-
),
|
223 |
-
|
224 |
-
'label' => __( '
|
225 |
-
'description' => __( 'Check this option to include a Tag Manager event when a visitor interacts with a
|
226 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
227 |
-
)
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
)
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
'label' => __( '
|
238 |
-
'description' => __( '
|
239 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
240 |
-
),
|
241 |
-
|
242 |
-
'label' => __( '
|
243 |
-
'description' => __( '
|
244 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
245 |
-
),
|
246 |
-
|
247 |
-
'label' => __( '
|
248 |
-
'description' => __( '
|
249 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
250 |
-
),
|
251 |
-
|
252 |
-
'label' => __( '
|
253 |
-
'description' => __( '
|
254 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
255 |
-
),
|
256 |
-
|
257 |
-
'label' => __( '
|
258 |
-
'description' => __( 'Enter the
|
259 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
260 |
-
),
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
)
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
'
|
272 |
-
'
|
273 |
-
'
|
274 |
-
),
|
275 |
-
|
276 |
-
'label' => __( 'Track
|
277 |
-
'description' =>
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
, '
|
293 |
-
'
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
),
|
305 |
-
'phase' => GTM4WP_PHASE_STABLE
|
306 |
-
),
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
),
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
),
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
),
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
),
|
327 |
-
|
328 |
-
'label' => __( '
|
329 |
-
'description' => __( 'Enable this to add all
|
330 |
-
'phase' => GTM4WP_PHASE_STABLE
|
331 |
-
),
|
332 |
-
|
333 |
-
'label' => __( '
|
334 |
-
'description' => __( 'Enable this to
|
335 |
-
'phase' => GTM4WP_PHASE_STABLE
|
336 |
-
),
|
337 |
-
|
338 |
-
'
|
339 |
-
'
|
340 |
-
|
341 |
-
|
342 |
-
'label' => __( '
|
343 |
-
'description' => __( '
|
344 |
-
'phase' =>
|
345 |
-
),
|
346 |
-
|
347 |
-
'label' => __( '
|
348 |
-
'description' => __( 'Enable this to
|
349 |
-
'phase' =>
|
350 |
-
),
|
351 |
-
|
352 |
-
'label' => __( 'Google Ads
|
353 |
-
'description' =>
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
'phase' => GTM4WP_PHASE_STABLE
|
366 |
-
),
|
367 |
-
|
368 |
-
'label' => __( '
|
369 |
-
'description' => __(
|
370 |
-
'phase' => GTM4WP_PHASE_STABLE
|
371 |
-
),
|
372 |
-
|
373 |
-
'label' => __( '
|
374 |
-
'description' => __(
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
),
|
386 |
-
'
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
)
|
399 |
-
|
400 |
-
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
401 |
-
),
|
402 |
-
|
403 |
-
|
404 |
-
'
|
405 |
-
'
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
'
|
413 |
-
'
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
)
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
'label' => __( '
|
426 |
-
'description' => __( '
|
427 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
428 |
-
),
|
429 |
-
|
430 |
-
'label' => __( 'Environment
|
431 |
-
'description' => __( 'Enter the gtm_auth parameter of the Google Tag Manager environment that has to be activated on this site. Both gtm_auth and gtm_preview parameters are required to activate the desired environment.', 'duracelltomi-google-tag-manager' ),
|
432 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
433 |
-
),
|
434 |
-
|
435 |
-
'label' => __( '
|
436 |
-
'description' => __( '
|
437 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
438 |
-
),
|
439 |
-
|
440 |
-
'label' => __(
|
441 |
-
'description' => __(
|
442 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
443 |
-
),
|
444 |
-
|
445 |
-
'label' => __( '
|
446 |
-
'description' => __( "
|
447 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
448 |
-
),
|
449 |
-
|
450 |
-
'label' => __( '
|
451 |
-
'description' => __( "
|
452 |
-
'phase' => GTM4WP_PHASE_STABLE,
|
453 |
-
)
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
)
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
$
|
532 |
-
$
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
$
|
574 |
-
$
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
$
|
592 |
-
$
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
"
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
$
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
$
|
794 |
-
}
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
//
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
$
|
846 |
-
}
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
}
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
)
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
)
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
'
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
)
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
'
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
)
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
'
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
)
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
'
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
)
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
)
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
'
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
)
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
'
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
)
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
);
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
?>
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
<?php
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
'
|
1237 |
-
'
|
1238 |
-
'
|
1239 |
-
'
|
1240 |
-
'
|
1241 |
-
'
|
1242 |
-
'
|
1243 |
-
'
|
1244 |
-
'
|
1245 |
-
'
|
1246 |
-
'
|
1247 |
-
'
|
1248 |
-
'
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
);
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
.
|
1269 |
-
.
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
.
|
1274 |
-
.
|
1275 |
-
.
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
.
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
var
|
1295 |
-
|
1296 |
-
|
1297 |
-
}
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
}
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
}
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
}
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
$
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
) || (
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
}
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
add_action( '
|
1564 |
-
add_action( '
|
1565 |
-
add_action( 'admin_enqueue_scripts', 'gtm4wp_add_admin_js' );
|
1566 |
-
add_action( 'admin_notices', 'gtm4wp_show_warning' );
|
1567 |
-
add_action( 'admin_head', 'gtm4wp_admin_head' );
|
1568 |
-
add_filter( 'plugin_action_links', 'gtm4wp_add_plugin_action_links', 10, 2 );
|
1569 |
-
add_action( 'wp_ajax_gtm4wp_dismiss_notice', 'gtm4wp_dismiss_notice' );
|
1570 |
-
add_action( 'in_plugin_update_message-duracelltomi-google-tag-manager-for-wordpress/duracelltomi-google-tag-manager-for-wordpress.php', 'gtm4wp_show_upgrade_notification', 10, 2 );
|
1 |
+
<?php
|
2 |
+
define( 'GTM4WP_ADMINSLUG', 'gtm4wp-settings' );
|
3 |
+
define( 'GTM4WP_ADMIN_GROUP', 'gtm4wp-admin-group' );
|
4 |
+
|
5 |
+
define( 'GTM4WP_ADMIN_GROUP_GENERAL', 'gtm4wp-admin-group-general' );
|
6 |
+
define( 'GTM4WP_ADMIN_GROUP_GTMID', 'gtm4wp-admin-group-gtm-id' );
|
7 |
+
define( 'GTM4WP_ADMIN_GROUP_CONTAINERON', 'gtm4wp-admin-container-on' );
|
8 |
+
define( 'GTM4WP_ADMIN_GROUP_COMPATMODE', 'gtm4wp-admin-compat-mode' );
|
9 |
+
define( 'GTM4WP_ADMIN_GROUP_INFO', 'gtm4wp-admin-group-datalayer-info' );
|
10 |
+
|
11 |
+
define( 'GTM4WP_ADMIN_GROUP_INCLUDES', 'gtm4wp-admin-group-includes' );
|
12 |
+
define( 'GTM4WP_ADMIN_GROUP_EVENTS', 'gtm4wp-admin-group-events' );
|
13 |
+
define( 'GTM4WP_ADMIN_GROUP_SCROLLER', 'gtm4wp-admin-group-scroller' );
|
14 |
+
define( 'GTM4WP_ADMIN_GROUP_BLACKLIST', 'gtm4wp-admin-group-blacklist-tags' );
|
15 |
+
define( 'GTM4WP_ADMIN_GROUP_INTEGRATION', 'gtm4wp-admin-group-integration' );
|
16 |
+
define( 'GTM4WP_ADMIN_GROUP_ADVANCED', 'gtm4wp-admin-group-advanced' );
|
17 |
+
define( 'GTM4WP_ADMIN_GROUP_CREDITS', 'gtm4wp-admin-group-credits' );
|
18 |
+
|
19 |
+
define( 'GTM4WP_USER_NOTICES_KEY', 'gtm4wp_user_notices_dismisses' );
|
20 |
+
|
21 |
+
define( 'GTM4WP_PHASE_STABLE', 'gtm4wp-phase-stable' );
|
22 |
+
define( 'GTM4WP_PHASE_BETA', 'gtm4wp-phase-beta' );
|
23 |
+
define( 'GTM4WP_PHASE_EXPERIMENTAL', 'gtm4wp-phase-experimental' );
|
24 |
+
define( 'GTM4WP_PHASE_DEPRECATED', 'gtm4wp-phase-deprecated' );
|
25 |
+
|
26 |
+
$GLOBALS['gtm4wp_def_user_notices_dismisses'] = array(
|
27 |
+
'enter-gtm-code' => false,
|
28 |
+
'wc-ga-plugin-warning' => false,
|
29 |
+
'wc-gayoast-plugin-warning' => false,
|
30 |
+
'php72-warning' => false,
|
31 |
+
'deprecated-warning' => false,
|
32 |
+
);
|
33 |
+
|
34 |
+
$GLOBALS['gtm4wp_includefieldtexts'] = array(
|
35 |
+
GTM4WP_OPTION_INCLUDE_POSTTYPE => array(
|
36 |
+
'label' => __( 'Posttype of current post/archive', 'duracelltomi-google-tag-manager' ),
|
37 |
+
'description' => __( 'Check this option to include the type of the current post or archive page (post, page or any custom post type).', 'duracelltomi-google-tag-manager' ),
|
38 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
39 |
+
),
|
40 |
+
GTM4WP_OPTION_INCLUDE_CATEGORIES => array(
|
41 |
+
'label' => __( 'Category list of current post/archive', 'duracelltomi-google-tag-manager' ),
|
42 |
+
'description' => __( 'Check this option to include the category names of the current post or archive page', 'duracelltomi-google-tag-manager' ),
|
43 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
44 |
+
),
|
45 |
+
GTM4WP_OPTION_INCLUDE_TAGS => array(
|
46 |
+
'label' => __( 'Tags of current post', 'duracelltomi-google-tag-manager' ),
|
47 |
+
'description' => __( 'Check this option to include the tags of the current post.', 'duracelltomi-google-tag-manager' ),
|
48 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
49 |
+
),
|
50 |
+
GTM4WP_OPTION_INCLUDE_AUTHORID => array(
|
51 |
+
'label' => __( 'Post author ID', 'duracelltomi-google-tag-manager' ),
|
52 |
+
'description' => __( 'Check this option to include the ID of the author on the current post or author page.', 'duracelltomi-google-tag-manager' ),
|
53 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
54 |
+
),
|
55 |
+
GTM4WP_OPTION_INCLUDE_AUTHOR => array(
|
56 |
+
'label' => __( 'Post author name', 'duracelltomi-google-tag-manager' ),
|
57 |
+
'description' => __( 'Check this option to include the name of the author on the current post or author page.', 'duracelltomi-google-tag-manager' ),
|
58 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
59 |
+
),
|
60 |
+
GTM4WP_OPTION_INCLUDE_POSTDATE => array(
|
61 |
+
'label' => __( 'Post date', 'duracelltomi-google-tag-manager' ),
|
62 |
+
'description' => __( 'Check this option to include the date of the current post. This will include 4 dataLayer variables: full date, post year, post month, post date.', 'duracelltomi-google-tag-manager' ),
|
63 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
64 |
+
),
|
65 |
+
GTM4WP_OPTION_INCLUDE_POSTTITLE => array(
|
66 |
+
'label' => __( 'Post title', 'duracelltomi-google-tag-manager' ),
|
67 |
+
'description' => __( 'Check this option to include the title of the current post.', 'duracelltomi-google-tag-manager' ),
|
68 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
69 |
+
),
|
70 |
+
GTM4WP_OPTION_INCLUDE_POSTCOUNT => array(
|
71 |
+
'label' => __( 'Post count', 'duracelltomi-google-tag-manager' ),
|
72 |
+
'description' => __( 'Check this option to include the count of the posts currently shown on the page and the total number of posts in the category/tag/any taxonomy.', 'duracelltomi-google-tag-manager' ),
|
73 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
74 |
+
),
|
75 |
+
GTM4WP_OPTION_INCLUDE_POSTID => array(
|
76 |
+
'label' => __( 'Post ID', 'duracelltomi-google-tag-manager' ),
|
77 |
+
'description' => __( 'Check this option to include the post id.', 'duracelltomi-google-tag-manager' ),
|
78 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
79 |
+
),
|
80 |
+
GTM4WP_OPTION_INCLUDE_POSTFORMAT => array(
|
81 |
+
'label' => __( 'Post Format', 'duracelltomi-google-tag-manager' ),
|
82 |
+
'description' => __( 'Check this option to include the post format.', 'duracelltomi-google-tag-manager' ),
|
83 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
84 |
+
),
|
85 |
+
GTM4WP_OPTION_INCLUDE_POSTTERMLIST => array(
|
86 |
+
"label" => __( "Post Terms", 'duracelltomi-google-tag-manager' ),
|
87 |
+
"description" => __( "Check this option to include taxonomy values associated with a given post.", 'duracelltomi-google-tag-manager' ),
|
88 |
+
"phase" => GTM4WP_PHASE_STABLE
|
89 |
+
),
|
90 |
+
GTM4WP_OPTION_INCLUDE_SEARCHDATA => array(
|
91 |
+
'label' => __( 'Search data', 'duracelltomi-google-tag-manager' ),
|
92 |
+
'description' => __( 'Check this option to include the search term, referring page URL and number of results on the search page.', 'duracelltomi-google-tag-manager' ),
|
93 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
94 |
+
),
|
95 |
+
GTM4WP_OPTION_INCLUDE_LOGGEDIN => array(
|
96 |
+
'label' => __( 'Logged in status', 'duracelltomi-google-tag-manager' ),
|
97 |
+
'description' => __( 'Check this option to include whether there is a logged in user on your website.', 'duracelltomi-google-tag-manager' ),
|
98 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
99 |
+
),
|
100 |
+
GTM4WP_OPTION_INCLUDE_USERROLE => array(
|
101 |
+
'label' => __( 'Logged in user role', 'duracelltomi-google-tag-manager' ),
|
102 |
+
'description' => __( 'Check this option to include the role of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
103 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
104 |
+
),
|
105 |
+
GTM4WP_OPTION_INCLUDE_USERID => array(
|
106 |
+
'label' => __( 'Logged in user ID', 'duracelltomi-google-tag-manager' ),
|
107 |
+
'description' => __( 'Check this option to include the ID of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
108 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
109 |
+
),
|
110 |
+
GTM4WP_OPTION_INCLUDE_USERNAME => array(
|
111 |
+
'label' => __( 'Logged in user name', 'duracelltomi-google-tag-manager' ),
|
112 |
+
'description' => __( 'Check this option to include the username of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
113 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
114 |
+
),
|
115 |
+
GTM4WP_OPTION_INCLUDE_USEREMAIL => array(
|
116 |
+
'label' => __( 'Logged in user email', 'duracelltomi-google-tag-manager' ),
|
117 |
+
'description' => __( 'Check this option to include the email address of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
118 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
119 |
+
),
|
120 |
+
GTM4WP_OPTION_INCLUDE_USERREGDATE => array(
|
121 |
+
'label' => __( 'Logged in user creation date', 'duracelltomi-google-tag-manager' ),
|
122 |
+
'description' => __( 'Check this option to include the date of creation (registration) of the logged in user.', 'duracelltomi-google-tag-manager' ),
|
123 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
124 |
+
),
|
125 |
+
GTM4WP_OPTION_INCLUDE_VISITOR_IP => array(
|
126 |
+
'label' => __( 'Visitor IP', 'duracelltomi-google-tag-manager' ),
|
127 |
+
'description' => __( 'Check this option to include the IP address of the visitor. You might use this to filter internal traffic inside your GTM container. Please be aware that per GDPR its not allowed to transmit this full IP address to Google Analytics or to any other measurement system without explicit consent from the visitor.', 'duracelltomi-google-tag-manager' ),
|
128 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
129 |
+
),
|
130 |
+
GTM4WP_OPTION_INCLUDE_BROWSERDATA => array(
|
131 |
+
'label' => __( 'Browser data *', 'duracelltomi-google-tag-manager' ),
|
132 |
+
'description' => __( 'Check this option to include the name, version and engine data of the browser the visitor uses.', 'duracelltomi-google-tag-manager' )
|
133 |
+
),
|
134 |
+
GTM4WP_OPTION_INCLUDE_OSDATA => array(
|
135 |
+
'label' => __( 'OS data *', 'duracelltomi-google-tag-manager' ),
|
136 |
+
'description' => __( 'Check this option to include the name and version of the operating system the visitor uses.', 'duracelltomi-google-tag-manager' )
|
137 |
+
),
|
138 |
+
GTM4WP_OPTION_INCLUDE_DEVICEDATA => array(
|
139 |
+
'label' => __( 'Device data *', 'duracelltomi-google-tag-manager' ),
|
140 |
+
'description' => __( 'Check this option to include the type of device the user is currently using (desktop, tablet or mobile) including manufacturer and model data.', 'duracelltomi-google-tag-manager' )
|
141 |
+
),
|
142 |
+
GTM4WP_OPTION_INCLUDE_MISCGEO => array(
|
143 |
+
'label' => __( 'Geo data', 'duracelltomi-google-tag-manager' ),
|
144 |
+
'description' => __( 'Add geo data (latitude, longitude, country, city, etc) of the current visitor (provided by ipstack.com)', 'duracelltomi-google-tag-manager' ),
|
145 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
146 |
+
),
|
147 |
+
GTM4WP_OPTION_INCLUDE_MISCGEOAPI => array(
|
148 |
+
'label' => __( 'IPStack.com API key', 'duracelltomi-google-tag-manager' ),
|
149 |
+
'description' => sprintf( __( 'Enter your IPStack.com API key here. <a href="%s" target="_blank" rel="noopener">Get a free API key here</a>.', 'duracelltomi-google-tag-manager' ), 'https://ipstack.com/product?utm_source=gtm4wp&utm_medium=link&utm_campaign=gtm4wp-google-tag-manager-for-wordpress' ),
|
150 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
151 |
+
),
|
152 |
+
GTM4WP_OPTION_INCLUDE_MISCGEOCF => array(
|
153 |
+
'label' => __( 'Cloudflare country code', 'duracelltomi-google-tag-manager' ),
|
154 |
+
'description' => __( 'Add the country code of the user provided by Cloudflare (if Cloudflare is used with your site)', 'duracelltomi-google-tag-manager' ),
|
155 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
156 |
+
),
|
157 |
+
GTM4WP_OPTION_INCLUDE_WEATHER => array(
|
158 |
+
'label' => __( 'Weather data', 'duracelltomi-google-tag-manager' ),
|
159 |
+
'description' => sprintf(
|
160 |
+
__(
|
161 |
+
'Check this option to include the current weather conditions around the current visitor.<br /><br />' .
|
162 |
+
'<strong>Attention!</strong> This feature uses <a href="%s" target="_blank" rel="noopener">ipstack.com</a> and ' .
|
163 |
+
'<a href="%s" target="_blank" rel="noopener">openweathermap.org</a> to collect data.<br />' .
|
164 |
+
"Depending on your website's traffic, additional fees may apply!<br />" .
|
165 |
+
'This plugin caches weather data for 1 hour to lower the need to access those services.<br /><br />' .
|
166 |
+
'If you activate weather data, <strong>you will need</strong> to add an IPStack.com API key regardless of whether you ' .
|
167 |
+
"activate the 'Geo data' option!",
|
168 |
+
'duracelltomi-google-tag-manager'
|
169 |
+
),
|
170 |
+
'https://ipstack.com/product?utm_source=gtm4wp&utm_medium=link&utm_campaign=gtm4wp-google-tag-manager-for-wordpress',
|
171 |
+
'http://openweathermap.org/price?utm_source=gtm4wp&utm_medium=link&utm_campaign=gtm4wp-google-tag-manager-for-wordpress'
|
172 |
+
),
|
173 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
174 |
+
),
|
175 |
+
GTM4WP_OPTION_INCLUDE_WEATHERUNITS => array(
|
176 |
+
'label' => __( 'Weather data units', 'duracelltomi-google-tag-manager' ),
|
177 |
+
'description' => __( 'Select which temperature units you would like to use.', 'duracelltomi-google-tag-manager' ),
|
178 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
179 |
+
),
|
180 |
+
GTM4WP_OPTION_INCLUDE_WEATHEROWMAPI => array(
|
181 |
+
'label' => __( 'OpenWeatherMap API key', 'duracelltomi-google-tag-manager' ),
|
182 |
+
'description' => sprintf( __( 'Enter your OpenWeatherMap API key here. <a href="%s" target="_blank" rel="noopener">Get a free API key here</a>.', 'duracelltomi-google-tag-manager' ), 'http://openweathermap.org/price?utm_source=gtm4wp&utm_medium=link&utm_campaign=gtm4wp-google-tag-manager-for-wordpress' ),
|
183 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
184 |
+
),
|
185 |
+
GTM4WP_OPTION_INCLUDE_SITEID => array(
|
186 |
+
'label' => __( 'Site ID', 'duracelltomi-google-tag-manager' ),
|
187 |
+
'description' => __( 'ID of the current site in a WordPress Multisite environment', 'duracelltomi-google-tag-manager' ),
|
188 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
189 |
+
),
|
190 |
+
GTM4WP_OPTION_INCLUDE_SITENAME => array(
|
191 |
+
'label' => __( 'Site name', 'duracelltomi-google-tag-manager' ),
|
192 |
+
'description' => __( 'Name of the current site in a WordPress Multisite environment', 'duracelltomi-google-tag-manager' ),
|
193 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
194 |
+
),
|
195 |
+
);
|
196 |
+
|
197 |
+
$GLOBALS['gtm4wp_eventfieldtexts'] = array(
|
198 |
+
GTM4WP_OPTION_EVENTS_FORMMOVE => array(
|
199 |
+
'label' => __( 'Form fill events (gtm4wp.formElementEnter & gtm4wp.formElementLeave)', 'duracelltomi-google-tag-manager' ),
|
200 |
+
'description' => __( 'Check this option to include a Tag Manager event when a visitor moves between elements of a form (comment, contact, etc).', 'duracelltomi-google-tag-manager' ),
|
201 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
202 |
+
),
|
203 |
+
GTM4WP_OPTION_EVENTS_NEWUSERREG => array(
|
204 |
+
'label' => __( 'New user registration', 'duracelltomi-google-tag-manager' ),
|
205 |
+
'description' => __( 'Check this option to include a Tag Manager event when a new user registration has been completed on the frontend of your site (admin events not included)', 'duracelltomi-google-tag-manager' ),
|
206 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
207 |
+
),
|
208 |
+
GTM4WP_OPTION_EVENTS_USERLOGIN => array(
|
209 |
+
'label' => __( 'User logged in', 'duracelltomi-google-tag-manager' ),
|
210 |
+
'description' => __( 'Check this option to include a Tag Manager event when an existing user has been logged in on the frontend of your site (admin events not included)', 'duracelltomi-google-tag-manager' ),
|
211 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
212 |
+
),
|
213 |
+
GTM4WP_OPTION_EVENTS_YOUTUBE => array(
|
214 |
+
'label' => __( 'YouTube video events', 'duracelltomi-google-tag-manager' ),
|
215 |
+
'description' => __( 'Check this option to include a Tag Manager event when a visitor interacts with a YouTube video embeded on your site.', 'duracelltomi-google-tag-manager' ),
|
216 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
217 |
+
),
|
218 |
+
GTM4WP_OPTION_EVENTS_VIMEO => array(
|
219 |
+
'label' => __( 'Vimeo video events', 'duracelltomi-google-tag-manager' ),
|
220 |
+
'description' => __( 'Check this option to include a Tag Manager event when a visitor interacts with a Vimeo video embeded on your site.', 'duracelltomi-google-tag-manager' ),
|
221 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
222 |
+
),
|
223 |
+
GTM4WP_OPTION_EVENTS_SOUNDCLOUD => array(
|
224 |
+
'label' => __( 'Soundcloud events', 'duracelltomi-google-tag-manager' ),
|
225 |
+
'description' => __( 'Check this option to include a Tag Manager event when a visitor interacts with a Soundcloud media embeded on your site.', 'duracelltomi-google-tag-manager' ),
|
226 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
227 |
+
)
|
228 |
+
);
|
229 |
+
|
230 |
+
$GLOBALS['gtm4wp_scrollerfieldtexts'] = array(
|
231 |
+
GTM4WP_OPTION_SCROLLER_ENABLED => array(
|
232 |
+
'label' => __( 'Enabled', 'duracelltomi-google-tag-manager' ),
|
233 |
+
'description' => __( 'Enable scroll tracker script on your website.', 'duracelltomi-google-tag-manager' ),
|
234 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
235 |
+
),
|
236 |
+
GTM4WP_OPTION_SCROLLER_DEBUGMODE => array(
|
237 |
+
'label' => __( 'Debug mode', 'duracelltomi-google-tag-manager' ),
|
238 |
+
'description' => __( 'Fire console.log() commands instead of dataLayer events.', 'duracelltomi-google-tag-manager' ),
|
239 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
240 |
+
),
|
241 |
+
GTM4WP_OPTION_SCROLLER_CALLBACKTIME => array(
|
242 |
+
'label' => __( 'Time delay before location check', 'duracelltomi-google-tag-manager' ),
|
243 |
+
'description' => __( 'Enter the number of milliseconds after the script checks the current location. It prevents too many events being fired while scrolling.', 'duracelltomi-google-tag-manager' ),
|
244 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
245 |
+
),
|
246 |
+
GTM4WP_OPTION_SCROLLER_DISTANCE => array(
|
247 |
+
'label' => __( 'Minimum distance', 'duracelltomi-google-tag-manager' ),
|
248 |
+
'description' => __( 'The minimum amount of pixels that a visitor has to scroll before we treat the move as scrolling.', 'duracelltomi-google-tag-manager' ),
|
249 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
250 |
+
),
|
251 |
+
GTM4WP_OPTION_SCROLLER_CONTENTID => array(
|
252 |
+
'label' => __( 'Content ID', 'duracelltomi-google-tag-manager' ),
|
253 |
+
'description' => __( 'Enter the DOM ID of the content element in your template. Leave it empty for default(content). Do not include the # sign.', 'duracelltomi-google-tag-manager' ),
|
254 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
255 |
+
),
|
256 |
+
GTM4WP_OPTION_SCROLLER_READERTIME => array(
|
257 |
+
'label' => __( 'Scroller time', 'duracelltomi-google-tag-manager' ),
|
258 |
+
'description' => __( 'Enter the number of seconds after the the scroller user is being treated as a reader, someone who really reads the content, not just scrolls through it.', 'duracelltomi-google-tag-manager' ),
|
259 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
260 |
+
),
|
261 |
+
);
|
262 |
+
|
263 |
+
$GLOBALS['gtm4wp_integratefieldtexts'] = array(
|
264 |
+
GTM4WP_OPTION_INTEGRATE_WPCF7 => array(
|
265 |
+
'label' => __( 'Contact Form 7', 'duracelltomi-google-tag-manager' ),
|
266 |
+
'description' => __( 'Check this to fire dataLayer events after Contact Form 7 submissions (supported events: invalid input, spam detected, form submitted, form submitted and mail sent, form submitted and mail send failed).', 'duracelltomi-google-tag-manager' ),
|
267 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
268 |
+
'plugintocheck' => 'contact-form-7/wp-contact-form-7.php',
|
269 |
+
),
|
270 |
+
GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC => array(
|
271 |
+
'label' => __( 'Track classic e-commerce', 'duracelltomi-google-tag-manager' ),
|
272 |
+
'description' => __( 'This feature is deprecated and will be removed soon! You should upgrade to enhanced ecommerce as soon as possible.', 'duracelltomi-google-tag-manager' ),
|
273 |
+
'phase' => GTM4WP_PHASE_DEPRECATED
|
274 |
+
),
|
275 |
+
GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC => array(
|
276 |
+
'label' => __( 'Track enhanced e-commerce', 'duracelltomi-google-tag-manager' ),
|
277 |
+
'description' => sprintf(
|
278 |
+
__(
|
279 |
+
'Choose this option if you would like to track e-commerce data using '.
|
280 |
+
'<a href="%s" target="_blank" rel="noopener">enhanced ecommerce tracking</a>.<br>'.
|
281 |
+
'Use the plugin\'s official guides to setup your Google Tag Manager container:<br>'.
|
282 |
+
'<ul><li><a href="%s" target="_blank" rel="noopener">Google Analytics 3 / Universal Analytics setup</a></li>'.
|
283 |
+
'<li><a href="%s" target="_blank" rel="noopener">Google Analytics 4 setup</a></li></ul>'
|
284 |
+
, 'duracelltomi-google-tag-manager' )
|
285 |
+
, 'https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce'
|
286 |
+
, 'https://gtm4wp.com/how-to-articles/how-to-setup-enhanced-ecommerce-tracking'
|
287 |
+
, 'https://gtm4wp.com/how-to-articles/how-to-setup-enhanced-ecommerce-tracking-google-analytics-4-ga4-version' ),
|
288 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
289 |
+
'plugintocheck' => 'woocommerce/woocommerce.php',
|
290 |
+
),
|
291 |
+
GTM4WP_OPTION_INTEGRATE_WCPRODPERIMPRESSION => array(
|
292 |
+
'label' => __( 'Products per impression', 'duracelltomi-google-tag-manager' ),
|
293 |
+
'description' => __(
|
294 |
+
'If you have many products shown on product category pages and/or on your site home, you could miss pageviews in Google Analytics due to the ' .
|
295 |
+
'amount of data that is needed to be sent. To prevent this, you can split product impression data into multiple Google Analytics events by ' .
|
296 |
+
'entering a number here (minimum 10-15 recommended) and adding gtm4wp.productImpressionEEC into your Google Analytics ecommerce event helper ' .
|
297 |
+
"tag's trigger.<br /><br />Leave this value 0 to include product impression data in your pageview hit.",
|
298 |
+
'duracelltomi-google-tag-manager'
|
299 |
+
),
|
300 |
+
'phase' => GTM4WP_PHASE_STABLE
|
301 |
+
),
|
302 |
+
GTM4WP_OPTION_INTEGRATE_WCEECCARTASFIRSTSTEP => array(
|
303 |
+
'label' => __( 'Cart as 1st checkout step', 'duracelltomi-google-tag-manager' ),
|
304 |
+
'description' => __( 'Enable this to track the cart page as the first checkout step in enhanced ecommerce instead of the checkout page itself', 'duracelltomi-google-tag-manager' ),
|
305 |
+
'phase' => GTM4WP_PHASE_STABLE
|
306 |
+
),
|
307 |
+
GTM4WP_OPTION_INTEGRATE_WCEINCLUDECARTINDL => array(
|
308 |
+
"label" => __( "Cart content in data layer", 'duracelltomi-google-tag-manager' ),
|
309 |
+
"description" => __( "Enable this option to include the content of the cart in the data layer on each page. Needs WooCommerce v3.2 or newer. Especially useful for site personalization with Google Optimize.", 'duracelltomi-google-tag-manager' ),
|
310 |
+
"phase" => GTM4WP_PHASE_STABLE
|
311 |
+
),
|
312 |
+
GTM4WP_OPTION_INTEGRATE_WCUSEFULLCATEGORYPATH => array(
|
313 |
+
'label' => __( 'Include full category path.', 'duracelltomi-google-tag-manager' ),
|
314 |
+
'description' => __( 'Check this to inclulde the full category path of each product in enhanced ecommerce tracking. WARNING! This can lead to performance issues on large sites with lots of traffic!', 'duracelltomi-google-tag-manager' ),
|
315 |
+
'phase' => GTM4WP_PHASE_STABLE
|
316 |
+
),
|
317 |
+
GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY => array(
|
318 |
+
"label" => __( "Taxonomy to be used for product brands", 'duracelltomi-google-tag-manager' ),
|
319 |
+
"description" => __( "Select which custom taxonomy is being used to add the brand of products", 'duracelltomi-google-tag-manager' ),
|
320 |
+
"phase" => GTM4WP_PHASE_STABLE
|
321 |
+
),
|
322 |
+
GTM4WP_OPTION_INTEGRATE_WCCUSTOMERDATA => array(
|
323 |
+
'label' => __( 'Customer data in data layer', 'duracelltomi-google-tag-manager' ),
|
324 |
+
'description' => __( 'Enable this to add all customer data (billing and shipping data, total number of orders and order value) into the data layer (WooCommerce 3.x required)', 'duracelltomi-google-tag-manager' ),
|
325 |
+
'phase' => GTM4WP_PHASE_STABLE
|
326 |
+
),
|
327 |
+
GTM4WP_OPTION_INTEGRATE_WCORDERDATA => array(
|
328 |
+
'label' => __( 'Order data in data layer', 'duracelltomi-google-tag-manager' ),
|
329 |
+
'description' => __( 'Enable this to add all order attribute into the data layer on the order received page regardless and independently from classic and enhanced ecommerce tracking (WooCommerce 3.x required)', 'duracelltomi-google-tag-manager' ),
|
330 |
+
'phase' => GTM4WP_PHASE_STABLE
|
331 |
+
),
|
332 |
+
GTM4WP_OPTION_INTEGRATE_WCEXCLUDETAX => array(
|
333 |
+
'label' => __( 'Exclude tax from revenue', 'duracelltomi-google-tag-manager' ),
|
334 |
+
'description' => __( 'Enable this to exclude tax from the revenue variable while generating the purchase data', 'duracelltomi-google-tag-manager' ),
|
335 |
+
'phase' => GTM4WP_PHASE_STABLE
|
336 |
+
), GTM4WP_OPTION_INTEGRATE_WCORDERMAXAGE => array(
|
337 |
+
'label' => __( 'Only track orders younger than', 'duracelltomi-google-tag-manager' ),
|
338 |
+
'description' => __( 'To prevent duplicate transaction tracking at the order received page, enter the maximum age (in minutes) of the order or its payment for the transaction to be measured. Viewing the order received page of older orders will be ignored from transaction tracking, as it is considered to be a measured in an earlier session.', 'duracelltomi-google-tag-manager' ),
|
339 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL
|
340 |
+
),
|
341 |
+
GTM4WP_OPTION_INTEGRATE_WCEXCLUDESHIPPING => array(
|
342 |
+
'label' => __( 'Exclude shipping from revenue', 'duracelltomi-google-tag-manager' ),
|
343 |
+
'description' => __( 'Enable this to exclude shipping costs from the revenue variable while generating the purchase data', 'duracelltomi-google-tag-manager' ),
|
344 |
+
'phase' => GTM4WP_PHASE_STABLE
|
345 |
+
),
|
346 |
+
GTM4WP_OPTION_INTEGRATE_WCREMARKETING => array(
|
347 |
+
'label' => __( 'Google Ads Remarketing', 'duracelltomi-google-tag-manager' ),
|
348 |
+
'description' => __( 'Enable this to add Google Ads dynamic remarketing variables to the dataLayer', 'duracelltomi-google-tag-manager' ),
|
349 |
+
'phase' => GTM4WP_PHASE_DEPRECATED
|
350 |
+
),
|
351 |
+
GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL => array(
|
352 |
+
'label' => __( 'Google Ads Business Vertical', 'duracelltomi-google-tag-manager' ),
|
353 |
+
'description' => sprintf(
|
354 |
+
__(
|
355 |
+
'Select which vertical category to add next to each product to utilize dynamic remarketing for Google Ads.'.
|
356 |
+
'<br>Use the plugin\'s <a href="%s" target="_blank" rel="noopener">official setup guide for dynamic remarketing</a> '.
|
357 |
+
'to setup your Google Tag Manager container.'
|
358 |
+
, 'duracelltomi-google-tag-manager' )
|
359 |
+
, 'https://gtm4wp.com/how-to-articles/how-to-setup-dynamic-remarketing-in-google-ads-adwords'),
|
360 |
+
'phase' => GTM4WP_PHASE_STABLE
|
361 |
+
),
|
362 |
+
GTM4WP_OPTION_INTEGRATE_WCREMPRODIDPREFIX => array(
|
363 |
+
'label' => __( 'Product ID prefix', 'duracelltomi-google-tag-manager' ),
|
364 |
+
'description' => __( "Some product feed generator plugins prefix product IDs with a fixed text like 'woocommerce_gpf'. You can enter this prefix here so that tags in your website include this prefix as well.", 'duracelltomi-google-tag-manager' ),
|
365 |
+
'phase' => GTM4WP_PHASE_STABLE
|
366 |
+
),
|
367 |
+
GTM4WP_OPTION_INTEGRATE_WCUSESKU => array(
|
368 |
+
'label' => __( 'Use SKU instead of ID', 'duracelltomi-google-tag-manager' ),
|
369 |
+
'description' => __( 'Check this to use product SKU instead of the ID of the products for remarketing and ecommerce tracking. Will fallback to ID if no SKU is set.', 'duracelltomi-google-tag-manager' ),
|
370 |
+
'phase' => GTM4WP_PHASE_STABLE
|
371 |
+
),
|
372 |
+
GTM4WP_OPTION_INTEGRATE_WCNOORDERTRACKEDFLAG => array(
|
373 |
+
'label' => __( 'Do not flag orders as being tracked', 'duracelltomi-google-tag-manager' ),
|
374 |
+
'description' => __(
|
375 |
+
'Turn this on to prevent the plugin to flag orders as being already tracked.<br /><br />'.
|
376 |
+
'Leaving this unchecked ensures that no order data will be tracked multiple times '.
|
377 |
+
'in any ad or measurement system.<br />'.
|
378 |
+
'Please only turn this feature on if you really need it!',
|
379 |
+
'duracelltomi-google-tag-manager'
|
380 |
+
),
|
381 |
+
'phase' => GTM4WP_PHASE_STABLE
|
382 |
+
),
|
383 |
+
|
384 |
+
GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZEIDS => array(
|
385 |
+
'label' => __( 'Google Optimize container ID list', 'duracelltomi-google-tag-manager' ),
|
386 |
+
'description' => sprintf(
|
387 |
+
__(
|
388 |
+
'Enter a comma separated list of Google Optimize container IDs that you would like to use on your site.<br />' .
|
389 |
+
'This plugin will add the <a href="%s">page-hiding snippet</a> to your pages.<br />',
|
390 |
+
'duracelltomi-google-tag-manager'
|
391 |
+
),
|
392 |
+
'https://developers.google.com/optimize/#the_page-hiding_snippet_code'
|
393 |
+
) .
|
394 |
+
'<br /><span class="goid_validation_error">' . __( 'This does not seems to be a valid Google Optimize ID! Valid format: GTM-XXXXXX or OPT-XXXXXX where X can be numbers and capital letters. Use comma without any space (,) to enter multpile IDs.', 'duracelltomi-google-tag-manager' ) . '</span>',
|
395 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
396 |
+
),
|
397 |
+
GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZETIMEOUT => array(
|
398 |
+
'label' => __( 'Google Optimize page-hiding timeout', 'duracelltomi-google-tag-manager' ),
|
399 |
+
'description' => __( 'Enter here the amount of time in milliseconds that the page-hiding snippet should wait before page content gets visible even if Google Optimize has not been completely loaded yet.', 'duracelltomi-google-tag-manager' ),
|
400 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
401 |
+
),
|
402 |
+
|
403 |
+
GTM4WP_OPTION_INTEGRATE_AMPID => array(
|
404 |
+
'label' => __( "Google Tag Manager 'AMP' Container ID", 'duracelltomi-google-tag-manager' ),
|
405 |
+
'description' => sprintf( __( 'Enter a comma separated list of Google Tag Manager container IDs that you would like to use on your site. This plugin will add the <a href="%s">AMP GTM snippet</a> to your AMP pages.', 'duracelltomi-google-tag-manager' ), 'https://support.google.com/tagmanager/answer/6103696?hl=en' ) .
|
406 |
+
'<br /><span class="ampid_validation_error">' . __( 'This does not seems to be a valid Google Tag Manager Container ID! Valid format: GTM-XXXXXX where X can be numbers and capital letters. Use comma without any space (,) to enter multpile IDs.', 'duracelltomi-google-tag-manager' ) . '</span>',
|
407 |
+
'phase' => GTM4WP_PHASE_EXPERIMENTAL,
|
408 |
+
'plugintocheck' => 'amp/amp.php',
|
409 |
+
),
|
410 |
+
|
411 |
+
GTM4WP_OPTION_INTEGRATE_COOKIEBOT => array(
|
412 |
+
'label' => __( 'Cookiebot auto blocking', 'duracelltomi-google-tag-manager' ),
|
413 |
+
'description' => sprintf( __( 'Enable this checkbox if you wish to use the <a href="%s" target="_blank" rel="noopener">automatic cookie blocking mode of Cookiebot with Google Tag Manager</a>.', 'duracelltomi-google-tag-manager' ), 'https://support.cookiebot.com/hc/en-us/articles/360009192739-Google-Tag-Manager-and-Automatic-cookie-blocking' ),
|
414 |
+
'phase' => GTM4WP_PHASE_STABLE
|
415 |
+
),
|
416 |
+
);
|
417 |
+
|
418 |
+
$GLOBALS['gtm4wp_advancedfieldtexts'] = array(
|
419 |
+
GTM4WP_OPTION_DATALAYER_NAME => array(
|
420 |
+
'label' => __( 'dataLayer variable name', 'duracelltomi-google-tag-manager' ),
|
421 |
+
'description' => __( 'In some cases you need to rename the dataLayer variable. You can enter your name here. Leave black for default name: dataLayer', 'duracelltomi-google-tag-manager' ),
|
422 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
423 |
+
),
|
424 |
+
GTM4WP_OPTION_ENV_GTM_AUTH => array(
|
425 |
+
'label' => __( 'Environment gtm_auth parameter', 'duracelltomi-google-tag-manager' ),
|
426 |
+
'description' => __( 'Enter the gtm_auth parameter of the Google Tag Manager environment that has to be activated on this site. Both gtm_auth and gtm_preview parameters are required to activate the desired environment.', 'duracelltomi-google-tag-manager' ),
|
427 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
428 |
+
),
|
429 |
+
GTM4WP_OPTION_ENV_GTM_PREVIEW => array(
|
430 |
+
'label' => __( 'Environment gtm_preview parameter', 'duracelltomi-google-tag-manager' ),
|
431 |
+
'description' => __( 'Enter the gtm_auth parameter of the Google Tag Manager environment that has to be activated on this site. Both gtm_auth and gtm_preview parameters are required to activate the desired environment.', 'duracelltomi-google-tag-manager' ),
|
432 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
433 |
+
),
|
434 |
+
GTM4WP_OPTION_DONOTTRACK => array(
|
435 |
+
'label' => __( "Include browser 'Do not track' setting", 'duracelltomi-google-tag-manager' ),
|
436 |
+
'description' => __( 'Add into the data layer whether the user has asked not to track any website interaction. You may want to respect this and disable all tags if this variable is set in the data layer.', 'duracelltomi-google-tag-manager' ),
|
437 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
438 |
+
),
|
439 |
+
GTM4WP_OPTION_LOADEARLY => array(
|
440 |
+
'label' => __( 'Load GTM container as early as possible', 'duracelltomi-google-tag-manager' ),
|
441 |
+
'description' => __( "Turning on this option will load your Google Tag Manager container as early as possible during page load. This can cause issues if you are using jQuery in your custom HTML tags that fire on 'Page View' events.", 'duracelltomi-google-tag-manager' ),
|
442 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
443 |
+
),
|
444 |
+
GTM4WP_OPTION_GTMDOMAIN => array(
|
445 |
+
'label' => __( 'Container domain name', 'duracelltomi-google-tag-manager' ),
|
446 |
+
'description' => __( "Enter your custom domain name if you are using a server side GTM container for tracking. Do not include https:// prefix. Leave this blank to use www.googletagmanager.com", 'duracelltomi-google-tag-manager' ),
|
447 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
448 |
+
),
|
449 |
+
GTM4WP_OPTION_NOGTMFORLOGGEDIN => array(
|
450 |
+
'label' => __( 'User roles to exclude', 'duracelltomi-google-tag-manager' ),
|
451 |
+
'description' => __( "Do not load GTM container on the frontend if role of the logged in user is any of this", 'duracelltomi-google-tag-manager' ),
|
452 |
+
'phase' => GTM4WP_PHASE_STABLE,
|
453 |
+
)
|
454 |
+
);
|
455 |
+
|
456 |
+
function gtm4wp_admin_output_section( $args ) {
|
457 |
+
echo '<span class="tabinfo">';
|
458 |
+
|
459 |
+
switch ( $args['id'] ) {
|
460 |
+
case GTM4WP_ADMIN_GROUP_GENERAL: {
|
461 |
+
_e( 'This plugin is intended to be used by IT girls&guys and marketing staff. Please be sure you read the <a href="https://developers.google.com/tag-manager/" target="_blank" rel="noopener">Google Tag Manager Help Center</a> before you start using this plugin.<br /><br />', 'duracelltomi-google-tag-manager' );
|
462 |
+
|
463 |
+
break;
|
464 |
+
}
|
465 |
+
|
466 |
+
case GTM4WP_ADMIN_GROUP_INCLUDES: {
|
467 |
+
_e( 'Here you can check what data is needed to be included in the dataLayer to be able to access them in Google Tag Manager', 'duracelltomi-google-tag-manager' );
|
468 |
+
echo '<br />';
|
469 |
+
printf( __( '* Browser, OS and Device data is provided using <a href="%s">WhichBrowser</a> library.', 'duracelltomi-google-tag-manager' ), 'http://whichbrowser.net/' );
|
470 |
+
|
471 |
+
break;
|
472 |
+
}
|
473 |
+
|
474 |
+
case GTM4WP_ADMIN_GROUP_EVENTS: {
|
475 |
+
_e( 'Fire tags in Google Tag Manager on special events on your website', 'duracelltomi-google-tag-manager' );
|
476 |
+
|
477 |
+
break;
|
478 |
+
}
|
479 |
+
|
480 |
+
case GTM4WP_ADMIN_GROUP_SCROLLER: {
|
481 |
+
_e( 'Fire tags based on how the visitor scrolls through your page.', 'duracelltomi-google-tag-manager' );
|
482 |
+
echo '<br />';
|
483 |
+
printf( __( 'Based on the script originaly posted to <a href="%s">Analytics Talk</a>', 'duracelltomi-google-tag-manager' ), 'http://cutroni.com/blog/2012/02/21/advanced-content-tracking-with-google-analytics-part-1/' );
|
484 |
+
|
485 |
+
break;
|
486 |
+
}
|
487 |
+
|
488 |
+
case GTM4WP_ADMIN_GROUP_BLACKLIST: {
|
489 |
+
_e( 'Here you can control which types of tags, triggers and variables can be executed on your site regardless of what tags are included in your container on the Google Tag Manager site. Use this to increase security!', 'duracelltomi-google-tag-manager' );
|
490 |
+
echo '<br />';
|
491 |
+
_e( 'Do not modify if you do not know what to do, since it can cause issues with your tag deployment!', 'duracelltomi-google-tag-manager' );
|
492 |
+
echo '<br />';
|
493 |
+
_e( 'For example blacklisting everything and only whitelisting the Google Analytics tag without whitelisting the URL variable type will cause your Google Analytics tags to be blocked anyway since the attached triggers (Page View) can not fire!', 'duracelltomi-google-tag-manager' );
|
494 |
+
|
495 |
+
break;
|
496 |
+
}
|
497 |
+
|
498 |
+
case GTM4WP_ADMIN_GROUP_INTEGRATION: {
|
499 |
+
_e( 'Google Tag Manager for WordPress can integrate with several popular plugins. Please check the plugins you would like to integrate with:', 'duracelltomi-google-tag-manager' );
|
500 |
+
|
501 |
+
break;
|
502 |
+
}
|
503 |
+
|
504 |
+
case GTM4WP_ADMIN_GROUP_ADVANCED: {
|
505 |
+
_e( 'You usually do not need to modify thoose settings. Please be carefull while hacking here.', 'duracelltomi-google-tag-manager' );
|
506 |
+
|
507 |
+
break;
|
508 |
+
}
|
509 |
+
|
510 |
+
case GTM4WP_ADMIN_GROUP_CREDITS: {
|
511 |
+
_e( 'Some info about the author of this plugin', 'duracelltomi-google-tag-manager' );
|
512 |
+
|
513 |
+
break;
|
514 |
+
}
|
515 |
+
} // end switch
|
516 |
+
|
517 |
+
echo '</span>';
|
518 |
+
}
|
519 |
+
|
520 |
+
function gtm4wp_admin_output_field( $args ) {
|
521 |
+
global $gtm4wp_options, $gtm4wp_business_verticals;
|
522 |
+
|
523 |
+
switch ( $args['label_for'] ) {
|
524 |
+
case GTM4WP_ADMIN_GROUP_GTMID: {
|
525 |
+
if ( defined( 'GTM4WP_HARDCODED_GTM_ID' ) ) {
|
526 |
+
$_gtm_id_value = GTM4WP_HARDCODED_GTM_ID;
|
527 |
+
$_input_readonly = ' readonly="readonly"';
|
528 |
+
$_warning_after = '<br /><span class="gtm_wpconfig_set">WARNING! Container ID was set and fixed in wp-config.php. If you wish to change this value, please edit your wp-config.php and change the container ID or remove the GTM4WP_HARDCODED_GTM_ID constant!</span>';
|
529 |
+
} else {
|
530 |
+
$_gtm_id_value = $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ];
|
531 |
+
$_input_readonly = '';
|
532 |
+
$_warning_after = '';
|
533 |
+
}
|
534 |
+
|
535 |
+
echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']" value="' . $_gtm_id_value . '" ' . $_input_readonly . '/><br />' . $args['description'];
|
536 |
+
echo $_warning_after;
|
537 |
+
echo '<br /><span class="gtmid_validation_error">' . __( 'This does not seems to be a valid Google Tag Manager ID! Valid format: GTM-XXXXX where X can be numbers and capital letters. Use comma without any space (,) to enter multpile container IDs.', 'duracelltomi-google-tag-manager' ) . '</span>';
|
538 |
+
|
539 |
+
break;
|
540 |
+
}
|
541 |
+
|
542 |
+
case GTM4WP_ADMIN_GROUP_CONTAINERON: {
|
543 |
+
echo $args['description'].'<br/><br/>';
|
544 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[container-on]_1" name="' . GTM4WP_OPTIONS . '[container-on]" value="1" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] != GTM4WP_PLACEMENT_OFF ? 'checked="checked"' : '' ) . '/> ' . __( 'On', 'duracelltomi-google-tag-manager' ) . '<br />';
|
545 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[container-on]_0" name="' . GTM4WP_OPTIONS . '[container-on]" value="0" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_OFF ? 'checked="checked"' : '' ) . '/> ' . __( 'Off', 'duracelltomi-google-tag-manager' ) . '<br />';
|
546 |
+
|
547 |
+
break;
|
548 |
+
}
|
549 |
+
|
550 |
+
case GTM4WP_ADMIN_GROUP_COMPATMODE: {
|
551 |
+
echo $args['description'].'<br/><br/>';
|
552 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[compat-mode]_' . GTM4WP_PLACEMENT_BODYOPEN_AUTO . '" name="' . GTM4WP_OPTIONS . '[compat-mode]" value="' . GTM4WP_PLACEMENT_BODYOPEN_AUTO . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_BODYOPEN_AUTO || $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_OFF ? 'checked="checked"' : '' ) . '/> ' . __( 'Off (no tweak, right placement)', 'duracelltomi-google-tag-manager' ) . '<br />';
|
553 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[compat-mode]_' . GTM4WP_PLACEMENT_FOOTER . '" name="' . GTM4WP_OPTIONS . '[compat-mode]" value="' . GTM4WP_PLACEMENT_FOOTER . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_FOOTER ? 'checked="checked"' : '' ) . '/> ' . __( 'Footer of the page (not recommended by Google, Search Console verification will not work)', 'duracelltomi-google-tag-manager' ) . '<br />';
|
554 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[compat-mode]_' . GTM4WP_PLACEMENT_BODYOPEN . '" name="' . GTM4WP_OPTIONS . '[compat-mode]" value="' . GTM4WP_PLACEMENT_BODYOPEN . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_BODYOPEN ? 'checked="checked"' : '' ) . '/> ' . __( 'Manually coded (needs tweak in your template)', 'duracelltomi-google-tag-manager' ) . '<br />';
|
555 |
+
|
556 |
+
break;
|
557 |
+
}
|
558 |
+
|
559 |
+
case GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_DATALAYER_NAME . ']': {
|
560 |
+
echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_DATALAYER_NAME . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_DATALAYER_NAME . ']" value="' . $gtm4wp_options[ GTM4WP_OPTION_DATALAYER_NAME ] . '" /><br />' . $args['description'];
|
561 |
+
echo '<br /><span class="datalayername_validation_error">' . __( 'This does not seems to be a valid JavaScript variable name! Please check and try again', 'duracelltomi-google-tag-manager' ) . '</span>';
|
562 |
+
|
563 |
+
break;
|
564 |
+
}
|
565 |
+
|
566 |
+
case GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_AUTH . ']': {
|
567 |
+
if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_AUTH' ) ) {
|
568 |
+
$_gtm_auth_value = GTM4WP_HARDCODED_GTM_ENV_AUTH;
|
569 |
+
$_input_readonly = ' readonly="readonly"';
|
570 |
+
$_warning_after = '<br /><span class="gtm_wpconfig_set">WARNING! Environment auth parameter was set and fixed in wp-config.php. If you wish to change this value, please edit your wp-config.php and change the parameter value or remove the GTM4WP_HARDCODED_GTM_ENV_AUTH constant!</span>';
|
571 |
+
} else {
|
572 |
+
$_gtm_auth_value = $gtm4wp_options[ GTM4WP_OPTION_ENV_GTM_AUTH ];
|
573 |
+
$_input_readonly = '';
|
574 |
+
$_warning_after = '';
|
575 |
+
}
|
576 |
+
|
577 |
+
echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_AUTH . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_AUTH . ']" value="' . $_gtm_auth_value . '" ' . $_input_readonly . '/><br />' . $args['description'];
|
578 |
+
echo $_warning_after;
|
579 |
+
echo '<br /><span class="gtmauth_validation_error">' . __( 'This does not seems to be a valid gtm_auth parameter! It should only contain letters, number and the "-" character. Please check and try again', 'duracelltomi-google-tag-manager' ) . '</span>';
|
580 |
+
|
581 |
+
break;
|
582 |
+
}
|
583 |
+
|
584 |
+
case GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_PREVIEW . ']': {
|
585 |
+
if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_PREVIEW' ) ) {
|
586 |
+
$_gtm_preview_value = GTM4WP_HARDCODED_GTM_ENV_PREVIEW;
|
587 |
+
$_input_readonly = ' readonly="readonly"';
|
588 |
+
$_warning_after = '<br /><span class="gtm_wpconfig_set">WARNING! Environment preview parameter was set and fixed in wp-config.php. If you wish to change this value, please edit your wp-config.php and change the parameter value or remove the GTM4WP_HARDCODED_GTM_ENV_PREVIEW constant!</span>';
|
589 |
+
} else {
|
590 |
+
$_gtm_preview_value = $gtm4wp_options[ GTM4WP_OPTION_ENV_GTM_PREVIEW ];
|
591 |
+
$_input_readonly = '';
|
592 |
+
$_warning_after = '';
|
593 |
+
}
|
594 |
+
|
595 |
+
echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_PREVIEW . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_PREVIEW . ']" value="' . $_gtm_preview_value . '" ' . $_input_readonly . '/><br />' . $args['description'];
|
596 |
+
echo $_warning_after;
|
597 |
+
echo '<br /><span class="gtmpreview_validation_error">' . __( 'This does not seems to be a valid gtm_preview parameter! It should have the format "env-NN" where NN is an integer number. Please check and try again', 'duracelltomi-google-tag-manager' ) . '</span>';
|
598 |
+
|
599 |
+
break;
|
600 |
+
}
|
601 |
+
|
602 |
+
case GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']': {
|
603 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']_0" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']" value="0" ' . ( $gtm4wp_options[ GTM4WP_OPTION_BLACKLIST_ENABLE ] == 0 ? 'checked="checked"' : '' ) . '/> ' . __( 'Disable feature: control everything on Google Tag Manager interface', 'duracelltomi-google-tag-manager' ) . '<br />';
|
604 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']_1" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']" value="1" ' . ( $gtm4wp_options[ GTM4WP_OPTION_BLACKLIST_ENABLE ] == 1 ? 'checked="checked"' : '' ) . '/> ' . __( 'Allow all, except the checked items on all blacklist tabs (blacklist)', 'duracelltomi-google-tag-manager' ) . '<br />';
|
605 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']_2" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']" value="2" ' . ( $gtm4wp_options[ GTM4WP_OPTION_BLACKLIST_ENABLE ] == 2 ? 'checked="checked"' : '' ) . '/> ' . __( 'Block all, except the checked items on all blacklist tabs (whitelist)', 'duracelltomi-google-tag-manager' ) . '<br />';
|
606 |
+
echo $args['description'];
|
607 |
+
|
608 |
+
break;
|
609 |
+
}
|
610 |
+
|
611 |
+
case GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . ']': {
|
612 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . ']_0" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . ']" value="0" ' . ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_WEATHERUNITS ] == 0 ? 'checked="checked"' : '' ) . '/> ' . __( 'Celsius', 'duracelltomi-google-tag-manager' ) . '<br />';
|
613 |
+
echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . ']_1" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . ']" value="1" ' . ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_WEATHERUNITS ] == 1 ? 'checked="checked"' : '' ) . '/> ' . __( 'Fahrenheit', 'duracelltomi-google-tag-manager' ) . '<br />';
|
614 |
+
echo $args['description'];
|
615 |
+
|
616 |
+
break;
|
617 |
+
}
|
618 |
+
|
619 |
+
case GTM4WP_ADMIN_GROUP_INFO: {
|
620 |
+
echo $args['description'];
|
621 |
+
|
622 |
+
break;
|
623 |
+
}
|
624 |
+
|
625 |
+
case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY . "]": {
|
626 |
+
echo '<select id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY . ']">';
|
627 |
+
echo '<option value="">(not set)</option>';
|
628 |
+
|
629 |
+
$gtm4wp_taxonomies = get_taxonomies(array(
|
630 |
+
"show_ui" => true,
|
631 |
+
"public" => true,
|
632 |
+
"_builtin" => false
|
633 |
+
), "object", "and");
|
634 |
+
|
635 |
+
foreach( $gtm4wp_taxonomies as $onetaxonomy ) {
|
636 |
+
echo '<option value="' . $onetaxonomy->name . '"' . ( $gtm4wp_options[GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY] === $onetaxonomy->name ? ' selected="selected"' : '' ) . '>' . $onetaxonomy->label . '</option>';
|
637 |
+
}
|
638 |
+
|
639 |
+
echo '</select>';
|
640 |
+
|
641 |
+
break;
|
642 |
+
}
|
643 |
+
|
644 |
+
case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL . "]": {
|
645 |
+
echo '<select id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL . ']">';
|
646 |
+
|
647 |
+
foreach( $gtm4wp_business_verticals as $vertical_id => $vertical_display_name ) {
|
648 |
+
echo '<option value="' . $vertical_id . '"' . ( $gtm4wp_options[GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL] === $vertical_id ? ' selected="selected"' : '' ) . '>' . $vertical_display_name . '</option>';
|
649 |
+
}
|
650 |
+
|
651 |
+
echo '</select><br>' . $args['description'];
|
652 |
+
|
653 |
+
break;
|
654 |
+
}
|
655 |
+
|
656 |
+
case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_NOGTMFORLOGGEDIN . "]": {
|
657 |
+
$roles = get_editable_roles();
|
658 |
+
|
659 |
+
echo $args['description'].'<br/><br/>';
|
660 |
+
|
661 |
+
$saved_roles = explode(",", $gtm4wp_options[GTM4WP_OPTION_NOGTMFORLOGGEDIN]);
|
662 |
+
|
663 |
+
foreach($roles as $role_id => $role_info) {
|
664 |
+
$role_name = translate_user_role( $role_info['name'] );
|
665 |
+
echo '<input type="checkbox" id="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']_' . $role_id . '" name="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . '][]" value="' . $role_id . '"' . ( in_array( $role_id, $saved_roles ) ? ' checked="checked"' : '' ) . '><label for="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']_' . $role_id . '">' . $role_name . '</label><br/>';
|
666 |
+
}
|
667 |
+
|
668 |
+
break;
|
669 |
+
}
|
670 |
+
|
671 |
+
default: {
|
672 |
+
if ( preg_match( '/' . GTM4WP_OPTIONS . "\\[blacklist\\-[^\\]]+\\]/i", $args['label_for'] ) ) {
|
673 |
+
if ( 'blacklist-sandboxed' == $args['entityid'] ) {
|
674 |
+
echo '<input type="checkbox" id="' . $args['label_for'] . '" name="' . $args['label_for'] . '" value="1" ' . checked( 1, $gtm4wp_options[ GTM4WP_OPTION_BLACKLIST_SANDBOXED ], false ) . ' /><br />' . $args['description'];
|
675 |
+
} else {
|
676 |
+
echo '<input type="checkbox" id="' . $args['label_for'] . '" name="' . $args['label_for'] . '" value="1" ' . checked( 1, in_array( $args['entityid'], $gtm4wp_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] ), false ) . ' /><br />' . $args['description'];
|
677 |
+
}
|
678 |
+
} else {
|
679 |
+
$optval = $gtm4wp_options[ $args['optionfieldid'] ];
|
680 |
+
|
681 |
+
switch ( gettype( $optval ) ) {
|
682 |
+
case 'boolean': {
|
683 |
+
echo '<input type="checkbox" id="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']" name="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']" value="1" ' . checked( 1, $optval, false ) . ' /><br />' . $args['description'];
|
684 |
+
|
685 |
+
if ( isset( $args['plugintocheck'] ) && ( $args['plugintocheck'] != '' ) ) {
|
686 |
+
if ( is_plugin_active( $args['plugintocheck'] ) ) {
|
687 |
+
echo '<br />' . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recommended to enable this integration!', 'duracelltomi-google-tag-manager' );
|
688 |
+
} else {
|
689 |
+
echo '<br />' . __( 'This plugin (' . $args['plugintocheck'] . ') is <strong class="gtm4wp-plugin-not-active">not active</strong>, enabling this integration could cause issues on frontend!', 'duracelltomi-google-tag-manager' );
|
690 |
+
}
|
691 |
+
}
|
692 |
+
|
693 |
+
break;
|
694 |
+
}
|
695 |
+
|
696 |
+
case 'integer': {
|
697 |
+
echo '<input type="number" step="1" min="0" class="small-text" id="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']" name="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']" value="' . esc_attr( $optval ) . '" /><br />' . $args['description'];
|
698 |
+
|
699 |
+
if ( isset( $args['plugintocheck'] ) && ( $args['plugintocheck'] != '' ) ) {
|
700 |
+
if ( is_plugin_active( $args['plugintocheck'] ) ) {
|
701 |
+
echo '<br />' . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recommended to enable this integration!', 'duracelltomi-google-tag-manager' );
|
702 |
+
} else {
|
703 |
+
echo '<br />' . __( 'This plugin is <strong class="gtm4wp-plugin-not-active">not active</strong>, enabling this integration could cause issues on frontend!', 'duracelltomi-google-tag-manager' );
|
704 |
+
}
|
705 |
+
}
|
706 |
+
|
707 |
+
break;
|
708 |
+
}
|
709 |
+
|
710 |
+
default : {
|
711 |
+
echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']" name="' . GTM4WP_OPTIONS . '[' . $args['optionfieldid'] . ']" value="' . esc_attr( $optval ) . '" size="80" /><br />' . $args['description'];
|
712 |
+
|
713 |
+
if ( isset( $args['plugintocheck'] ) && ( $args['plugintocheck'] != '' ) ) {
|
714 |
+
if ( is_plugin_active( $args['plugintocheck'] ) ) {
|
715 |
+
echo '<br />' . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recommended to enable this integration!', 'duracelltomi-google-tag-manager' );
|
716 |
+
} else {
|
717 |
+
echo '<br />' . __( 'This plugin is <strong class="gtm4wp-plugin-not-active">not active</strong>, enabling this integration could cause issues on frontend!', 'duracelltomi-google-tag-manager' );
|
718 |
+
}
|
719 |
+
}
|
720 |
+
}
|
721 |
+
} // end switch gettype optval
|
722 |
+
}
|
723 |
+
}
|
724 |
+
} // end switch
|
725 |
+
}
|
726 |
+
|
727 |
+
function gtm4wp_sanitize_options( $options ) {
|
728 |
+
global $wpdb, $gtm4wp_entity_ids;
|
729 |
+
|
730 |
+
$output = gtm4wp_reload_options();
|
731 |
+
|
732 |
+
foreach ( $output as $optionname => $optionvalue ) {
|
733 |
+
if ( isset( $options[ $optionname ] ) ) {
|
734 |
+
$newoptionvalue = $options[ $optionname ];
|
735 |
+
} else {
|
736 |
+
$newoptionvalue = '';
|
737 |
+
}
|
738 |
+
|
739 |
+
// "include" settings
|
740 |
+
if ( substr( $optionname, 0, 8 ) == 'include-' ) {
|
741 |
+
$output[ $optionname ] = (bool) $newoptionvalue;
|
742 |
+
|
743 |
+
// dataLayer events
|
744 |
+
} elseif ( substr( $optionname, 0, 6 ) == 'event-' ) {
|
745 |
+
$output[ $optionname ] = (bool) $newoptionvalue;
|
746 |
+
|
747 |
+
// clear oembed transients when feature is enabled because we need to hook into the oembed process to enable some 3rd party APIs
|
748 |
+
if ( $output[ $optionname ] && ! $optionvalue ) {
|
749 |
+
if ( GTM4WP_OPTION_EVENTS_YOUTUBE == $optionname ) {
|
750 |
+
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_value LIKE '%youtube.com%' AND meta_key LIKE '_oembed_%'" );
|
751 |
+
}
|
752 |
+
|
753 |
+
if ( GTM4WP_OPTION_EVENTS_VIMEO == $optionname ) {
|
754 |
+
$wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_value LIKE '%vimeo.com%' AND meta_key LIKE '_oembed_%'" );
|
755 |
+
}
|
756 |
+
}
|
757 |
+
|
758 |
+
// blacklist / whitelist entities
|
759 |
+
} elseif ( substr( $optionname, 0, 10 ) == 'blacklist-' ) {
|
760 |
+
if ( GTM4WP_OPTION_BLACKLIST_ENABLE === $optionname ) {
|
761 |
+
$output[ $optionname ] = (int) $options[ GTM4WP_OPTION_BLACKLIST_ENABLE ];
|
762 |
+
} else if ( GTM4WP_OPTION_BLACKLIST_SANDBOXED == $optionname ) {
|
763 |
+
$output[ $optionname ] = (bool) $newoptionvalue;
|
764 |
+
} else if ( GTM4WP_OPTION_BLACKLIST_STATUS == $optionname ) {
|
765 |
+
$selected_blacklist_entities = array();
|
766 |
+
|
767 |
+
foreach( $gtm4wp_entity_ids as $gtm_entity_group_id => $gtm_entity_group_list ) {
|
768 |
+
foreach( $gtm_entity_group_list as $gtm_entity_id => $gtm_entity_label ) {
|
769 |
+
$entity_option_id = 'blacklist-' . $gtm_entity_group_id . '-' . $gtm_entity_id;
|
770 |
+
if ( array_key_exists( $entity_option_id, $options ) ) {
|
771 |
+
$newoptionvalue = (bool) $options[ $entity_option_id ];
|
772 |
+
if ( $newoptionvalue ) {
|
773 |
+
$selected_blacklist_entities[] = $gtm_entity_id;
|
774 |
+
}
|
775 |
+
}
|
776 |
+
}
|
777 |
+
}
|
778 |
+
|
779 |
+
$output[ $optionname ] = implode( ',', $selected_blacklist_entities );
|
780 |
+
}
|
781 |
+
|
782 |
+
// Google Optimize settings
|
783 |
+
} elseif ( $optionname == GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZEIDS ) {
|
784 |
+
$_goid_val = trim( $newoptionvalue );
|
785 |
+
if ( '' == $_goid_val ) {
|
786 |
+
$_goid_list = array();
|
787 |
+
} else {
|
788 |
+
$_goid_list = explode( ',', $_goid_val );
|
789 |
+
}
|
790 |
+
$_goid_haserror = false;
|
791 |
+
|
792 |
+
foreach ( $_goid_list as $one_go_id ) {
|
793 |
+
$_goid_haserror = $_goid_haserror || ! preg_match( '/^(GTM|OPT)-[A-Z0-9]+$/', $one_go_id );
|
794 |
+
}
|
795 |
+
|
796 |
+
if ( $_goid_haserror && ( count( $_goid_list ) > 0 ) ) {
|
797 |
+
add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZEIDS . ']', __( 'Invalid Google Optimize ID. Valid ID format: GTM-XXXXX or OPT-XXXXX. Use comma without additional space (,) to enter more than one ID.', 'duracelltomi-google-tag-manager' ) );
|
798 |
+
} else {
|
799 |
+
$output[ $optionname ] = $newoptionvalue;
|
800 |
+
}
|
801 |
+
} elseif ( $optionname == GTM4WP_OPTION_INTEGRATE_GOOGLEOPTIMIZETIMEOUT ) {
|
802 |
+
$output[ $optionname ] = (int) $newoptionvalue;
|
803 |
+
|
804 |
+
} elseif ( $optionname == GTM4WP_OPTION_INTEGRATE_WCPRODPERIMPRESSION ) {
|
805 |
+
$output[ $optionname ] = (int) $newoptionvalue;
|
806 |
+
|
807 |
+
} elseif ( $optionname == GTM4WP_OPTION_INTEGRATE_WCORDERMAXAGE ) {
|
808 |
+
$output[ $optionname ] = (int) $newoptionvalue;
|
809 |
+
|
810 |
+
}elseif ( $optionname == GTM4WP_OPTION_INTEGRATE_WCREMPRODIDPREFIX ) {
|
811 |
+
$output[ $optionname ] = trim( (string) $newoptionvalue );
|
812 |
+
|
813 |
+
} else if ( $optionname == GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY ) {
|
814 |
+
$output[$optionname] = trim( (string) $newoptionvalue );
|
815 |
+
|
816 |
+
} else if ( $optionname == GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ) {
|
817 |
+
$output[$optionname] = trim( (string) $newoptionvalue );
|
818 |
+
|
819 |
+
} else if ( $optionname == GTM4WP_OPTION_GTMDOMAIN ) {
|
820 |
+
// for PHP 7- compatibility
|
821 |
+
if ( !defined("FILTER_FLAG_HOSTNAME") ) {
|
822 |
+
define( "FILTER_FLAG_HOSTNAME", 0 );
|
823 |
+
}
|
824 |
+
|
825 |
+
// remove https:// prefix if used
|
826 |
+
$newoptionvalue = str_replace( 'https://', '', $newoptionvalue );
|
827 |
+
|
828 |
+
$newoptionvalue = filter_var( $newoptionvalue, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME );
|
829 |
+
if ( $newoptionvalue === false ) {
|
830 |
+
$newoptionvalue = '';
|
831 |
+
}
|
832 |
+
$output[$optionname] = trim( (string) $newoptionvalue );
|
833 |
+
|
834 |
+
// Accelerated Mobile Pages settings
|
835 |
+
} elseif ( $optionname == GTM4WP_OPTION_INTEGRATE_AMPID ) {
|
836 |
+
$_ampid_val = trim( $newoptionvalue );
|
837 |
+
if ( '' == $_ampid_val ) {
|
838 |
+
$_ampid_list = array();
|
839 |
+
} else {
|
840 |
+
$_ampid_list = explode( ',', $_ampid_val );
|
841 |
+
}
|
842 |
+
$_ampid_haserror = false;
|
843 |
+
|
844 |
+
foreach ( $_ampid_list as $one_amp_id ) {
|
845 |
+
$_ampid_haserror = $_ampid_haserror || ! preg_match( '/^GTM-[A-Z0-9]+$/', $one_amp_id );
|
846 |
+
}
|
847 |
+
|
848 |
+
if ( $_ampid_haserror && ( count( $_ampid_list ) > 0 ) ) {
|
849 |
+
add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_INTEGRATE_AMPID . ']', __( 'Invalid AMP Google Tag Manager Container ID. Valid ID format: GTM-XXXXX. Use comma without additional space (,) to enter more than one ID.', 'duracelltomi-google-tag-manager' ) );
|
850 |
+
} else {
|
851 |
+
$output[ $optionname ] = $newoptionvalue;
|
852 |
+
}
|
853 |
+
|
854 |
+
// integrations
|
855 |
+
} elseif ( substr( $optionname, 0, 10 ) == 'integrate-' ) {
|
856 |
+
$output[ $optionname ] = (bool) $newoptionvalue;
|
857 |
+
|
858 |
+
// GTM code or dataLayer variable name
|
859 |
+
} elseif ( ( $optionname == GTM4WP_OPTION_GTM_CODE ) || ( $optionname == GTM4WP_OPTION_DATALAYER_NAME ) || ( $optionname == GTM4WP_OPTION_ENV_GTM_AUTH ) || ( $optionname == GTM4WP_OPTION_ENV_GTM_PREVIEW ) ) {
|
860 |
+
$newoptionvalue = trim( $newoptionvalue );
|
861 |
+
|
862 |
+
if ( $optionname == GTM4WP_OPTION_GTM_CODE ) {
|
863 |
+
$_gtmid_list = explode( ',', $newoptionvalue );
|
864 |
+
$_gtmid_haserror = false;
|
865 |
+
|
866 |
+
foreach ( $_gtmid_list as $one_gtm_id ) {
|
867 |
+
$_gtmid_haserror = $_gtmid_haserror || ! preg_match( '/^GTM-[A-Z0-9]+$/', $one_gtm_id );
|
868 |
+
}
|
869 |
+
|
870 |
+
if ( $_gtmid_haserror ) {
|
871 |
+
add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']', __( 'Invalid Google Tag Manager ID. Valid ID format: GTM-XXXXX. Use comma without additional space (,) to enter more than one container ID.', 'duracelltomi-google-tag-manager' ) );
|
872 |
+
} else {
|
873 |
+
$output[ $optionname ] = $newoptionvalue;
|
874 |
+
}
|
875 |
+
} elseif ( ( $optionname == GTM4WP_OPTION_DATALAYER_NAME ) && ( $newoptionvalue != '' ) && ( ! preg_match( '/^[a-zA-Z][a-zA-Z0-9_-]*$/', $newoptionvalue ) ) ) {
|
876 |
+
add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_DATALAYER_NAME . ']', __( "Invalid dataLayer variable name. Please start with a character from a-z or A-Z followed by characters from a-z, A-Z, 0-9 or '_' or '-'!", 'duracelltomi-google-tag-manager' ) );
|
877 |
+
|
878 |
+
} elseif ( ( $optionname == GTM4WP_OPTION_ENV_GTM_AUTH ) && ( $newoptionvalue != '' ) && ( ! preg_match( '/^[a-zA-Z0-9-_]+$/', $newoptionvalue ) ) ) {
|
879 |
+
add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_AUTH . ']', __( "Invalid gtm_auth environment parameter value. It should only contain letters, numbers or the '-' and '_' characters.", 'duracelltomi-google-tag-manager' ) );
|
880 |
+
|
881 |
+
} elseif ( ( $optionname == GTM4WP_OPTION_ENV_GTM_PREVIEW ) && ( $newoptionvalue != '' ) && ( ! preg_match( '/^env-[0-9]+$/', $newoptionvalue ) ) ) {
|
882 |
+
add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_ENV_GTM_PREVIEW . ']', __( "Invalid gtm_preview environment parameter value. It should have the format 'env-NN' where NN is an integer number.", 'duracelltomi-google-tag-manager' ) );
|
883 |
+
|
884 |
+
} else {
|
885 |
+
$output[ $optionname ] = $newoptionvalue;
|
886 |
+
}
|
887 |
+
|
888 |
+
// GTM container ON/OFF + compat mode
|
889 |
+
} elseif ( $optionname == GTM4WP_OPTION_GTM_PLACEMENT ) {
|
890 |
+
$container_on_off = (bool) $options['container-on'];
|
891 |
+
$container_compat = (int) $options['compat-mode'];
|
892 |
+
|
893 |
+
if ( !$container_on_off ) {
|
894 |
+
$output[ $optionname ] = GTM4WP_PLACEMENT_OFF;
|
895 |
+
} else {
|
896 |
+
if ( ( $container_compat < 0 ) || ( $container_compat > 2 ) ) {
|
897 |
+
$container_compat = 2;
|
898 |
+
}
|
899 |
+
|
900 |
+
$output[ $optionname ] = $container_compat;
|
901 |
+
}
|
902 |
+
|
903 |
+
// scroll tracking content ID
|
904 |
+
} elseif ( $optionname == GTM4WP_OPTION_SCROLLER_CONTENTID ) {
|
905 |
+
$output[ $optionname ] = trim( str_replace( '#', '', $newoptionvalue ) );
|
906 |
+
|
907 |
+
// do not output GTM container code for specific user roles
|
908 |
+
} elseif ( $optionname == GTM4WP_OPTION_NOGTMFORLOGGEDIN ) {
|
909 |
+
if ( is_array( $newoptionvalue ) ) {
|
910 |
+
$output[ $optionname ] = implode(",", $newoptionvalue );
|
911 |
+
} else {
|
912 |
+
$output[ $optionname ] = '';
|
913 |
+
}
|
914 |
+
|
915 |
+
// anything else
|
916 |
+
} else {
|
917 |
+
switch ( gettype( $optionvalue ) ) {
|
918 |
+
case 'boolean': {
|
919 |
+
$output[ $optionname ] = (bool) $newoptionvalue;
|
920 |
+
|
921 |
+
break;
|
922 |
+
}
|
923 |
+
|
924 |
+
case 'integer': {
|
925 |
+
$output[ $optionname ] = (int) $newoptionvalue;
|
926 |
+
|
927 |
+
break;
|
928 |
+
}
|
929 |
+
|
930 |
+
default: {
|
931 |
+
$output[ $optionname ] = $newoptionvalue;
|
932 |
+
}
|
933 |
+
} // end switch
|
934 |
+
}
|
935 |
+
}
|
936 |
+
|
937 |
+
return $output;
|
938 |
+
}
|
939 |
+
|
940 |
+
function gtm4wp_admin_init() {
|
941 |
+
global $gtm4wp_includefieldtexts, $gtm4wp_eventfieldtexts, $gtm4wp_integratefieldtexts, $gtm4wp_scrollerfieldtexts,
|
942 |
+
$gtm4wp_advancedfieldtexts, $gtm4wp_entity_ids;
|
943 |
+
|
944 |
+
register_setting( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS, 'gtm4wp_sanitize_options' );
|
945 |
+
|
946 |
+
add_settings_section(
|
947 |
+
GTM4WP_ADMIN_GROUP_GENERAL,
|
948 |
+
__( 'General', 'duracelltomi-google-tag-manager' ),
|
949 |
+
'gtm4wp_admin_output_section',
|
950 |
+
GTM4WP_ADMINSLUG
|
951 |
+
);
|
952 |
+
|
953 |
+
add_settings_field(
|
954 |
+
GTM4WP_ADMIN_GROUP_GTMID,
|
955 |
+
__( 'Google Tag Manager ID', 'duracelltomi-google-tag-manager' ),
|
956 |
+
'gtm4wp_admin_output_field',
|
957 |
+
GTM4WP_ADMINSLUG,
|
958 |
+
GTM4WP_ADMIN_GROUP_GENERAL,
|
959 |
+
array(
|
960 |
+
'label_for' => GTM4WP_ADMIN_GROUP_GTMID,
|
961 |
+
'description' => __( 'Enter your Google Tag Manager ID here. Use comma without space (,) to enter multiple IDs.', 'duracelltomi-google-tag-manager' ),
|
962 |
+
)
|
963 |
+
);
|
964 |
+
|
965 |
+
add_settings_field(
|
966 |
+
GTM4WP_ADMIN_GROUP_CONTAINERON,
|
967 |
+
__( 'Container code ON/OFF', 'duracelltomi-google-tag-manager' ),
|
968 |
+
'gtm4wp_admin_output_field',
|
969 |
+
GTM4WP_ADMINSLUG,
|
970 |
+
GTM4WP_ADMIN_GROUP_GENERAL,
|
971 |
+
array(
|
972 |
+
'label_for' => GTM4WP_ADMIN_GROUP_CONTAINERON,
|
973 |
+
'description' => __( "Turning OFF the Google Tag Manager container itself will remove both the head and the body part of the container code but leave data layer codes working.<br/>This should be only used in specific cases where you need to place the container code manually or using another tool.", 'duracelltomi-google-tag-manager' ),
|
974 |
+
)
|
975 |
+
);
|
976 |
+
|
977 |
+
add_settings_field(
|
978 |
+
GTM4WP_ADMIN_GROUP_COMPATMODE,
|
979 |
+
__( 'Container code compatibility mode', 'duracelltomi-google-tag-manager' ),
|
980 |
+
'gtm4wp_admin_output_field',
|
981 |
+
GTM4WP_ADMINSLUG,
|
982 |
+
GTM4WP_ADMIN_GROUP_GENERAL,
|
983 |
+
array(
|
984 |
+
'label_for' => GTM4WP_ADMIN_GROUP_COMPATMODE,
|
985 |
+
'description' => __(
|
986 |
+
'Compatibility mode decides where to put the second, so called <code><noscript></code> or <code><iframe></code> part of the GTM container code.<br />'.
|
987 |
+
'This code is usually only executed if your visitor has disabled JavaScript for some reason.<br/>'.
|
988 |
+
'It is also mandatory in order to verify your site in Google Search Console using the GTM method.<br/>'.
|
989 |
+
'The main GTM container code will be placed into the <code><head></code> section of your webpages anyway (where it belongs to).<br/><br/>'.
|
990 |
+
'If you select "Manually coded", you need to edit your template files and add the following line just after the opening <code><body></code> tag:<br />'.
|
991 |
+
"<code><?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?></code>",
|
992 |
+
'duracelltomi-google-tag-manager'
|
993 |
+
),
|
994 |
+
)
|
995 |
+
);
|
996 |
+
|
997 |
+
add_settings_section(
|
998 |
+
GTM4WP_ADMIN_GROUP_INCLUDES,
|
999 |
+
__( 'Basic data', 'duracelltomi-google-tag-manager' ),
|
1000 |
+
'gtm4wp_admin_output_section',
|
1001 |
+
GTM4WP_ADMINSLUG
|
1002 |
+
);
|
1003 |
+
|
1004 |
+
foreach ( $gtm4wp_includefieldtexts as $fieldid => $fielddata ) {
|
1005 |
+
$phase = isset( $fielddata['phase'] ) ? $fielddata['phase'] : GTM4WP_PHASE_STABLE;
|
1006 |
+
|
1007 |
+
add_settings_field(
|
1008 |
+
'gtm4wp-admin-' . $fieldid . '-id',
|
1009 |
+
$fielddata['label'] . '<span class="' . $phase . '"></span>',
|
1010 |
+
'gtm4wp_admin_output_field',
|
1011 |
+
GTM4WP_ADMINSLUG,
|
1012 |
+
GTM4WP_ADMIN_GROUP_INCLUDES,
|
1013 |
+
array(
|
1014 |
+
'label_for' => 'gtm4wp-options[' . $fieldid . ']',
|
1015 |
+
'description' => $fielddata['description'],
|
1016 |
+
'optionfieldid' => $fieldid,
|
1017 |
+
)
|
1018 |
+
);
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
add_settings_section(
|
1022 |
+
GTM4WP_ADMIN_GROUP_EVENTS,
|
1023 |
+
__( 'Events', 'duracelltomi-google-tag-manager' ),
|
1024 |
+
'gtm4wp_admin_output_section',
|
1025 |
+
GTM4WP_ADMINSLUG
|
1026 |
+
);
|
1027 |
+
|
1028 |
+
foreach ( $gtm4wp_eventfieldtexts as $fieldid => $fielddata ) {
|
1029 |
+
$phase = isset( $fielddata['phase'] ) ? $fielddata['phase'] : GTM4WP_PHASE_STABLE;
|
1030 |
+
|
1031 |
+
add_settings_field(
|
1032 |
+
'gtm4wp-admin-' . $fieldid . '-id',
|
1033 |
+
$fielddata['label'] . '<span class="' . $phase . '"></span>',
|
1034 |
+
'gtm4wp_admin_output_field',
|
1035 |
+
GTM4WP_ADMINSLUG,
|
1036 |
+
GTM4WP_ADMIN_GROUP_EVENTS,
|
1037 |
+
array(
|
1038 |
+
'label_for' => 'gtm4wp-options[' . $fieldid . ']',
|
1039 |
+
'description' => $fielddata['description'],
|
1040 |
+
'optionfieldid' => $fieldid,
|
1041 |
+
)
|
1042 |
+
);
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
add_settings_section(
|
1046 |
+
GTM4WP_ADMIN_GROUP_SCROLLER,
|
1047 |
+
__( 'Scroll tracking', 'duracelltomi-google-tag-manager' ),
|
1048 |
+
'gtm4wp_admin_output_section',
|
1049 |
+
GTM4WP_ADMINSLUG
|
1050 |
+
);
|
1051 |
+
|
1052 |
+
foreach ( $gtm4wp_scrollerfieldtexts as $fieldid => $fielddata ) {
|
1053 |
+
$phase = isset( $fielddata['phase'] ) ? $fielddata['phase'] : GTM4WP_PHASE_STABLE;
|
1054 |
+
|
1055 |
+
add_settings_field(
|
1056 |
+
'gtm4wp-admin-' . $fieldid . '-id',
|
1057 |
+
$fielddata['label'] . '<span class="' . $phase . '"></span>',
|
1058 |
+
'gtm4wp_admin_output_field',
|
1059 |
+
GTM4WP_ADMINSLUG,
|
1060 |
+
GTM4WP_ADMIN_GROUP_SCROLLER,
|
1061 |
+
array(
|
1062 |
+
'label_for' => 'gtm4wp-options[' . $fieldid . ']',
|
1063 |
+
'description' => $fielddata['description'],
|
1064 |
+
'optionfieldid' => $fieldid,
|
1065 |
+
)
|
1066 |
+
);
|
1067 |
+
}
|
1068 |
+
|
1069 |
+
add_settings_section(
|
1070 |
+
GTM4WP_ADMIN_GROUP_BLACKLIST,
|
1071 |
+
__( 'Security', 'duracelltomi-google-tag-manager' ),
|
1072 |
+
'gtm4wp_admin_output_section',
|
1073 |
+
GTM4WP_ADMINSLUG
|
1074 |
+
);
|
1075 |
+
|
1076 |
+
add_settings_field(
|
1077 |
+
GTM4WP_OPTION_BLACKLIST_ENABLE,
|
1078 |
+
__( 'Enable blacklist/whitelist', 'duracelltomi-google-tag-manager' ),
|
1079 |
+
'gtm4wp_admin_output_field',
|
1080 |
+
GTM4WP_ADMINSLUG,
|
1081 |
+
GTM4WP_ADMIN_GROUP_BLACKLIST,
|
1082 |
+
array(
|
1083 |
+
'label_for' => GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_ENABLE . ']',
|
1084 |
+
'description' => '',
|
1085 |
+
'optionsfieldid' => GTM4WP_OPTION_BLACKLIST_ENABLE
|
1086 |
+
)
|
1087 |
+
);
|
1088 |
+
|
1089 |
+
add_settings_field(
|
1090 |
+
GTM4WP_OPTION_BLACKLIST_SANDBOXED,
|
1091 |
+
__( 'Custom tag/variable templates', 'duracelltomi-google-tag-manager' ),
|
1092 |
+
'gtm4wp_admin_output_field',
|
1093 |
+
GTM4WP_ADMINSLUG,
|
1094 |
+
GTM4WP_ADMIN_GROUP_BLACKLIST,
|
1095 |
+
array(
|
1096 |
+
'label_for' => GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_BLACKLIST_SANDBOXED . ']',
|
1097 |
+
'description' => '',
|
1098 |
+
'entityid' => GTM4WP_OPTION_BLACKLIST_SANDBOXED
|
1099 |
+
)
|
1100 |
+
);
|
1101 |
+
|
1102 |
+
foreach( $gtm4wp_entity_ids as $gtm_entity_group_id => $gtm_entity_group_list ) {
|
1103 |
+
foreach( $gtm_entity_group_list as $gtm_entity_id => $gtm_entity_label ) {
|
1104 |
+
add_settings_field(
|
1105 |
+
'gtm4wp-admin-blacklist-' . $gtm_entity_group_id . '-' . $gtm_entity_id . '-id',
|
1106 |
+
$gtm_entity_label,
|
1107 |
+
'gtm4wp_admin_output_field',
|
1108 |
+
GTM4WP_ADMINSLUG,
|
1109 |
+
GTM4WP_ADMIN_GROUP_BLACKLIST,
|
1110 |
+
array(
|
1111 |
+
'label_for' => 'gtm4wp-options[blacklist-' . $gtm_entity_group_id . '-' . $gtm_entity_id . ']',
|
1112 |
+
'description' => '',
|
1113 |
+
'entityid' => $gtm_entity_id,
|
1114 |
+
)
|
1115 |
+
);
|
1116 |
+
}
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
add_settings_section(
|
1120 |
+
GTM4WP_ADMIN_GROUP_INTEGRATION,
|
1121 |
+
__( 'Integration', 'duracelltomi-google-tag-manager' ),
|
1122 |
+
'gtm4wp_admin_output_section',
|
1123 |
+
GTM4WP_ADMINSLUG
|
1124 |
+
);
|
1125 |
+
|
1126 |
+
foreach ( $gtm4wp_integratefieldtexts as $fieldid => $fielddata ) {
|
1127 |
+
$phase = isset( $fielddata['phase'] ) ? $fielddata['phase'] : GTM4WP_PHASE_STABLE;
|
1128 |
+
|
1129 |
+
add_settings_field(
|
1130 |
+
'gtm4wp-admin-' . $fieldid . '-id',
|
1131 |
+
$fielddata['label'] . '<span class="' . $phase . '"></span>',
|
1132 |
+
'gtm4wp_admin_output_field',
|
1133 |
+
GTM4WP_ADMINSLUG,
|
1134 |
+
GTM4WP_ADMIN_GROUP_INTEGRATION,
|
1135 |
+
array(
|
1136 |
+
'label_for' => 'gtm4wp-options[' . $fieldid . ']',
|
1137 |
+
'description' => $fielddata['description'],
|
1138 |
+
'optionfieldid' => $fieldid,
|
1139 |
+
'plugintocheck' => isset( $fielddata['plugintocheck'] ) ? $fielddata['plugintocheck'] : '',
|
1140 |
+
)
|
1141 |
+
);
|
1142 |
+
}
|
1143 |
+
|
1144 |
+
add_settings_section(
|
1145 |
+
GTM4WP_ADMIN_GROUP_ADVANCED,
|
1146 |
+
__( 'Advanced', 'duracelltomi-google-tag-manager' ),
|
1147 |
+
'gtm4wp_admin_output_section',
|
1148 |
+
GTM4WP_ADMINSLUG
|
1149 |
+
);
|
1150 |
+
|
1151 |
+
foreach ( $gtm4wp_advancedfieldtexts as $fieldid => $fielddata ) {
|
1152 |
+
$phase = isset( $fielddata['phase'] ) ? $fielddata['phase'] : GTM4WP_PHASE_STABLE;
|
1153 |
+
|
1154 |
+
add_settings_field(
|
1155 |
+
'gtm4wp-admin-' . $fieldid . '-id',
|
1156 |
+
$fielddata['label'] . '<span class="' . $phase . '"></span>',
|
1157 |
+
'gtm4wp_admin_output_field',
|
1158 |
+
GTM4WP_ADMINSLUG,
|
1159 |
+
GTM4WP_ADMIN_GROUP_ADVANCED,
|
1160 |
+
array(
|
1161 |
+
'label_for' => 'gtm4wp-options[' . $fieldid . ']',
|
1162 |
+
'description' => $fielddata['description'],
|
1163 |
+
'optionfieldid' => $fieldid,
|
1164 |
+
'plugintocheck' => isset( $fielddata['plugintocheck'] ) ? $fielddata['plugintocheck'] : '',
|
1165 |
+
)
|
1166 |
+
);
|
1167 |
+
}
|
1168 |
+
|
1169 |
+
add_settings_section(
|
1170 |
+
GTM4WP_ADMIN_GROUP_CREDITS,
|
1171 |
+
__( 'Credits', 'duracelltomi-google-tag-manager' ),
|
1172 |
+
'gtm4wp_admin_output_section',
|
1173 |
+
GTM4WP_ADMINSLUG
|
1174 |
+
);
|
1175 |
+
|
1176 |
+
add_settings_field(
|
1177 |
+
GTM4WP_ADMIN_GROUP_INFO,
|
1178 |
+
__( 'Author', 'duracelltomi-google-tag-manager' ),
|
1179 |
+
'gtm4wp_admin_output_field',
|
1180 |
+
GTM4WP_ADMINSLUG,
|
1181 |
+
GTM4WP_ADMIN_GROUP_CREDITS,
|
1182 |
+
array(
|
1183 |
+
'label_for' => GTM4WP_ADMIN_GROUP_INFO,
|
1184 |
+
'description' => '<strong>Thomas Geiger</strong><br />
|
1185 |
+
Website: <a href="https://gtm4wp.com/" target="_blank" rel="noopener">gtm4wp.com</a><br />
|
1186 |
+
<a href="https://www.linkedin.com/in/duracelltomi" target="_blank" rel="noopener">Me on LinkedIn</a><br />
|
1187 |
+
<a href="http://www.linkedin.com/company/jabjab-online-marketing-ltd" target="_blank" rel="noopener">JabJab Online Marketing on LinkedIn</a>',
|
1188 |
+
)
|
1189 |
+
);
|
1190 |
+
|
1191 |
+
// apply oembed code changes on the admin as well since the oembed call on the admin is cached by WordPress into a transient
|
1192 |
+
// that is applied on the frontend later
|
1193 |
+
require_once dirname( __FILE__ ) . '/../integration/youtube.php';
|
1194 |
+
require_once dirname( __FILE__ ) . '/../integration/vimeo.php';
|
1195 |
+
require_once dirname( __FILE__ ) . '/../integration/soundcloud.php';
|
1196 |
+
}
|
1197 |
+
|
1198 |
+
function gtm4wp_show_admin_page() {
|
1199 |
+
global $gtp4wp_plugin_url;
|
1200 |
+
?>
|
1201 |
+
<div class="wrap">
|
1202 |
+
<div id="gtm4wp-icon" class="icon32" style="background-image: url(<?php echo $gtp4wp_plugin_url; ?>admin/images/tag_manager-32.png);"><br /></div>
|
1203 |
+
<h2><?php _e( 'Google Tag Manager for WordPress options', 'duracelltomi-google-tag-manager' ); ?></h2>
|
1204 |
+
<form action="options.php" method="post">
|
1205 |
+
<?php settings_fields( GTM4WP_ADMIN_GROUP ); ?>
|
1206 |
+
<?php do_settings_sections( GTM4WP_ADMINSLUG ); ?>
|
1207 |
+
<?php submit_button(); ?>
|
1208 |
+
|
1209 |
+
</form>
|
1210 |
+
</div>
|
1211 |
+
<?php
|
1212 |
+
}
|
1213 |
+
|
1214 |
+
function gtm4wp_add_admin_page() {
|
1215 |
+
add_options_page(
|
1216 |
+
__( 'Google Tag Manager for WordPress settings', 'duracelltomi-google-tag-manager' ),
|
1217 |
+
__( 'Google Tag Manager', 'duracelltomi-google-tag-manager' ),
|
1218 |
+
'manage_options',
|
1219 |
+
GTM4WP_ADMINSLUG,
|
1220 |
+
'gtm4wp_show_admin_page'
|
1221 |
+
);
|
1222 |
+
}
|
1223 |
+
|
1224 |
+
function gtm4wp_add_admin_js( $hook ) {
|
1225 |
+
global $gtp4wp_plugin_url;
|
1226 |
+
|
1227 |
+
if ( $hook == 'settings_page_' . GTM4WP_ADMINSLUG ) {
|
1228 |
+
wp_register_script( 'admin-subtabs', $gtp4wp_plugin_url . 'js/admin-subtabs.js', array(), GTM4WP_VERSION );
|
1229 |
+
|
1230 |
+
$subtabtexts = array(
|
1231 |
+
'posttabtitle' => __( 'Posts', 'duracelltomi-google-tag-manager' ),
|
1232 |
+
'searchtabtitle' => __( 'Search', 'duracelltomi-google-tag-manager' ),
|
1233 |
+
'visitortabtitle' => __( 'Visitors', 'duracelltomi-google-tag-manager' ),
|
1234 |
+
'browsertabtitle' => __( 'Browser/OS/Device', 'duracelltomi-google-tag-manager' ),
|
1235 |
+
'blocktagstabtitle' => __( 'Blacklist tags', 'duracelltomi-google-tag-manager' ),
|
1236 |
+
'blocktriggerstabtitle' => __( 'Blacklist triggers', 'duracelltomi-google-tag-manager' ),
|
1237 |
+
'blockmacrostabtitle' => __( 'Blacklist variables', 'duracelltomi-google-tag-manager' ),
|
1238 |
+
'wpcf7tabtitle' => __( 'Contact Form 7', 'duracelltomi-google-tag-manager' ),
|
1239 |
+
'wctabtitle' => __( 'WooCommerce', 'duracelltomi-google-tag-manager' ),
|
1240 |
+
'gotabtitle' => __( 'Google Optimize', 'duracelltomi-google-tag-manager' ),
|
1241 |
+
'amptabtitle' => __( 'Accelerated Mobile Pages', 'duracelltomi-google-tag-manager' ),
|
1242 |
+
'cookiebottabtitle' => __( 'Cookiebot', 'duracelltomi-google-tag-manager' ),
|
1243 |
+
'weathertabtitle' => __( 'Weather & geo data', 'duracelltomi-google-tag-manager' ),
|
1244 |
+
'generaleventstabtitle' => __( 'General events', 'duracelltomi-google-tag-manager' ),
|
1245 |
+
'mediaeventstabtitle' => __( 'Media events', 'duracelltomi-google-tag-manager' ),
|
1246 |
+
'depecratedeventstabtitle' => __( 'Deprecated', 'duracelltomi-google-tag-manager' ),
|
1247 |
+
'sitetabtitle' => __( 'Site', 'duracelltomi-google-tag-manager' ),
|
1248 |
+
'misctabtitle' => __( 'Misc', 'duracelltomi-google-tag-manager' ),
|
1249 |
+
);
|
1250 |
+
wp_localize_script( 'admin-subtabs', 'gtm4wp', $subtabtexts );
|
1251 |
+
|
1252 |
+
wp_enqueue_script( 'admin-subtabs' );
|
1253 |
+
wp_enqueue_script( 'admin-tabcreator', $gtp4wp_plugin_url . 'js/admin-tabcreator.js', array( 'jquery-core' ), GTM4WP_VERSION );
|
1254 |
+
|
1255 |
+
wp_enqueue_style( 'gtm4wp-validate', $gtp4wp_plugin_url . 'css/admin-gtm4wp.css', array(), GTM4WP_VERSION );
|
1256 |
+
}
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
function gtm4wp_admin_head() {
|
1260 |
+
echo '
|
1261 |
+
<style type="text/css">
|
1262 |
+
.gtmid_validation_error,
|
1263 |
+
.goid_validation_error,
|
1264 |
+
.goid_ga_validation_error,
|
1265 |
+
.ampid_validation_error,
|
1266 |
+
.datalayername_validation_error,
|
1267 |
+
.gtmauth_validation_error,
|
1268 |
+
.gtmpreview_validation_error,
|
1269 |
+
.gtm_wpconfig_set {
|
1270 |
+
color: #c00;
|
1271 |
+
font-weight: bold;
|
1272 |
+
}
|
1273 |
+
.gtmid_validation_error,
|
1274 |
+
.goid_validation_error,
|
1275 |
+
.goid_ga_validation_error,
|
1276 |
+
.ampid_validation_error,
|
1277 |
+
.datalayername_validation_error,
|
1278 |
+
.gtmauth_validation_error,
|
1279 |
+
.gtmpreview_validation_error {
|
1280 |
+
display: none;
|
1281 |
+
}
|
1282 |
+
</style>
|
1283 |
+
<script type="text/javascript">
|
1284 |
+
jQuery(function() {
|
1285 |
+
jQuery( "#gtm4wp-options\\\\[gtm-code\\\\]" )
|
1286 |
+
.on( "blur", function() {
|
1287 |
+
var gtmid_regex = /^GTM-[A-Z0-9]+$/;
|
1288 |
+
var gtmid_list_str = jQuery( this ).val();
|
1289 |
+
if ( typeof gtmid_list_str != "string" ) {
|
1290 |
+
return;
|
1291 |
+
}
|
1292 |
+
var gtmid_list = trim( gtmid_list_str ).split( "," );
|
1293 |
+
|
1294 |
+
var gtmid_haserror = false;
|
1295 |
+
for( var i=0; i<gtmid_list.length; i++ ) {
|
1296 |
+
gtmid_haserror = gtmid_haserror || !gtmid_regex.test( gtmid_list[ i ] );
|
1297 |
+
}
|
1298 |
+
|
1299 |
+
if ( gtmid_haserror ) {
|
1300 |
+
jQuery( ".gtmid_validation_error" )
|
1301 |
+
.show();
|
1302 |
+
} else {
|
1303 |
+
jQuery( ".gtmid_validation_error" )
|
1304 |
+
.hide();
|
1305 |
+
}
|
1306 |
+
});
|
1307 |
+
|
1308 |
+
jQuery( "#gtm4wp-options\\\\[integrate-google-optimize-idlist\\\\]" )
|
1309 |
+
.on( "blur", function() {
|
1310 |
+
var goid_regex = /^(GTM|OPT)-[A-Z0-9]+$/;
|
1311 |
+
var goid_val_str = jQuery( this ).val();
|
1312 |
+
if ( typeof goid_val_str != "string" ) {
|
1313 |
+
return;
|
1314 |
+
}
|
1315 |
+
var goid_val = trim( goid_val_str );
|
1316 |
+
if ( "" == goid_val ) {
|
1317 |
+
goid_list = [];
|
1318 |
+
} else {
|
1319 |
+
var goid_list = goid_val.split( "," );
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
var goid_haserror = false;
|
1323 |
+
for( var i=0; i<goid_list.length; i++ ) {
|
1324 |
+
goid_haserror = goid_haserror || !goid_regex.test( goid_list[ i ] );
|
1325 |
+
}
|
1326 |
+
|
1327 |
+
if ( goid_haserror && (goid_list.length > 0) ) {
|
1328 |
+
jQuery( ".goid_validation_error" )
|
1329 |
+
.show();
|
1330 |
+
} else {
|
1331 |
+
jQuery( ".goid_validation_error" )
|
1332 |
+
.hide();
|
1333 |
+
}
|
1334 |
+
});
|
1335 |
+
|
1336 |
+
jQuery( "#gtm4wp-options\\\\[integrate-google-optimize-gaid\\\\]" )
|
1337 |
+
.on( "blur", function() {
|
1338 |
+
var gogaid_regex = /^UA-[0-9]+-[0-9]+$/;
|
1339 |
+
var gogaid_val_str = jQuery( this ).val();
|
1340 |
+
if ( typeof gogaid_val_str != "string" ) {
|
1341 |
+
return;
|
1342 |
+
}
|
1343 |
+
var gogaid_val = trim( gogaid_val_str );
|
1344 |
+
if ( "" == gogaid_val ) {
|
1345 |
+
gogaid_list = [];
|
1346 |
+
} else {
|
1347 |
+
var gogaid_list = gogaid_val.split( "," );
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
var gogaid_haserror = false;
|
1351 |
+
for( var i=0; i<gogaid_list.length; i++ ) {
|
1352 |
+
gogaid_haserror = gogaid_haserror || !gogaid_regex.test( gogaid_list[ i ] );
|
1353 |
+
}
|
1354 |
+
|
1355 |
+
if ( gogaid_haserror && (gogaid_list.length > 0) ) {
|
1356 |
+
jQuery( ".goid_ga_validation_error" )
|
1357 |
+
.show();
|
1358 |
+
} else {
|
1359 |
+
jQuery( ".goid_ga_validation_error" )
|
1360 |
+
.hide();
|
1361 |
+
}
|
1362 |
+
});
|
1363 |
+
|
1364 |
+
jQuery( "#gtm4wp-options\\\\[integrate-amp-gtm\\\\]" )
|
1365 |
+
.on( "blur", function() {
|
1366 |
+
var ampid_regex = /^GTM-[A-Z0-9]+$/;
|
1367 |
+
var ampid_val_str = jQuery( this ).val();
|
1368 |
+
if ( typeof ampid_val_str != "string" ) {
|
1369 |
+
return;
|
1370 |
+
}
|
1371 |
+
var ampid_val = trim( ampid_val_str );
|
1372 |
+
if ( "" == ampid_val ) {
|
1373 |
+
ampid_list = [];
|
1374 |
+
} else {
|
1375 |
+
var ampid_list = ampid_val.split( "," );
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
var ampid_haserror = false;
|
1379 |
+
for( var i=0; i<ampid_list.length; i++ ) {
|
1380 |
+
ampid_haserror = ampid_haserror || !ampid_regex.test( gogaid_list[ i ] );
|
1381 |
+
}
|
1382 |
+
|
1383 |
+
if ( ampid_haserror && (ampid_list.length > 0) ) {
|
1384 |
+
jQuery( ".ampid_validation_error" )
|
1385 |
+
.show();
|
1386 |
+
} else {
|
1387 |
+
jQuery( ".ampid_validation_error" )
|
1388 |
+
.hide();
|
1389 |
+
}
|
1390 |
+
});
|
1391 |
+
|
1392 |
+
jQuery( "#gtm4wp-options\\\\[gtm-datalayer-variable-name\\\\]" )
|
1393 |
+
.on( "blur", function() {
|
1394 |
+
var currentval = jQuery( this ).val();
|
1395 |
+
|
1396 |
+
jQuery( ".datalayername_validation_error" )
|
1397 |
+
.hide();
|
1398 |
+
|
1399 |
+
if ( currentval != "" ) {
|
1400 |
+
// I know this is not the exact definition for a variable name but I think other kind of variable names should not be used.
|
1401 |
+
var gtmvarname_regex = /^[a-zA-Z][a-zA-Z0-9_-]*$/;
|
1402 |
+
if ( ! gtmvarname_regex.test( currentval ) ) {
|
1403 |
+
jQuery( ".datalayername_validation_error" )
|
1404 |
+
.show();
|
1405 |
+
}
|
1406 |
+
}
|
1407 |
+
});
|
1408 |
+
|
1409 |
+
jQuery( "#gtm4wp-options\\\\[gtm-env-gtm-auth\\\\]" )
|
1410 |
+
.on( "blur", function() {
|
1411 |
+
var currentval = jQuery( this ).val();
|
1412 |
+
|
1413 |
+
jQuery( ".gtmauth_validation_error" )
|
1414 |
+
.hide();
|
1415 |
+
|
1416 |
+
if ( currentval != "" ) {
|
1417 |
+
var gtmauth_regex = /^[a-zA-Z0-9-_]+$/;
|
1418 |
+
if ( ! gtmauth_regex.test( currentval ) ) {
|
1419 |
+
jQuery( ".gtmauth_validation_error" )
|
1420 |
+
.show();
|
1421 |
+
}
|
1422 |
+
}
|
1423 |
+
});
|
1424 |
+
|
1425 |
+
jQuery( "#gtm4wp-options\\\\[gtm-env-gtm-preview\\\\]" )
|
1426 |
+
.on( "blur", function() {
|
1427 |
+
var currentval = jQuery( this ).val();
|
1428 |
+
|
1429 |
+
jQuery( ".gtmpreview_validation_error" )
|
1430 |
+
.hide();
|
1431 |
+
|
1432 |
+
if ( currentval != "" ) {
|
1433 |
+
var gtmpreview_regex = /^env-[0-9]+$/;
|
1434 |
+
if ( ! gtmpreview_regex.test( currentval ) ) {
|
1435 |
+
jQuery( ".gtmpreview_validation_error" )
|
1436 |
+
.show();
|
1437 |
+
}
|
1438 |
+
}
|
1439 |
+
});
|
1440 |
+
|
1441 |
+
jQuery( document )
|
1442 |
+
.on( "click", ".gtm4wp-notice .notice-dismiss", function( e ) {
|
1443 |
+
jQuery.post(ajaxurl, {
|
1444 |
+
action: "gtm4wp_dismiss_notice",
|
1445 |
+
noticeid: jQuery( this ).closest(".gtm4wp-notice")
|
1446 |
+
.attr( "data-href" )
|
1447 |
+
.substring( 1 )
|
1448 |
+
});
|
1449 |
+
});
|
1450 |
+
});
|
1451 |
+
</script>';
|
1452 |
+
}
|
1453 |
+
|
1454 |
+
function gtm4wp_show_warning() {
|
1455 |
+
global $gtm4wp_options, $gtp4wp_plugin_url, $gtm4wp_integratefieldtexts, $current_user,
|
1456 |
+
$gtm4wp_def_user_notices_dismisses;
|
1457 |
+
|
1458 |
+
$woo_plugin_active = is_plugin_active( $gtm4wp_integratefieldtexts[ GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC ]['plugintocheck'] );
|
1459 |
+
if ( $woo_plugin_active && function_exists( 'WC' ) ) {
|
1460 |
+
$woo = WC();
|
1461 |
+
} else {
|
1462 |
+
$woo = null;
|
1463 |
+
}
|
1464 |
+
|
1465 |
+
$gtm4wp_user_notices_dismisses = get_user_meta( $current_user->ID, GTM4WP_USER_NOTICES_KEY, true );
|
1466 |
+
if ( $gtm4wp_user_notices_dismisses === '' ) {
|
1467 |
+
if ( is_array( $gtm4wp_def_user_notices_dismisses ) ) {
|
1468 |
+
$gtm4wp_user_notices_dismisses = $gtm4wp_def_user_notices_dismisses;
|
1469 |
+
} else {
|
1470 |
+
$gtm4wp_user_notices_dismisses = array();
|
1471 |
+
}
|
1472 |
+
} else {
|
1473 |
+
$gtm4wp_user_notices_dismisses = @unserialize( $gtm4wp_user_notices_dismisses );
|
1474 |
+
if ( false === $gtm4wp_user_notices_dismisses || !is_array( $gtm4wp_user_notices_dismisses ) ) {
|
1475 |
+
$gtm4wp_user_notices_dismisses = array();
|
1476 |
+
}
|
1477 |
+
}
|
1478 |
+
$gtm4wp_user_notices_dismisses = array_merge( $gtm4wp_def_user_notices_dismisses, $gtm4wp_user_notices_dismisses );
|
1479 |
+
|
1480 |
+
if ( ( trim( $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] ) == '' ) && ( false === $gtm4wp_user_notices_dismisses['enter-gtm-code'] ) ) {
|
1481 |
+
echo '<div class="gtm4wp-notice notice notice-error is-dismissible" data-href="?enter-gtm-code"><p><strong>' . sprintf( __( 'To start using Google Tag Manager for WordPress, please <a href="%s">enter your GTM ID</a>', 'duracelltomi-google-tag-manager' ), 'options-general.php?page=' . GTM4WP_ADMINSLUG ) . '</strong></p></div>';
|
1482 |
+
}
|
1483 |
+
|
1484 |
+
if ( (
|
1485 |
+
( '' != $gtm4wp_options[ GTM4WP_OPTION_ENV_GTM_AUTH ] ) && ( '' == $gtm4wp_options[ GTM4WP_OPTION_ENV_GTM_PREVIEW ] )
|
1486 |
+
) || (
|
1487 |
+
( '' == $gtm4wp_options[ GTM4WP_OPTION_ENV_GTM_AUTH ] ) && ( '' != $gtm4wp_options[ GTM4WP_OPTION_ENV_GTM_PREVIEW ] )
|
1488 |
+
) ) {
|
1489 |
+
echo '<div class="gtm4wp-notice notice notice-error" data-href="?incomplete-gtm-env-config"><p><strong>' . sprintf( __( 'Incomplete Google Tag Manager environment configuration: either gtm_preview or gtm_auth parameter value is missing!', 'duracelltomi-google-tag-manager' ), 'options-general.php?page=' . GTM4WP_ADMINSLUG ) . '</strong></p></div>';
|
1490 |
+
}
|
1491 |
+
|
1492 |
+
if ( ( false === $gtm4wp_user_notices_dismisses['wc-ga-plugin-warning'] ) || ( false === $gtm4wp_user_notices_dismisses['wc-gayoast-plugin-warning'] ) ) {
|
1493 |
+
$is_wc_active = $gtm4wp_options[ GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC ] ||
|
1494 |
+
$gtm4wp_options[ GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC ] ||
|
1495 |
+
$gtm4wp_options[ GTM4WP_OPTION_INTEGRATE_WCREMARKETING ];
|
1496 |
+
|
1497 |
+
if ( ( false === $gtm4wp_user_notices_dismisses['wc-ga-plugin-warning'] ) && $is_wc_active && is_plugin_active( 'woocommerce-google-analytics-integration/woocommerce-google-analytics-integration.php' ) ) {
|
1498 |
+
echo '<div class="gtm4wp-notice notice notice-warning is-dismissible" data-href="?wc-ga-plugin-warning"><p><strong>' . __( 'Notice: you should deactivate the plugin "WooCommerce Google Analytics Integration" if you are using Google Analytics tags inside Google Tag Manager!', 'duracelltomi-google-tag-manager' ) . '</strong></p></div>';
|
1499 |
+
}
|
1500 |
+
|
1501 |
+
if ( ( false === $gtm4wp_user_notices_dismisses['wc-gayoast-plugin-warning'] ) && $is_wc_active && is_plugin_active( 'google-analytics-for-wordpress/googleanalytics.php' ) ) {
|
1502 |
+
echo '<div class="gtm4wp-notice notice notice-warning is-dismissible" data-href="?wc-gayoast-plugin-warning"><p><strong>' . __( 'Notice: you should deactivate the plugin "Google Analytics for WordPress by MonsterInsights" if you are using Google Analytics tags inside Google Tag Manager!', 'duracelltomi-google-tag-manager' ) . '</strong></p></div>';
|
1503 |
+
}
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
if ( ( false === $gtm4wp_user_notices_dismisses['php72-warning'] ) && ( version_compare( PHP_VERSION, '7.2.0' ) < 0 ) ) {
|
1507 |
+
echo '<div class="gtm4wp-notice notice notice-warning is-dismissible" data-href="?php72-warning"><p><strong>' . __( 'Warning: You are using an outdated version of PHP (v' . PHP_VERSION . ') that might be not compatible with future versions of the plugin Google Tag Manager for WordPress (GTM4WP). Please consider to upgrade your PHP.', 'duracelltomi-google-tag-manager' ) . '</strong></p></div>';
|
1508 |
+
}
|
1509 |
+
}
|
1510 |
+
|
1511 |
+
function gtm4wp_dismiss_notice() {
|
1512 |
+
global $gtm4wp_def_user_notices_dismisses, $current_user;
|
1513 |
+
|
1514 |
+
$gtm4wp_user_notices_dismisses = get_user_meta( $current_user->ID, GTM4WP_USER_NOTICES_KEY, true );
|
1515 |
+
if ( $gtm4wp_user_notices_dismisses === '' ) {
|
1516 |
+
if ( is_array( $gtm4wp_def_user_notices_dismisses ) ) {
|
1517 |
+
$gtm4wp_user_notices_dismisses = $gtm4wp_def_user_notices_dismisses;
|
1518 |
+
} else {
|
1519 |
+
$gtm4wp_user_notices_dismisses = array();
|
1520 |
+
}
|
1521 |
+
} else {
|
1522 |
+
$gtm4wp_user_notices_dismisses = @unserialize( $gtm4wp_user_notices_dismisses );
|
1523 |
+
if ( false === $gtm4wp_user_notices_dismisses || !is_array( $gtm4wp_user_notices_dismisses ) ) {
|
1524 |
+
$gtm4wp_user_notices_dismisses = array();
|
1525 |
+
}
|
1526 |
+
}
|
1527 |
+
$gtm4wp_user_notices_dismisses = array_merge( $gtm4wp_def_user_notices_dismisses, $gtm4wp_user_notices_dismisses );
|
1528 |
+
|
1529 |
+
$noticeid = trim( basename( $_POST['noticeid'] ) );
|
1530 |
+
if ( array_key_exists( $noticeid, $gtm4wp_user_notices_dismisses ) ) {
|
1531 |
+
$gtm4wp_user_notices_dismisses[ $noticeid ] = true;
|
1532 |
+
update_user_meta( $current_user->ID, GTM4WP_USER_NOTICES_KEY, serialize( $gtm4wp_user_notices_dismisses ) );
|
1533 |
+
}
|
1534 |
+
}
|
1535 |
+
|
1536 |
+
function gtm4wp_add_plugin_action_links( $links, $file ) {
|
1537 |
+
global $gtp4wp_plugin_basename;
|
1538 |
+
|
1539 |
+
if ( $file != $gtp4wp_plugin_basename ) {
|
1540 |
+
return $links;
|
1541 |
+
}
|
1542 |
+
|
1543 |
+
$settings_link = '<a href="' . menu_page_url( GTM4WP_ADMINSLUG, false ) . '">' . esc_html( __( 'Settings' ) ) . '</a>';
|
1544 |
+
|
1545 |
+
array_unshift( $links, $settings_link );
|
1546 |
+
|
1547 |
+
return $links;
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
function gtm4wp_show_upgrade_notification( $current_plugin_metadata, $new_plugin_metadata ) {
|
1551 |
+
if ( isset( $new_plugin_metadata->upgrade_notice ) && strlen( trim( $new_plugin_metadata->upgrade_notice ) ) > 0 ) {
|
1552 |
+
echo '<p style="background-color: #d54e21; padding: 10px; color: #f9f9f9; margin-top: 10px"><strong>Important Upgrade Notice:</strong> ';
|
1553 |
+
echo esc_html( $new_plugin_metadata->upgrade_notice ), '</p>';
|
1554 |
+
}
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
add_action( 'admin_init', 'gtm4wp_admin_init' );
|
1558 |
+
add_action( 'admin_menu', 'gtm4wp_add_admin_page' );
|
1559 |
+
add_action( 'admin_enqueue_scripts', 'gtm4wp_add_admin_js' );
|
1560 |
+
add_action( 'admin_notices', 'gtm4wp_show_warning' );
|
1561 |
+
add_action( 'admin_head', 'gtm4wp_admin_head' );
|
1562 |
+
add_filter( 'plugin_action_links', 'gtm4wp_add_plugin_action_links', 10, 2 );
|
1563 |
+
add_action( 'wp_ajax_gtm4wp_dismiss_notice', 'gtm4wp_dismiss_notice' );
|
1564 |
+
add_action( 'in_plugin_update_message-duracelltomi-google-tag-manager-for-wordpress/duracelltomi-google-tag-manager-for-wordpress.php', 'gtm4wp_show_upgrade_notification', 10, 2 );
|
|
|
|
|
|
|
|
|
|
|
|
common/readoptions.php
CHANGED
@@ -1,4 +1,13 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
define( 'GTM4WP_OPTIONS', 'gtm4wp-options' );
|
3 |
define( 'GTM4WP_OPTION_GTM_CODE', 'gtm-code' );
|
4 |
define( 'GTM4WP_OPTION_GTM_PLACEMENT', 'gtm-code-placement' );
|
@@ -10,7 +19,6 @@ define( 'GTM4WP_OPTION_LOADEARLY', 'gtm-load-gtm-early' );
|
|
10 |
define( 'GTM4WP_OPTION_GTMDOMAIN', 'gtm-domain-name' );
|
11 |
define( 'GTM4WP_OPTION_NOGTMFORLOGGEDIN', 'gtm-no-gtm-for-logged-in' );
|
12 |
|
13 |
-
define( 'GTM4WP_OPTION_INCLUDE_REMARKETING', 'include-remarketing' );
|
14 |
define( 'GTM4WP_OPTION_INCLUDE_LOGGEDIN', 'include-loggedin' );
|
15 |
define( 'GTM4WP_OPTION_INCLUDE_USERROLE', 'include-userrole' );
|
16 |
define( 'GTM4WP_OPTION_INCLUDE_USERID', 'include-userid' );
|
@@ -28,7 +36,7 @@ define( 'GTM4WP_OPTION_INCLUDE_POSTTITLE', 'include-posttitle' );
|
|
28 |
define( 'GTM4WP_OPTION_INCLUDE_POSTCOUNT', 'include-postcount' );
|
29 |
define( 'GTM4WP_OPTION_INCLUDE_POSTID', 'include-postid' );
|
30 |
define( 'GTM4WP_OPTION_INCLUDE_POSTFORMAT', 'include-postformat' );
|
31 |
-
define( 'GTM4WP_OPTION_INCLUDE_POSTTERMLIST',
|
32 |
define( 'GTM4WP_OPTION_INCLUDE_SEARCHDATA', 'include-searchdata' );
|
33 |
define( 'GTM4WP_OPTION_INCLUDE_BROWSERDATA', 'include-browserdata' );
|
34 |
define( 'GTM4WP_OPTION_INCLUDE_OSDATA', 'include-osdata' );
|
@@ -61,7 +69,7 @@ define( 'GTM4WP_OPTION_BLACKLIST_ENABLE', 'blacklist-enable' );
|
|
61 |
define( 'GTM4WP_OPTION_BLACKLIST_SANDBOXED', 'blacklist-sandboxed' );
|
62 |
define( 'GTM4WP_OPTION_BLACKLIST_STATUS', 'blacklist-status' );
|
63 |
|
64 |
-
// deprecated options BEGIN
|
65 |
define( 'GTM4WP_OPTION_BLACKLIST_ADADVISOR', 'blacklist-adadvisor' );
|
66 |
define( 'GTM4WP_OPTION_BLACKLIST_ADROLL', 'blacklist-adroll' );
|
67 |
define( 'GTM4WP_OPTION_BLACKLIST_AWCONV', 'blacklist-adwords-conversion' );
|
@@ -93,7 +101,7 @@ define( 'GTM4WP_OPTION_BLACKLIST_MACRO_RANDOMNUM', 'blacklist-macro-random-numbe
|
|
93 |
define( 'GTM4WP_OPTION_BLACKLIST_MACRO_REFERRER', 'blacklist-macro-referrer' );
|
94 |
define( 'GTM4WP_OPTION_BLACKLIST_MACRO_URL', 'blacklist-macro-url' );
|
95 |
define( 'GTM4WP_OPTION_BLACKLIST_MACRO_AUTOEVENT', 'blacklist-macro-autoevent-variable' );
|
96 |
-
// deprecated options END
|
97 |
|
98 |
define( 'GTM4WP_OPTION_INTEGRATE_WPCF7', 'integrate-wpcf7' );
|
99 |
|
@@ -101,8 +109,8 @@ define( 'GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC', 'integrate-woocommerce-track
|
|
101 |
define( 'GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC', 'integrate-woocommerce-track-enhanced-ecommerce' );
|
102 |
define( 'GTM4WP_OPTION_INTEGRATE_WCPRODPERIMPRESSION', 'integrate-woocommerce-product-per-impression' );
|
103 |
define( 'GTM4WP_OPTION_INTEGRATE_WCEECCARTASFIRSTSTEP', 'integrate-woocommerce-cart-as-first-step' );
|
104 |
-
define( 'GTM4WP_OPTION_INTEGRATE_WCEINCLUDECARTINDL',
|
105 |
-
define( 'GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY',
|
106 |
define( 'GTM4WP_OPTION_INTEGRATE_WCREMARKETING', 'integrate-woocommerce-remarketing' );
|
107 |
define( 'GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL', 'integrate-woocommerce-business-vertical' );
|
108 |
define( 'GTM4WP_OPTION_INTEGRATE_WCUSESKU', 'integrate-woocommerce-remarketing-usesku' );
|
@@ -144,7 +152,6 @@ $gtm4wp_defaultoptions = array(
|
|
144 |
GTM4WP_OPTION_GTMDOMAIN => '',
|
145 |
GTM4WP_OPTION_NOGTMFORLOGGEDIN => '',
|
146 |
|
147 |
-
GTM4WP_OPTION_INCLUDE_REMARKETING => false,
|
148 |
GTM4WP_OPTION_INCLUDE_LOGGEDIN => false,
|
149 |
GTM4WP_OPTION_INCLUDE_USERROLE => false,
|
150 |
GTM4WP_OPTION_INCLUDE_USERID => false,
|
@@ -210,7 +217,7 @@ $gtm4wp_defaultoptions = array(
|
|
210 |
GTM4WP_OPTION_INTEGRATE_WCREMPRODIDPREFIX => '',
|
211 |
GTM4WP_OPTION_INTEGRATE_WCCUSTOMERDATA => false,
|
212 |
GTM4WP_OPTION_INTEGRATE_WCORDERDATA => false,
|
213 |
-
GTM4WP_OPTION_INTEGRATE_WCORDERMAXAGE
|
214 |
GTM4WP_OPTION_INTEGRATE_WCEXCLUDETAX => false,
|
215 |
GTM4WP_OPTION_INTEGRATE_WCEXCLUDESHIPPING => false,
|
216 |
GTM4WP_OPTION_INTEGRATE_WCNOORDERTRACKEDFLAG => false,
|
@@ -222,142 +229,148 @@ $gtm4wp_defaultoptions = array(
|
|
222 |
|
223 |
GTM4WP_OPTION_INTEGRATE_AMPID => '',
|
224 |
|
225 |
-
GTM4WP_OPTION_INTEGRATE_COOKIEBOT => false
|
226 |
);
|
227 |
|
228 |
$gtm4wp_business_verticals = array(
|
229 |
-
'retail'
|
230 |
-
'education'
|
231 |
-
'flights'
|
232 |
'hotel_rental' => 'Hotel rental',
|
233 |
-
'jobs'
|
234 |
-
'local'
|
235 |
-
'real_estate'
|
236 |
-
'travel'
|
237 |
-
'custom'
|
238 |
);
|
239 |
|
240 |
$gtm4wp_business_verticals_ids = array(
|
241 |
'flights' => 'destination',
|
242 |
-
'travel'
|
243 |
);
|
244 |
|
245 |
$gtm4wp_entity_ids = array(
|
246 |
-
'tags'
|
247 |
-
'abtGeneric'
|
248 |
-
'ta'
|
249 |
-
'adm'
|
250 |
-
'asp'
|
251 |
-
'awct'
|
252 |
-
'sp'
|
253 |
-
'awc'
|
254 |
-
'awj'
|
255 |
-
'baut'
|
256 |
-
'bb'
|
257 |
-
'bsa'
|
258 |
-
'cts'
|
259 |
-
'csm'
|
260 |
-
'mpm'
|
261 |
-
'mpr'
|
262 |
-
'gclidw'
|
263 |
-
'cegg'
|
264 |
-
'crto'
|
265 |
-
'html'
|
266 |
-
'img'
|
267 |
-
'dstag'
|
268 |
-
'flc'
|
269 |
-
'fls'
|
270 |
-
'm6d'
|
271 |
-
'ela'
|
272 |
-
'ga'
|
273 |
-
'ua'
|
274 |
-
'gcs'
|
275 |
-
'opt'
|
276 |
-
'ts'
|
277 |
-
'hjtc'
|
278 |
-
'infinity'
|
279 |
-
'sca'
|
280 |
-
'k50Init'
|
281 |
-
'll'
|
282 |
-
'bzi'
|
283 |
-
'ljs'
|
284 |
-
'ms'
|
285 |
-
'mpm'
|
286 |
-
'mpr'
|
287 |
-
'messagemate'
|
288 |
-
'mf'
|
289 |
-
'ta'
|
290 |
-
'ndcr'
|
291 |
-
'nudge'
|
292 |
-
'okt'
|
293 |
-
'omc'
|
294 |
-
'messagemate'
|
295 |
-
'pa'
|
296 |
-
'pc'
|
297 |
-
'pntr'
|
298 |
-
'placedPixel'
|
299 |
-
'pijs'
|
300 |
-
'qcm'
|
301 |
-
'qpx'
|
302 |
-
'fxm'
|
303 |
-
'scjs'
|
304 |
-
'scp'
|
305 |
-
'sfc'
|
306 |
-
'sfl'
|
307 |
-
'sfr'
|
308 |
-
'shareaholic'
|
309 |
-
'svw'
|
310 |
-
'tdlc'
|
311 |
-
'tdsc'
|
312 |
-
'tc'
|
313 |
-
'tdc'
|
314 |
'twitter_website_tag' => 'Twitter Universal Website Tag',
|
315 |
-
'uslt'
|
316 |
-
'uspt'
|
317 |
-
'vei'
|
318 |
-
'veip'
|
319 |
-
'vdc'
|
320 |
-
'xpsh'
|
321 |
-
'yieldify'
|
322 |
-
'zone'
|
323 |
),
|
324 |
-
'triggers'
|
325 |
'evl' => 'Element Visibility Listener/Trigger',
|
326 |
-
'cl'
|
327 |
'fsl' => 'Form Submit Listener/Trigger',
|
328 |
-
'hl'
|
329 |
'jel' => 'JavaScript Error Listener/Trigger',
|
330 |
'lcl' => 'Link Click Listener/Trigger',
|
331 |
'sdl' => 'Scroll Depth Listener/Trigger',
|
332 |
-
'tl'
|
333 |
-
'ytl' => 'YouTube Video Listener/Trigger'
|
334 |
),
|
335 |
'variables' => array(
|
336 |
-
'k'
|
337 |
-
'c'
|
338 |
-
'ctv'
|
339 |
-
'e'
|
340 |
-
'jsm'
|
341 |
-
'v'
|
342 |
-
'dbg'
|
343 |
-
'd'
|
344 |
-
'vis'
|
345 |
-
'f'
|
346 |
-
'j'
|
347 |
-
'smm'
|
348 |
-
'r'
|
349 |
'remm' => 'RegEx Table',
|
350 |
-
'u'
|
351 |
-
)
|
352 |
);
|
353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
function gtm4wp_migrate_blacklist_whitelist( $current_options ) {
|
355 |
if ( ( array_key_exists( GTM4WP_OPTION_BLACKLIST_ENABLE, $current_options ) )
|
356 |
-
|
357 |
) {
|
358 |
$_gtmrestrictlistitems = array();
|
359 |
|
360 |
-
// IDs from https://developers.google.com/tag-manager/devguide#security
|
361 |
if ( $current_options[ GTM4WP_OPTION_BLACKLIST_ADADVISOR ] ) {
|
362 |
$_gtmrestrictlistitems[] = 'ta';
|
363 |
}
|
@@ -422,6 +435,13 @@ function gtm4wp_migrate_blacklist_whitelist( $current_options ) {
|
|
422 |
return $current_options;
|
423 |
}
|
424 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
function gtm4wp_reload_options() {
|
426 |
global $gtm4wp_defaultoptions, $gtm4wp_business_verticals;
|
427 |
|
@@ -430,38 +450,47 @@ function gtm4wp_reload_options() {
|
|
430 |
$gtm4wp_defaultoptions = array();
|
431 |
}
|
432 |
|
433 |
-
if ( !isset( $storedoptions[ GTM4WP_OPTION_BLACKLIST_STATUS ] ) ) {
|
434 |
$storedoptions = gtm4wp_migrate_blacklist_whitelist( $storedoptions );
|
435 |
}
|
436 |
|
|
|
437 |
$return_options = array_merge( $gtm4wp_defaultoptions, $storedoptions );
|
438 |
$return_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] = explode( ',', $return_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] );
|
439 |
|
440 |
if ( defined( 'GTM4WP_HARDCODED_GTM_ID' ) ) {
|
441 |
-
$return_options[ GTM4WP_OPTION_GTM_CODE ] = GTM4WP_HARDCODED_GTM_ID;
|
442 |
}
|
443 |
|
444 |
if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_AUTH' ) ) {
|
445 |
-
$return_options[ GTM4WP_OPTION_ENV_GTM_AUTH ] = GTM4WP_HARDCODED_GTM_ENV_AUTH;
|
446 |
}
|
447 |
|
448 |
if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_PREVIEW' ) ) {
|
449 |
-
$return_options[ GTM4WP_OPTION_ENV_GTM_PREVIEW ] = GTM4WP_HARDCODED_GTM_ENV_PREVIEW;
|
450 |
}
|
451 |
|
452 |
-
if ( !array_key_exists( $return_options[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ], $gtm4wp_business_verticals ) ) {
|
453 |
$return_options[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ] = $gtm4wp_defaultoptions[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ];
|
454 |
}
|
455 |
|
456 |
return $return_options;
|
457 |
}
|
458 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
459 |
function gtp4wp_debug_file( $debug_data ) {
|
460 |
-
$fp = fopen( dirname( __FILE__ ) . '/' .
|
461 |
if ( $fp ) {
|
462 |
fwrite( $fp, $debug_data );
|
463 |
fclose( $fp );
|
464 |
}
|
465 |
}
|
|
|
466 |
|
467 |
$gtm4wp_options = gtm4wp_reload_options();
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Plugin constant declarations and default option values.
|
4 |
+
*
|
5 |
+
* @package GTM4WP
|
6 |
+
* @author Thomas Geiger
|
7 |
+
* @copyright 2013- Geiger Tamás e.v. (Thomas Geiger s.e.)
|
8 |
+
* @license GNU General Public License, version 3
|
9 |
+
*/
|
10 |
+
|
11 |
define( 'GTM4WP_OPTIONS', 'gtm4wp-options' );
|
12 |
define( 'GTM4WP_OPTION_GTM_CODE', 'gtm-code' );
|
13 |
define( 'GTM4WP_OPTION_GTM_PLACEMENT', 'gtm-code-placement' );
|
19 |
define( 'GTM4WP_OPTION_GTMDOMAIN', 'gtm-domain-name' );
|
20 |
define( 'GTM4WP_OPTION_NOGTMFORLOGGEDIN', 'gtm-no-gtm-for-logged-in' );
|
21 |
|
|
|
22 |
define( 'GTM4WP_OPTION_INCLUDE_LOGGEDIN', 'include-loggedin' );
|
23 |
define( 'GTM4WP_OPTION_INCLUDE_USERROLE', 'include-userrole' );
|
24 |
define( 'GTM4WP_OPTION_INCLUDE_USERID', 'include-userid' );
|
36 |
define( 'GTM4WP_OPTION_INCLUDE_POSTCOUNT', 'include-postcount' );
|
37 |
define( 'GTM4WP_OPTION_INCLUDE_POSTID', 'include-postid' );
|
38 |
define( 'GTM4WP_OPTION_INCLUDE_POSTFORMAT', 'include-postformat' );
|
39 |
+
define( 'GTM4WP_OPTION_INCLUDE_POSTTERMLIST', 'include-postterms' );
|
40 |
define( 'GTM4WP_OPTION_INCLUDE_SEARCHDATA', 'include-searchdata' );
|
41 |
define( 'GTM4WP_OPTION_INCLUDE_BROWSERDATA', 'include-browserdata' );
|
42 |
define( 'GTM4WP_OPTION_INCLUDE_OSDATA', 'include-osdata' );
|
69 |
define( 'GTM4WP_OPTION_BLACKLIST_SANDBOXED', 'blacklist-sandboxed' );
|
70 |
define( 'GTM4WP_OPTION_BLACKLIST_STATUS', 'blacklist-status' );
|
71 |
|
72 |
+
// deprecated options BEGIN.
|
73 |
define( 'GTM4WP_OPTION_BLACKLIST_ADADVISOR', 'blacklist-adadvisor' );
|
74 |
define( 'GTM4WP_OPTION_BLACKLIST_ADROLL', 'blacklist-adroll' );
|
75 |
define( 'GTM4WP_OPTION_BLACKLIST_AWCONV', 'blacklist-adwords-conversion' );
|
101 |
define( 'GTM4WP_OPTION_BLACKLIST_MACRO_REFERRER', 'blacklist-macro-referrer' );
|
102 |
define( 'GTM4WP_OPTION_BLACKLIST_MACRO_URL', 'blacklist-macro-url' );
|
103 |
define( 'GTM4WP_OPTION_BLACKLIST_MACRO_AUTOEVENT', 'blacklist-macro-autoevent-variable' );
|
104 |
+
// deprecated options END.
|
105 |
|
106 |
define( 'GTM4WP_OPTION_INTEGRATE_WPCF7', 'integrate-wpcf7' );
|
107 |
|
109 |
define( 'GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC', 'integrate-woocommerce-track-enhanced-ecommerce' );
|
110 |
define( 'GTM4WP_OPTION_INTEGRATE_WCPRODPERIMPRESSION', 'integrate-woocommerce-product-per-impression' );
|
111 |
define( 'GTM4WP_OPTION_INTEGRATE_WCEECCARTASFIRSTSTEP', 'integrate-woocommerce-cart-as-first-step' );
|
112 |
+
define( 'GTM4WP_OPTION_INTEGRATE_WCEINCLUDECARTINDL', 'integrate-woocommerce-cart-content-in-datalayer' );
|
113 |
+
define( 'GTM4WP_OPTION_INTEGRATE_WCEECBRANDTAXONOMY', 'integrate-woocommerce-brand-taxonomy' );
|
114 |
define( 'GTM4WP_OPTION_INTEGRATE_WCREMARKETING', 'integrate-woocommerce-remarketing' );
|
115 |
define( 'GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL', 'integrate-woocommerce-business-vertical' );
|
116 |
define( 'GTM4WP_OPTION_INTEGRATE_WCUSESKU', 'integrate-woocommerce-remarketing-usesku' );
|
152 |
GTM4WP_OPTION_GTMDOMAIN => '',
|
153 |
GTM4WP_OPTION_NOGTMFORLOGGEDIN => '',
|
154 |
|
|
|
155 |
GTM4WP_OPTION_INCLUDE_LOGGEDIN => false,
|
156 |
GTM4WP_OPTION_INCLUDE_USERROLE => false,
|
157 |
GTM4WP_OPTION_INCLUDE_USERID => false,
|
217 |
GTM4WP_OPTION_INTEGRATE_WCREMPRODIDPREFIX => '',
|
218 |
GTM4WP_OPTION_INTEGRATE_WCCUSTOMERDATA => false,
|
219 |
GTM4WP_OPTION_INTEGRATE_WCORDERDATA => false,
|
220 |
+
GTM4WP_OPTION_INTEGRATE_WCORDERMAXAGE => 30,
|
221 |
GTM4WP_OPTION_INTEGRATE_WCEXCLUDETAX => false,
|
222 |
GTM4WP_OPTION_INTEGRATE_WCEXCLUDESHIPPING => false,
|
223 |
GTM4WP_OPTION_INTEGRATE_WCNOORDERTRACKEDFLAG => false,
|
229 |
|
230 |
GTM4WP_OPTION_INTEGRATE_AMPID => '',
|
231 |
|
232 |
+
GTM4WP_OPTION_INTEGRATE_COOKIEBOT => false,
|
233 |
);
|
234 |
|
235 |
$gtm4wp_business_verticals = array(
|
236 |
+
'retail' => 'Retail',
|
237 |
+
'education' => 'Education',
|
238 |
+
'flights' => 'Flights',
|
239 |
'hotel_rental' => 'Hotel rental',
|
240 |
+
'jobs' => 'Jobs',
|
241 |
+
'local' => 'Local deals',
|
242 |
+
'real_estate' => 'Real estate',
|
243 |
+
'travel' => 'Travel',
|
244 |
+
'custom' => 'Custom',
|
245 |
);
|
246 |
|
247 |
$gtm4wp_business_verticals_ids = array(
|
248 |
'flights' => 'destination',
|
249 |
+
'travel' => 'destination',
|
250 |
);
|
251 |
|
252 |
$gtm4wp_entity_ids = array(
|
253 |
+
'tags' => array(
|
254 |
+
'abtGeneric' => 'AB TASTY Generic Tag',
|
255 |
+
'ta' => 'AdAdvisor Tag',
|
256 |
+
'adm' => 'Adometry Tag',
|
257 |
+
'asp' => 'AdRoll Smart Pixel Tag',
|
258 |
+
'awct' => 'Google Ads Conversion Tracking Tag',
|
259 |
+
'sp' => 'Google Ads Remarketing Tag',
|
260 |
+
'awc' => 'Affiliate Window Conversion Tag',
|
261 |
+
'awj' => 'Affiliate Window Journey Tag',
|
262 |
+
'baut' => 'Bing Ads Universal Event Tracking',
|
263 |
+
'bb' => 'Bizrate Insights Buyer Survey Solution',
|
264 |
+
'bsa' => 'Bizrate Insights Site Abandonment Survey Solution',
|
265 |
+
'cts' => 'ClickTale Standard Tracking Tag',
|
266 |
+
'csm' => 'comScore Unified Digital Measurement Tag',
|
267 |
+
'mpm' => 'Conversant Mediaplex - IFRAME MCT Tag',
|
268 |
+
'mpr' => 'Conversant Mediaplex - Standard IMG ROI Tag',
|
269 |
+
'gclidw' => 'Conversion Linker',
|
270 |
+
'cegg' => 'Crazy Egg Tag',
|
271 |
+
'crto' => 'Criteo OneTag',
|
272 |
+
'html' => 'Custom HTML Tag',
|
273 |
+
'img' => 'Custom Image Tag',
|
274 |
+
'dstag' => 'DistroScale Tag',
|
275 |
+
'flc' => 'Floodlight Counter Tag',
|
276 |
+
'fls' => 'Floodlight Sales Tag',
|
277 |
+
'm6d' => 'Dstillery Universal Pixel Tag',
|
278 |
+
'ela' => 'Eulerian Analytics Tag',
|
279 |
+
'ga' => 'Google Analytics Tag (classic, legacy)',
|
280 |
+
'ua' => 'Google Analytics Tag (universal, latest)',
|
281 |
+
'gcs' => 'Google Consumer Surveys Website Satisfaction',
|
282 |
+
'opt' => 'Google Optimize',
|
283 |
+
'ts' => 'Google Trusted Stores Tag',
|
284 |
+
'hjtc' => 'Hotjar Tracking Code',
|
285 |
+
'infinity' => 'Infinity Call Tracking Tag',
|
286 |
+
'sca' => 'Intent Media - Search Compare Ads',
|
287 |
+
'k50Init' => 'K50 tracking tag',
|
288 |
+
'll' => 'LeadLab',
|
289 |
+
'bzi' => 'LinkedIn Tag',
|
290 |
+
'ljs' => 'Lytics JS Tag',
|
291 |
+
'ms' => 'Marin Software Tag',
|
292 |
+
'mpm' => 'Mediaplex - IFRAME MCT Tag',
|
293 |
+
'mpr' => 'Mediaplex - Standard IMG ROI Tag',
|
294 |
+
'messagemate' => 'Message Mate',
|
295 |
+
'mf' => 'Mouseflow Tag',
|
296 |
+
'ta' => 'Neustar Pixel',
|
297 |
+
'ndcr' => 'Nielsen DCR Static Lite Tag',
|
298 |
+
'nudge' => 'Nudge Content Analytics Tag',
|
299 |
+
'okt' => 'Oktopost Tracking Code',
|
300 |
+
'omc' => 'Optimise Conversion Tag',
|
301 |
+
'messagemate' => 'OwnerListens Message Mate',
|
302 |
+
'pa' => 'Perfect Audience Pixel',
|
303 |
+
'pc' => 'Personali Canvas',
|
304 |
+
'pntr' => 'Pinterest',
|
305 |
+
'placedPixel' => 'Placed',
|
306 |
+
'pijs' => 'Pulse Insights Voice of Customer Platform',
|
307 |
+
'qcm' => 'Quantcast Audience Measurement',
|
308 |
+
'qpx' => 'Quora Pixel',
|
309 |
+
'fxm' => 'Rawsoft FoxMetrics',
|
310 |
+
'scjs' => 'SaleCycle JavaScript Tag',
|
311 |
+
'scp' => 'SaleCycle Pixel Tag',
|
312 |
+
'sfc' => 'SearchForce JavaScript Tracking for Conversion Page',
|
313 |
+
'sfl' => 'SearchForce JavaScript Tracking for Landing Page',
|
314 |
+
'sfr' => 'SearchForce Redirection Tracking Tag',
|
315 |
+
'shareaholic' => 'Shareaholic',
|
316 |
+
'svw' => 'Survicate Widget',
|
317 |
+
'tdlc' => 'Tradedoubler Lead Conversion Tag',
|
318 |
+
'tdsc' => 'Tradedoubler Sale Conversion Tag',
|
319 |
+
'tc' => 'Turn Conversion Tracking Tag',
|
320 |
+
'tdc' => 'Turn Data Collection Tag',
|
321 |
'twitter_website_tag' => 'Twitter Universal Website Tag',
|
322 |
+
'uslt' => 'Upsellit Global Footer Tag',
|
323 |
+
'uspt' => 'Upsellit Confirmation Tag',
|
324 |
+
'vei' => 'Ve Interactive JavaScript Tag',
|
325 |
+
'veip' => 'Ve Interactive Pixel',
|
326 |
+
'vdc' => 'VisualDNA Conversion Tag',
|
327 |
+
'xpsh' => 'Xtremepush',
|
328 |
+
'yieldify' => 'Yieldify',
|
329 |
+
'zone' => 'Zones',
|
330 |
),
|
331 |
+
'triggers' => array(
|
332 |
'evl' => 'Element Visibility Listener/Trigger',
|
333 |
+
'cl' => 'Click Listener/Trigger',
|
334 |
'fsl' => 'Form Submit Listener/Trigger',
|
335 |
+
'hl' => 'History Listener/Trigger',
|
336 |
'jel' => 'JavaScript Error Listener/Trigger',
|
337 |
'lcl' => 'Link Click Listener/Trigger',
|
338 |
'sdl' => 'Scroll Depth Listener/Trigger',
|
339 |
+
'tl' => 'Timer Listener/Trigger',
|
340 |
+
'ytl' => 'YouTube Video Listener/Trigger',
|
341 |
),
|
342 |
'variables' => array(
|
343 |
+
'k' => '1st Party Cookie',
|
344 |
+
'c' => 'Constant',
|
345 |
+
'ctv' => 'Container Version Number',
|
346 |
+
'e' => 'Custom Event',
|
347 |
+
'jsm' => 'Custom JavaScript Variable',
|
348 |
+
'v' => 'Data Layer Variable',
|
349 |
+
'dbg' => 'Debug Mode',
|
350 |
+
'd' => 'DOM Element',
|
351 |
+
'vis' => 'Element Visibility',
|
352 |
+
'f' => 'HTTP Referrer',
|
353 |
+
'j' => 'JavaScript Variable',
|
354 |
+
'smm' => 'Lookup Table',
|
355 |
+
'r' => 'Random Number',
|
356 |
'remm' => 'RegEx Table',
|
357 |
+
'u' => 'URL',
|
358 |
+
),
|
359 |
);
|
360 |
|
361 |
+
/**
|
362 |
+
* Helper function to migrate blacklist / whitelist options from v1.12- to v1.12+
|
363 |
+
*
|
364 |
+
* @param array $current_options The current and possible outdated config array.
|
365 |
+
* @return array
|
366 |
+
*/
|
367 |
function gtm4wp_migrate_blacklist_whitelist( $current_options ) {
|
368 |
if ( ( array_key_exists( GTM4WP_OPTION_BLACKLIST_ENABLE, $current_options ) )
|
369 |
+
&& ( $current_options[ GTM4WP_OPTION_BLACKLIST_ENABLE ] > 0 )
|
370 |
) {
|
371 |
$_gtmrestrictlistitems = array();
|
372 |
|
373 |
+
// IDs from https://developers.google.com/tag-manager/devguide#security .
|
374 |
if ( $current_options[ GTM4WP_OPTION_BLACKLIST_ADADVISOR ] ) {
|
375 |
$_gtmrestrictlistitems[] = 'ta';
|
376 |
}
|
435 |
return $current_options;
|
436 |
}
|
437 |
|
438 |
+
/**
|
439 |
+
* Reads plugin options from database backend and merges this with default values.
|
440 |
+
* Migrates blacklist/whitelist options from v1.12- to v1.12+
|
441 |
+
* Overwrites some options that can be hard coded in wp-config.
|
442 |
+
*
|
443 |
+
* @return array
|
444 |
+
*/
|
445 |
function gtm4wp_reload_options() {
|
446 |
global $gtm4wp_defaultoptions, $gtm4wp_business_verticals;
|
447 |
|
450 |
$gtm4wp_defaultoptions = array();
|
451 |
}
|
452 |
|
453 |
+
if ( ! isset( $storedoptions[ GTM4WP_OPTION_BLACKLIST_STATUS ] ) ) {
|
454 |
$storedoptions = gtm4wp_migrate_blacklist_whitelist( $storedoptions );
|
455 |
}
|
456 |
|
457 |
+
// phpcs:ignore
|
458 |
$return_options = array_merge( $gtm4wp_defaultoptions, $storedoptions );
|
459 |
$return_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] = explode( ',', $return_options[ GTM4WP_OPTION_BLACKLIST_STATUS ] );
|
460 |
|
461 |
if ( defined( 'GTM4WP_HARDCODED_GTM_ID' ) ) {
|
462 |
+
$return_options[ GTM4WP_OPTION_GTM_CODE ] = constant( 'GTM4WP_HARDCODED_GTM_ID' );
|
463 |
}
|
464 |
|
465 |
if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_AUTH' ) ) {
|
466 |
+
$return_options[ GTM4WP_OPTION_ENV_GTM_AUTH ] = constant( 'GTM4WP_HARDCODED_GTM_ENV_AUTH' );
|
467 |
}
|
468 |
|
469 |
if ( defined( 'GTM4WP_HARDCODED_GTM_ENV_PREVIEW' ) ) {
|
470 |
+
$return_options[ GTM4WP_OPTION_ENV_GTM_PREVIEW ] = constant( 'GTM4WP_HARDCODED_GTM_ENV_PREVIEW' );
|
471 |
}
|
472 |
|
473 |
+
if ( ! array_key_exists( $return_options[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ], $gtm4wp_business_verticals ) ) {
|
474 |
$return_options[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ] = $gtm4wp_defaultoptions[ GTM4WP_OPTION_INTEGRATE_WCBUSINESSVERTICAL ];
|
475 |
}
|
476 |
|
477 |
return $return_options;
|
478 |
}
|
479 |
|
480 |
+
/**
|
481 |
+
* Helper function for debug purposes. Not used in stable versions.
|
482 |
+
*
|
483 |
+
* @param string $debug_data The data that needs to be saved for debug logging.
|
484 |
+
* @return void
|
485 |
+
*/
|
486 |
+
// phpcs:disable
|
487 |
function gtp4wp_debug_file( $debug_data ) {
|
488 |
+
$fp = fopen( dirname( __FILE__ ) . '/' . gmdate( 'Y-m-d-H-i-s-u' ) . '.txt', 'w' );
|
489 |
if ( $fp ) {
|
490 |
fwrite( $fp, $debug_data );
|
491 |
fclose( $fp );
|
492 |
}
|
493 |
}
|
494 |
+
// phpcs:enable
|
495 |
|
496 |
$gtm4wp_options = gtm4wp_reload_options();
|
duracelltomi-google-tag-manager-for-wordpress.php
CHANGED
@@ -1,26 +1,45 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
WC requires at least: 3.2
|
13 |
-
WC tested up to: 6.3.1
|
14 |
-
*/
|
15 |
|
16 |
-
define( 'GTM4WP_VERSION',
|
17 |
-
define( 'GTM4WP_PATH',
|
18 |
|
19 |
global $gtp4wp_plugin_url, $gtp4wp_plugin_basename;
|
20 |
$gtp4wp_plugin_url = plugin_dir_url( __FILE__ );
|
21 |
$gtp4wp_plugin_basename = plugin_basename( __FILE__ );
|
22 |
require_once GTM4WP_PATH . '/common/readoptions.php';
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
function gtm4wp_init() {
|
25 |
load_plugin_textdomain( 'duracelltomi-google-tag-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
26 |
if ( is_admin() ) {
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Google Tag Manager for WordPress
|
4 |
+
*
|
5 |
+
* @package GTM4WP
|
6 |
+
* @author Thomas Geiger
|
7 |
+
* @copyright 2013- Geiger Tamás e.v. (Thomas Geiger s.e.)
|
8 |
+
* @license GNU General Public License, version 3
|
9 |
+
*
|
10 |
+
* @wordpress-plugin
|
11 |
+
* Plugin Name: GTM4WP
|
12 |
+
* Plugin URI: https://gtm4wp.com/
|
13 |
+
* Description: The first Google Tag Manager plugin for WordPress with business goals in mind
|
14 |
+
* Version: 1.15.1
|
15 |
+
* Requires at least: 3.4.0
|
16 |
+
* Requires PHP: 5.6
|
17 |
+
* Author: Thomas Geiger
|
18 |
+
* Author URI: https://gtm4wp.com/
|
19 |
+
* License: GPLv3
|
20 |
+
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
21 |
+
* Text Domain: duracelltomi-google-tag-manager
|
22 |
+
* Domain Path: /languages
|
23 |
|
24 |
+
* WC requires at least: 3.2
|
25 |
+
* WC tested up to: 6.3.1
|
26 |
+
*/
|
27 |
|
28 |
+
define( 'GTM4WP_VERSION', '1.15.1' );
|
29 |
+
define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
|
30 |
|
31 |
global $gtp4wp_plugin_url, $gtp4wp_plugin_basename;
|
32 |
$gtp4wp_plugin_url = plugin_dir_url( __FILE__ );
|
33 |
$gtp4wp_plugin_basename = plugin_basename( __FILE__ );
|
34 |
require_once GTM4WP_PATH . '/common/readoptions.php';
|
35 |
|
36 |
+
/**
|
37 |
+
* WordPress hook function run after plugins have been loaded.
|
38 |
+
*
|
39 |
+
* @see https://developer.wordpress.org/reference/hooks/plugins_loaded/
|
40 |
+
*
|
41 |
+
* @return void
|
42 |
+
*/
|
43 |
function gtm4wp_init() {
|
44 |
load_plugin_textdomain( 'duracelltomi-google-tag-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
45 |
if ( is_admin() ) {
|
public/frontend.php
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
<?php
|
2 |
define( 'GTM4WP_WPFILTER_COMPILE_DATALAYER', 'gtm4wp_compile_datalayer' );
|
3 |
-
define( 'GTM4WP_WPFILTER_COMPILE_REMARKTING', 'gtm4wp_compile_remarkering' );
|
4 |
define( 'GTM4WP_WPFILTER_AFTER_DATALAYER', 'gtm4wp_after_datalayer' );
|
5 |
define( 'GTM4WP_WPFILTER_GETTHEGTMTAG', 'gtm4wp_get_the_gtm_tag' );
|
6 |
define( 'GTM4WP_WPFILTER_ADDGLOBALVARS', 'gtm4wp_add_global_vars' );
|
@@ -402,7 +401,7 @@ function gtm4wp_add_basic_datalayer_data( $dataLayer ) {
|
|
402 |
}
|
403 |
|
404 |
if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_MISCGEOCF ] && isset( $_SERVER['HTTP_CF_IPCOUNTRY'] ) ) {
|
405 |
-
$dataLayer['geoCloudflareCountryCode'] = $_SERVER['HTTP_CF_IPCOUNTRY'];
|
406 |
}
|
407 |
|
408 |
if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_WEATHER ] || $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_MISCGEO ] ) {
|
@@ -550,9 +549,8 @@ function gtm4wp_get_the_gtm_tag() {
|
|
550 |
|
551 |
$_gtm_tag .= '
|
552 |
<script' . ( $has_html5_support ? '' : ' type="text/javascript"' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
553 |
-
|
554 |
-
|
555 |
-
console_cmd && console_cmd("[GTM4WP] Data layer codes are active but GTM container must be loaded using custom coding !!!");
|
556 |
</script>';
|
557 |
}
|
558 |
|
@@ -678,16 +676,6 @@ function gtm4wp_wp_body_open() {
|
|
678 |
}
|
679 |
}
|
680 |
|
681 |
-
function gtm4wp_filter_visitor_keys( $dataLayer ) {
|
682 |
-
foreach ( $dataLayer as $dl_key => $dl_value ) {
|
683 |
-
if ( strpos( $dl_key, 'visitor' ) !== false ) {
|
684 |
-
unset( $dataLayer[ $dl_key ] );
|
685 |
-
}
|
686 |
-
}
|
687 |
-
|
688 |
-
return $dataLayer;
|
689 |
-
}
|
690 |
-
|
691 |
/**
|
692 |
* GTM4WP global JS variables WordPress filter
|
693 |
*
|
@@ -752,38 +740,18 @@ function gtm4wp_wp_header_begin( $echo = true ) {
|
|
752 |
$_gtm_header_content = '
|
753 |
<!-- Google Tag Manager for WordPress by gtm4wp.com -->
|
754 |
<!-- GTM Container placement set to ' . gtm4wp_get_container_placement_string() . ' -->
|
755 |
-
<script data-cfasync="false" data-pagespeed-no-defer' . ( $has_html5_support ? ' type="text/javascript"' : '' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
756 |
-
const console_cmd = console.warn || console.log;';
|
757 |
|
758 |
if ( $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] != '' ) {
|
759 |
$gtm4wp_datalayer_data = array();
|
760 |
$gtm4wp_datalayer_data = (array) apply_filters( GTM4WP_WPFILTER_COMPILE_DATALAYER, $gtm4wp_datalayer_data );
|
761 |
|
762 |
-
if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_REMARKETING ] ) {
|
763 |
-
// add Google Ads remarketing tags as suggested here:
|
764 |
-
// https://support.google.com/tagmanager/answer/3002580?hl=en
|
765 |
-
add_filter( GTM4WP_WPFILTER_COMPILE_REMARKTING, 'gtm4wp_filter_visitor_keys' );
|
766 |
-
$gtm4wp_remarketing_tags = (array) apply_filters( GTM4WP_WPFILTER_COMPILE_REMARKTING, $gtm4wp_datalayer_data );
|
767 |
-
|
768 |
-
$_gtm_header_content .= "\nvar google_tag_params = ";
|
769 |
-
$_gtm_header_content .= json_encode( $gtm4wp_remarketing_tags );
|
770 |
-
$_gtm_header_content .= ';';
|
771 |
-
$gtm4wp_datalayer_data['google_tag_params'] = '-~-window.google_tag_params-~-';
|
772 |
-
}
|
773 |
-
|
774 |
if ( version_compare( PHP_VERSION, '5.4.0' ) >= 0 ) {
|
775 |
$gtm4wp_datalayer_json = json_encode( $gtm4wp_datalayer_data, JSON_UNESCAPED_UNICODE );
|
776 |
} else {
|
777 |
$gtm4wp_datalayer_json = json_encode( $gtm4wp_datalayer_data );
|
778 |
}
|
779 |
|
780 |
-
// Clean up and then push datalayer to AMP
|
781 |
-
$gtm4wp_datalayer_json = str_replace(
|
782 |
-
array( '"-~-', '-~-"' ),
|
783 |
-
array( '', '' ),
|
784 |
-
str_replace( '', '-', $gtm4wp_datalayer_json )
|
785 |
-
);
|
786 |
-
|
787 |
$_gtm_header_content .= '
|
788 |
var dataLayer_content = ' . $gtm4wp_datalayer_json . ';';
|
789 |
|
@@ -880,8 +848,8 @@ function gtm4wp_wp_header_begin( $echo = true ) {
|
|
880 |
|
881 |
$_gtm_header_content .= '
|
882 |
<script' . ( $has_html5_support ? '' : ' type="text/javascript"' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
883 |
-
|
884 |
-
|
885 |
</script>';
|
886 |
}
|
887 |
|
@@ -894,9 +862,9 @@ function gtm4wp_wp_header_begin( $echo = true ) {
|
|
894 |
|
895 |
$_gtm_header_content .= '
|
896 |
<script' . ( $has_html5_support ? '' : ' type="text/javascript"' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
</script>';
|
901 |
|
902 |
break;
|
1 |
<?php
|
2 |
define( 'GTM4WP_WPFILTER_COMPILE_DATALAYER', 'gtm4wp_compile_datalayer' );
|
|
|
3 |
define( 'GTM4WP_WPFILTER_AFTER_DATALAYER', 'gtm4wp_after_datalayer' );
|
4 |
define( 'GTM4WP_WPFILTER_GETTHEGTMTAG', 'gtm4wp_get_the_gtm_tag' );
|
5 |
define( 'GTM4WP_WPFILTER_ADDGLOBALVARS', 'gtm4wp_add_global_vars' );
|
401 |
}
|
402 |
|
403 |
if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_MISCGEOCF ] && isset( $_SERVER['HTTP_CF_IPCOUNTRY'] ) ) {
|
404 |
+
$dataLayer['geoCloudflareCountryCode'] = esc_js( $_SERVER['HTTP_CF_IPCOUNTRY'] );
|
405 |
}
|
406 |
|
407 |
if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_WEATHER ] || $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_MISCGEO ] ) {
|
549 |
|
550 |
$_gtm_tag .= '
|
551 |
<script' . ( $has_html5_support ? '' : ' type="text/javascript"' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
552 |
+
console.warn && console.warn("[GTM4WP] Google Tag Manager container code placement set to OFF !!!");
|
553 |
+
console.warn && console.warn("[GTM4WP] Data layer codes are active but GTM container must be loaded using custom coding !!!");
|
|
|
554 |
</script>';
|
555 |
}
|
556 |
|
676 |
}
|
677 |
}
|
678 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
679 |
/**
|
680 |
* GTM4WP global JS variables WordPress filter
|
681 |
*
|
740 |
$_gtm_header_content = '
|
741 |
<!-- Google Tag Manager for WordPress by gtm4wp.com -->
|
742 |
<!-- GTM Container placement set to ' . gtm4wp_get_container_placement_string() . ' -->
|
743 |
+
<script data-cfasync="false" data-pagespeed-no-defer' . ( $has_html5_support ? ' type="text/javascript"' : '' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>';
|
|
|
744 |
|
745 |
if ( $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] != '' ) {
|
746 |
$gtm4wp_datalayer_data = array();
|
747 |
$gtm4wp_datalayer_data = (array) apply_filters( GTM4WP_WPFILTER_COMPILE_DATALAYER, $gtm4wp_datalayer_data );
|
748 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
749 |
if ( version_compare( PHP_VERSION, '5.4.0' ) >= 0 ) {
|
750 |
$gtm4wp_datalayer_json = json_encode( $gtm4wp_datalayer_data, JSON_UNESCAPED_UNICODE );
|
751 |
} else {
|
752 |
$gtm4wp_datalayer_json = json_encode( $gtm4wp_datalayer_data );
|
753 |
}
|
754 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
755 |
$_gtm_header_content .= '
|
756 |
var dataLayer_content = ' . $gtm4wp_datalayer_json . ';';
|
757 |
|
848 |
|
849 |
$_gtm_header_content .= '
|
850 |
<script' . ( $has_html5_support ? '' : ' type="text/javascript"' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
851 |
+
console.warn && console.warn("[GTM4WP] Google Tag Manager container code placement set to OFF !!!");
|
852 |
+
console.warn && console.warn("[GTM4WP] Data layer codes are active but GTM container must be loaded using custom coding !!!");
|
853 |
</script>';
|
854 |
}
|
855 |
|
862 |
|
863 |
$_gtm_header_content .= '
|
864 |
<script' . ( $has_html5_support ? '' : ' type="text/javascript"' ) . ( $add_cookiebot_ignore ? ' data-cookieconsent="ignore"' : '' ) . '>
|
865 |
+
console.warn && console.warn("[GTM4WP] Google Tag Manager container code was disabled for this user role: ' . $user_role . ' !!!");
|
866 |
+
console.warn && console.warn("[GTM4WP] Logout or login with a user having a different user role!");
|
867 |
+
console.warn && console.warn("[GTM4WP] Data layer codes are active but GTM container code is omitted !!!");
|
868 |
</script>';
|
869 |
|
870 |
break;
|
readme.txt
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
-
===
|
2 |
Contributors: duracelltomi
|
3 |
Donate link: https://gtm4wp.com/
|
4 |
Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, google ads, adwords remarketing, google ads remarketing, remarketing, google analytics, analytics, facebook ads, facebook remarketing, facebook pixel, google optimize, personalisation
|
5 |
Requires at least: 3.4.0
|
6 |
Requires PHP: 5.6
|
7 |
-
Tested up to: 5.9.
|
8 |
-
Stable tag: 1.15
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl.html
|
11 |
|
@@ -136,7 +136,7 @@ http://cutroni.com/blog/2012/02/21/advanced-content-tracking-with-google-analyti
|
|
136 |
|
137 |
= Google Ads remarketing =
|
138 |
|
139 |
-
|
140 |
This enables you to build sophisticated remarketing lists.
|
141 |
|
142 |
= Blacklist & Whitelist Tag Manager tags, triggers and variables =
|
@@ -150,7 +150,7 @@ and/or custom JavaScript variables you can secure the Tag Manager container.
|
|
150 |
|
151 |
= Integration =
|
152 |
|
153 |
-
|
154 |
|
155 |
* Contact Form 7: fire an event when a Contact Form 7 form was submitted with any result (mail sent, mail failed, spam detected, invalid input)
|
156 |
* WooCommerce:
|
@@ -235,6 +235,18 @@ https://gtm4wp.com/how-to-articles/how-to-exclude-admin-users-from-being-tracked
|
|
235 |
|
236 |
== Changelog ==
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
= 1.15 =
|
239 |
|
240 |
* Added: pagePostType data layer variable will now return 404-error on 404 pages and search-results on search result pages
|
1 |
+
=== GTM4WP ===
|
2 |
Contributors: duracelltomi
|
3 |
Donate link: https://gtm4wp.com/
|
4 |
Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, google ads, adwords remarketing, google ads remarketing, remarketing, google analytics, analytics, facebook ads, facebook remarketing, facebook pixel, google optimize, personalisation
|
5 |
Requires at least: 3.4.0
|
6 |
Requires PHP: 5.6
|
7 |
+
Tested up to: 5.9.3
|
8 |
+
Stable tag: 1.15.1
|
9 |
License: GPLv3
|
10 |
License URI: http://www.gnu.org/licenses/gpl.html
|
11 |
|
136 |
|
137 |
= Google Ads remarketing =
|
138 |
|
139 |
+
GTM4WP can add each dataLayer variable as a Google Ads remarketing custom parameter list.
|
140 |
This enables you to build sophisticated remarketing lists.
|
141 |
|
142 |
= Blacklist & Whitelist Tag Manager tags, triggers and variables =
|
150 |
|
151 |
= Integration =
|
152 |
|
153 |
+
GTM4WP integrates with several popular plugins. More integration to come!
|
154 |
|
155 |
* Contact Form 7: fire an event when a Contact Form 7 form was submitted with any result (mail sent, mail failed, spam detected, invalid input)
|
156 |
* WooCommerce:
|
235 |
|
236 |
== Changelog ==
|
237 |
|
238 |
+
= 1.15.1 =
|
239 |
+
|
240 |
+
* Fixed: JavaScript error with the newly added console logging to debug code placement issues
|
241 |
+
* Fixed: possible XSS Vulnerability if Cloudflare country code option enabled. Thanks [Guillaume Fortier](https://www.linkedin.com/in/guillaume-f-a728711b0/)
|
242 |
+
* Fixed: proven XSS Vulnerability if adding site search into the data layer was enabled. Original report by [not_stoppable](https://hackerone.com/not_stoppable?type=user). Root cause analysis by [Cory Buecker](https://www.linkedin.com/in/corybuecker/).
|
243 |
+
* Removed: deprecated feature Google Ads remarketing. This is the outdated, classic way using the google_tag_params variable.
|
244 |
+
* Dev: removed PHP constant GTM4WP_WPFILTER_COMPILE_REMARKTING (related to removed Google Ads remarketing feature)
|
245 |
+
* Dev: removed gtm4wp_compile_remarkering WordPress filter (related to removed Google Ads remarketing feature)
|
246 |
+
|
247 |
+
Note to plugin users: I sincerely appologize for the vulnerabilities. To make sure, such cases do not happen again,
|
248 |
+
the next version will be fully dedicacted to go through every peace of code and make sure proper data processing is happening in GTM4WP.
|
249 |
+
|
250 |
= 1.15 =
|
251 |
|
252 |
* Added: pagePostType data layer variable will now return 404-error on 404 pages and search-results on search result pages
|
uninstall.php
CHANGED
@@ -1,9 +1,19 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Loaded when GTM4WP was uninstalled.
|
4 |
+
* Deletes plugin options from database.
|
5 |
+
*
|
6 |
+
* @package GTM4WP
|
7 |
+
* @author Thomas Geiger
|
8 |
+
* @copyright 2013- Geiger Tamás e.v. (Thomas Geiger s.e.)
|
9 |
+
* @license GNU General Public License, version 3
|
10 |
+
*/
|
11 |
+
|
12 |
+
// if uninstall.php is not called by WordPress, die.
|
13 |
+
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
14 |
+
die;
|
15 |
+
}
|
16 |
+
|
17 |
+
require_once dirname( __FILE__ ) . '/common/readoptions.php';
|
18 |
+
|
19 |
+
delete_option( GTM4WP_OPTIONS );
|