DuracellTomi's Google Tag Manager for WordPress - Version 1.2

Version Description

  • Fixed: subtabs on admin page now showing in certain cases
  • Fixed: error message when running the site using WP CLI (thanks Patrick Holberg Hesselberg)
  • Fixed: some typos on admin page
  • Fixed: dismissable notices did not disappear in some cases
  • Fixed: tracking of Twitter event cased sometimes JS errors
  • Fixed: site search tracking caused sometimes PHP errors when HTTP_REFERER was not set
  • Updated: preparation for translate.wordpress.org
  • Added: support for multiple container IDs
  • Added: added form ID when sending a Contact Form 7 form. Variable name: gtm4wp.cf7formid
Download this release

Release Info

Developer duracelltomi
Plugin Icon 128x128 DuracellTomi's Google Tag Manager for WordPress
Version 1.2
Comparing to
See all releases

Code changes from version 1.1.1 to 1.2

admin/admin.php CHANGED
@@ -32,369 +32,369 @@ $GLOBALS["gtm4wp_def_user_notices_dismisses"] = array(
32
 
33
  $GLOBALS["gtm4wp_includefieldtexts"] = array(
34
  GTM4WP_OPTION_INCLUDE_POSTTYPE => array(
35
- "label" => __( "Posttype of current post/archive", GTM4WP_TEXTDOMAIN ),
36
- "description" => __( "Check this option to include the type of the current post or archive page (post, page or any custom post type).", GTM4WP_TEXTDOMAIN ),
37
  "phase" => GTM4WP_PHASE_STABLE
38
  ),
39
  GTM4WP_OPTION_INCLUDE_CATEGORIES => array(
40
- "label" => __( "Category list of current post/archive", GTM4WP_TEXTDOMAIN ),
41
- "description" => __( "Check this option to include the category names of the current post or archive page", GTM4WP_TEXTDOMAIN ),
42
  "phase" => GTM4WP_PHASE_STABLE
43
  ),
44
  GTM4WP_OPTION_INCLUDE_TAGS => array(
45
- "label" => __( "Tags of current post", GTM4WP_TEXTDOMAIN ),
46
- "description" => __( "Check this option to include the tags of the current post.", GTM4WP_TEXTDOMAIN ),
47
  "phase" => GTM4WP_PHASE_STABLE
48
  ),
49
  GTM4WP_OPTION_INCLUDE_AUTHOR => array(
50
- "label" => __( "Post author name", GTM4WP_TEXTDOMAIN ),
51
- "description" => __( "Check this option to include the author's name of the current post or author page.", GTM4WP_TEXTDOMAIN ),
52
  "phase" => GTM4WP_PHASE_STABLE
53
  ),
54
  GTM4WP_OPTION_INCLUDE_POSTDATE => array(
55
- "label" => __( "Post date", GTM4WP_TEXTDOMAIN ),
56
- "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.", GTM4WP_TEXTDOMAIN ),
57
  "phase" => GTM4WP_PHASE_STABLE
58
  ),
59
  GTM4WP_OPTION_INCLUDE_POSTTITLE => array(
60
- "label" => __( "Post title", GTM4WP_TEXTDOMAIN ),
61
- "description" => __( "Check this option to include the title of the current post.", GTM4WP_TEXTDOMAIN ),
62
  "phase" => GTM4WP_PHASE_STABLE
63
  ),
64
  GTM4WP_OPTION_INCLUDE_POSTCOUNT => array(
65
- "label" => __( "Post count", GTM4WP_TEXTDOMAIN ),
66
- "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.", GTM4WP_TEXTDOMAIN ),
67
  "phase" => GTM4WP_PHASE_STABLE
68
  ),
69
  GTM4WP_OPTION_INCLUDE_SEARCHDATA => array(
70
- "label" => __( "Search data", GTM4WP_TEXTDOMAIN ),
71
- "description" => __( "Check this option to include the search term, referring page URL and number of results on the search page.", GTM4WP_TEXTDOMAIN ),
72
  "phase" => GTM4WP_PHASE_STABLE
73
  ),
74
  GTM4WP_OPTION_INCLUDE_LOGGEDIN => array(
75
- "label" => __( "Logged in status", GTM4WP_TEXTDOMAIN ),
76
- "description" => __( "Check this option to include whether there is a logged in user on your website.", GTM4WP_TEXTDOMAIN ),
77
  "phase" => GTM4WP_PHASE_STABLE
78
  ),
79
  GTM4WP_OPTION_INCLUDE_USERROLE => array(
80
- "label" => __( "Logged in user role", GTM4WP_TEXTDOMAIN ),
81
- "description" => __( "Check this option to include the role of the logged in user.", GTM4WP_TEXTDOMAIN ),
82
  "phase" => GTM4WP_PHASE_STABLE
83
  ),
84
  GTM4WP_OPTION_INCLUDE_USERID => array(
85
- "label" => __( "Logged in user ID", GTM4WP_TEXTDOMAIN ),
86
- "description" => __( "Check this option to include the ID of the logged in user.", GTM4WP_TEXTDOMAIN ),
87
  "phase" => GTM4WP_PHASE_STABLE
88
  ),
89
  GTM4WP_OPTION_INCLUDE_REMARKETING => array(
90
- "label" => __( "Remarketing variable", GTM4WP_TEXTDOMAIN ),
91
- "description" => __( "Check this option to include a dataLayer variable where all dataLayer values are stored to be included in your AdWords remarketing tag as a custom variable field", GTM4WP_TEXTDOMAIN ),
92
  "phase" => GTM4WP_PHASE_STABLE
93
  ),
94
  GTM4WP_OPTION_INCLUDE_BROWSERDATA => array(
95
- "label" => __( "Browser data *", GTM4WP_TEXTDOMAIN ),
96
- "description" => __( "Check this option to include the name, version and engine data of the browser the visitor uses.", GTM4WP_TEXTDOMAIN ),
97
  "phase" => GTM4WP_PHASE_BETA
98
  ),
99
  GTM4WP_OPTION_INCLUDE_OSDATA => array(
100
- "label" => __( "OS data *", GTM4WP_TEXTDOMAIN ),
101
- "description" => __( "Check this option to include the name and version of the operating system the visitor uses.", GTM4WP_TEXTDOMAIN ),
102
  "phase" => GTM4WP_PHASE_BETA
103
  ),
104
  GTM4WP_OPTION_INCLUDE_DEVICEDATA => array(
105
- "label" => __( "Device data *", GTM4WP_TEXTDOMAIN ),
106
- "description" => __( "Check this option to include the type of device the user is currently using (desktop, tablet or mobile) including manufacturer and model data.", GTM4WP_TEXTDOMAIN ),
107
  "phase" => GTM4WP_PHASE_BETA
108
  ),
109
  GTM4WP_OPTION_INCLUDE_WEATHER => array(
110
- "label" => __( "Weather data", GTM4WP_TEXTDOMAIN ),
111
- "description" => sprintf( __( "Check this option to include the current weather conditions around the current visitor.<br /><strong>Attention!</strong> This feature uses <a href=\"%s\" target=\"_blank\">geoplugin.com</a> and <a href=\"%s\" target=\"_blank\">openweathermap.org</a> to collect data.<br />Depending on your website's traffic, additional fees may apply!<br />This plugin caches weather data for 1 hour to lower the need to access those services.", GTM4WP_TEXTDOMAIN ), "http://www.geoplugin.com/premium?utm_source=gtm4wp&utm_medium=link&utm_campaign=duracelltomi-google-tag-manager-for-wordpress", "http://openweathermap.org/price?utm_source=gtm4wp&utm_medium=link&utm_campaign=duracelltomi-google-tag-manager-for-wordpress" ),
112
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
113
  ),
114
  GTM4WP_OPTION_INCLUDE_WEATHERUNITS => array(
115
- "label" => __( "Weather data units", GTM4WP_TEXTDOMAIN ),
116
- "description" => __( "Select which temperature units you would like to use.", GTM4WP_TEXTDOMAIN ),
117
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
118
  )
119
  );
120
 
121
  $GLOBALS["gtm4wp_eventfieldtexts"] = array(
122
  GTM4WP_OPTION_EVENTS_FORMMOVE => array(
123
- "label" => __( "Form fill events (gtm4wp.formElementEnter & gtm4wp.formElementLeave)", GTM4WP_TEXTDOMAIN ),
124
- "description" => __( "Check this option to include a Tag Manager event when a visitor moves between elements of a form (comment, contact, etc).", GTM4WP_TEXTDOMAIN ),
125
  "phase" => GTM4WP_PHASE_STABLE
126
  ),
127
  GTM4WP_OPTION_EVENTS_SOCIAL => array(
128
- "label" => __( "Social actions (gtm4wp.socialAction)", GTM4WP_TEXTDOMAIN ),
129
- "description" => __( "Check this option to include a Tag Manager event when a visitor uses a social button to share/like content on a social network.", GTM4WP_TEXTDOMAIN ),
130
  "phase" => GTM4WP_PHASE_STABLE
131
  ),
132
  GTM4WP_OPTION_EVENTS_YOUTUBE => array(
133
- "label" => __( "YouTube video events", GTM4WP_TEXTDOMAIN ),
134
- "description" => __( "Check this option to include a Tag Manager event when a visitor interacts with a YouTube video embeded on your site.", GTM4WP_TEXTDOMAIN ),
135
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
136
  ),
137
  GTM4WP_OPTION_EVENTS_VIMEO => array(
138
- "label" => __( "Vimeo video events", GTM4WP_TEXTDOMAIN ),
139
- "description" => __( "Check this option to include a Tag Manager event when a visitor interacts with a Vimeo video embeded on your site.", GTM4WP_TEXTDOMAIN ),
140
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
141
  ),
142
  GTM4WP_OPTION_EVENTS_SOUNDCLOUD => array(
143
- "label" => __( "Soundcloud events", GTM4WP_TEXTDOMAIN ),
144
- "description" => __( "Check this option to include a Tag Manager event when a visitor interacts with a Soundcloud media embeded on your site.", GTM4WP_TEXTDOMAIN ),
145
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
146
  ),
147
  GTM4WP_OPTION_EVENTS_OUTBOUND => array(
148
- "label" => __( "Outbound link click events (gtm4wp.outboundClick)", GTM4WP_TEXTDOMAIN ),
149
- "description" => __( "Check this option to include a Tag Manager event when a visitor clicks on a link directing the visitor out of your website.", GTM4WP_TEXTDOMAIN ),
150
  "phase" => GTM4WP_PHASE_DEPRECATED
151
  ),
152
  GTM4WP_OPTION_EVENTS_DOWNLOADS => array(
153
- "label" => __( "Download click events (gtm4wp.downloadClick)", GTM4WP_TEXTDOMAIN ),
154
- "description" => __( "Check this option to include a Tag Manager event when a visitors clicks on a link that leads to a downloadable file on your website.", GTM4WP_TEXTDOMAIN ),
155
  "phase" => GTM4WP_PHASE_DEPRECATED
156
  ),
157
  GTM4WP_OPTION_EVENTS_DWLEXT => array(
158
- "label" => __( "Extensions to track", GTM4WP_TEXTDOMAIN ),
159
- "description" => __( "Enter a comma separated list of extensions to track when 'Include download click events' option is set.", GTM4WP_TEXTDOMAIN ),
160
  "phase" => GTM4WP_PHASE_DEPRECATED
161
  ),
162
  GTM4WP_OPTION_EVENTS_EMAILCLICKS => array(
163
- "label" => __( "Email click events (gtm4wp.emailClick)", GTM4WP_TEXTDOMAIN ),
164
- "description" => __( "Check this option to include a Tag Manager event when a visitor clicks on an email link.", GTM4WP_TEXTDOMAIN ),
165
  "phase" => GTM4WP_PHASE_DEPRECATED
166
  )
167
  );
168
 
169
  $GLOBALS["gtm4wp_scrollerfieldtexts"] = array(
170
  GTM4WP_OPTION_SCROLLER_ENABLED => array(
171
- "label" => __( "Enabled", GTM4WP_TEXTDOMAIN ),
172
- "description" => __( "Enable scroll tracker script on your website.", GTM4WP_TEXTDOMAIN ),
173
  "phase" => GTM4WP_PHASE_STABLE
174
  ),
175
  GTM4WP_OPTION_SCROLLER_DEBUGMODE => array(
176
- "label" => __( "Debug mode", GTM4WP_TEXTDOMAIN ),
177
- "description" => __( "Fire console.log() commands instead of dataLayer events.", GTM4WP_TEXTDOMAIN ),
178
  "phase" => GTM4WP_PHASE_STABLE
179
  ),
180
  GTM4WP_OPTION_SCROLLER_CALLBACKTIME => array(
181
- "label" => __( "Time delay before location check", GTM4WP_TEXTDOMAIN ),
182
- "description" => __( "Enter the number of milliseconds after the script checks the current location. It prevents too many events being fired while scrolling.", GTM4WP_TEXTDOMAIN ),
183
  "phase" => GTM4WP_PHASE_STABLE
184
  ),
185
  GTM4WP_OPTION_SCROLLER_DISTANCE => array(
186
- "label" => __( "Minimum distance", GTM4WP_TEXTDOMAIN ),
187
- "description" => __( "The minimum amount of pixels that a visitor has to scroll before we treat the move as scrolling.", GTM4WP_TEXTDOMAIN ),
188
  "phase" => GTM4WP_PHASE_STABLE
189
  ),
190
  GTM4WP_OPTION_SCROLLER_CONTENTID => array(
191
- "label" => __( "Content ID", GTM4WP_TEXTDOMAIN ),
192
- "description" => __( "Enter the DOM ID of the content element in your template. Leave it empty for default(content). Do not include the # sign.", GTM4WP_TEXTDOMAIN ),
193
  "phase" => GTM4WP_PHASE_STABLE
194
  ),
195
  GTM4WP_OPTION_SCROLLER_READERTIME => array(
196
- "label" => __( "Scroller time", GTM4WP_TEXTDOMAIN ),
197
- "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.", GTM4WP_TEXTDOMAIN ),
198
  "phase" => GTM4WP_PHASE_STABLE
199
  )
200
  );
201
 
202
  $GLOBALS["gtm4wp_blacklistfieldtexts"] = array(
203
  GTM4WP_OPTION_BLACKLIST_ENABLE => array(
204
- "label" => __( "Enable blacklist/whitelist", GTM4WP_TEXTDOMAIN ),
205
- "description" => __( "Disable feature or select whether you want to whitelist or blacklist tags", GTM4WP_TEXTDOMAIN ),
206
  "phase" => GTM4WP_PHASE_STABLE
207
  ),
208
  GTM4WP_OPTION_BLACKLIST_AWCONV => array(
209
- "label" => __( "AdWords Conversion Tracking Tag", GTM4WP_TEXTDOMAIN ),
210
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
211
  "phase" => GTM4WP_PHASE_STABLE
212
  ),
213
  GTM4WP_OPTION_BLACKLIST_AWREMARKET => array(
214
- "label" => __( "AdWords Remarketing Tag", GTM4WP_TEXTDOMAIN ),
215
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
216
  "phase" => GTM4WP_PHASE_STABLE
217
  ),
218
  GTM4WP_OPTION_BLACKLIST_GACLASSIC => array(
219
- "label" => __( "Google Analytics Tag", GTM4WP_TEXTDOMAIN ),
220
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
221
  "phase" => GTM4WP_PHASE_STABLE
222
  ),
223
  GTM4WP_OPTION_BLACKLIST_UA => array(
224
- "label" => __( "Universal Analytics Tag", GTM4WP_TEXTDOMAIN ),
225
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
226
  "phase" => GTM4WP_PHASE_STABLE
227
  ),
228
  GTM4WP_OPTION_BLACKLIST_ADADVISOR => array(
229
- "label" => __( "AdAdvisor Tag", GTM4WP_TEXTDOMAIN ),
230
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
231
  "phase" => GTM4WP_PHASE_STABLE
232
  ),
233
  GTM4WP_OPTION_BLACKLIST_ADROLL => array(
234
- "label" => __( "AdRoll Smart Pixel Tag", GTM4WP_TEXTDOMAIN ),
235
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
236
  "phase" => GTM4WP_PHASE_STABLE
237
  ),
238
  GTM4WP_OPTION_BLACKLIST_BIZO => array(
239
- "label" => __( "Bizo Insight Tag", GTM4WP_TEXTDOMAIN ),
240
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
241
  "phase" => GTM4WP_PHASE_STABLE
242
  ),
243
  GTM4WP_OPTION_BLACKLIST_CLICKTALE => array(
244
- "label" => __( "ClickTale Standard Tracking Tag", GTM4WP_TEXTDOMAIN ),
245
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
246
  "phase" => GTM4WP_PHASE_STABLE
247
  ),
248
  GTM4WP_OPTION_BLACKLIST_COMSCORE => array(
249
- "label" => __( "comScore Unified Digital Measurement Tag", GTM4WP_TEXTDOMAIN ),
250
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
251
  "phase" => GTM4WP_PHASE_STABLE
252
  ),
253
  GTM4WP_OPTION_BLACKLIST_CUSTOMHTML => array(
254
- "label" => __( "Custom HTML Tag", GTM4WP_TEXTDOMAIN ),
255
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
256
  "phase" => GTM4WP_PHASE_STABLE
257
  ),
258
  GTM4WP_OPTION_BLACKLIST_CUSTOMIMG => array(
259
- "label" => __( "Custom Image Tag", GTM4WP_TEXTDOMAIN ),
260
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
261
  "phase" => GTM4WP_PHASE_STABLE
262
  ),
263
  GTM4WP_OPTION_BLACKLIST_DBLCLKCOUNT => array(
264
- "label" => __( "DoubleClick Floodlight Counter Tag", GTM4WP_TEXTDOMAIN ),
265
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
266
  "phase" => GTM4WP_PHASE_STABLE
267
  ),
268
  GTM4WP_OPTION_BLACKLIST_DBLCLKSALES => array(
269
- "label" => __( "DoubleClick Floodlight Sales Tag", GTM4WP_TEXTDOMAIN ),
270
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
271
  "phase" => GTM4WP_PHASE_STABLE
272
  ),
273
  GTM4WP_OPTION_BLACKLIST_MARIN => array(
274
- "label" => __( "Marin Software Tag", GTM4WP_TEXTDOMAIN ),
275
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
276
  "phase" => GTM4WP_PHASE_STABLE
277
  ),
278
  GTM4WP_OPTION_BLACKLIST_MPLEXIFRAME => array(
279
- "label" => __( "Mediaplex - IFRAME MCT Tag", GTM4WP_TEXTDOMAIN ),
280
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
281
  "phase" => GTM4WP_PHASE_STABLE
282
  ),
283
  GTM4WP_OPTION_BLACKLIST_MPLEXROI => array(
284
- "label" => __( "Mediaplex - Standard IMG ROI Tag", GTM4WP_TEXTDOMAIN ),
285
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
286
  "phase" => GTM4WP_PHASE_STABLE
287
  ),
288
  GTM4WP_OPTION_BLACKLIST_MEDIA6DEG => array(
289
- "label" => __( "Media6Degrees Universal Pixel Tag", GTM4WP_TEXTDOMAIN ),
290
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
291
  "phase" => GTM4WP_PHASE_STABLE
292
  ),
293
  GTM4WP_OPTION_BLACKLIST_TURNCONV => array(
294
- "label" => __( "Turn Conversion Tracking Tag", GTM4WP_TEXTDOMAIN ),
295
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
296
  "phase" => GTM4WP_PHASE_STABLE
297
  ),
298
  GTM4WP_OPTION_BLACKLIST_TURNDATA => array(
299
- "label" => __( "Turn Data Collection Tag", GTM4WP_TEXTDOMAIN ),
300
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
301
  "phase" => GTM4WP_PHASE_STABLE
302
  )
303
  );
304
 
305
  $GLOBALS["gtm4wp_blacklistmfieldtexts"] = array(
306
  GTM4WP_OPTION_BLACKLIST_MACRO_DOMELEMENT => array(
307
- "label" => __( "DOM element Macro", GTM4WP_TEXTDOMAIN ),
308
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
309
  "phase" => GTM4WP_PHASE_STABLE
310
  ),
311
  GTM4WP_OPTION_BLACKLIST_MACRO_CUSTOMJS => array(
312
- "label" => __( "Custom JavaScript Macro", GTM4WP_TEXTDOMAIN ),
313
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
314
  "phase" => GTM4WP_PHASE_STABLE
315
  ),
316
  GTM4WP_OPTION_BLACKLIST_MACRO_CONSTANT => array(
317
- "label" => __( "Constant Macro", GTM4WP_TEXTDOMAIN ),
318
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
319
  "phase" => GTM4WP_PHASE_STABLE
320
  ),
321
  GTM4WP_OPTION_BLACKLIST_MACRO_1STCOOKIE => array(
322
- "label" => __( "First Party Cookie Macro", GTM4WP_TEXTDOMAIN ),
323
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
324
  "phase" => GTM4WP_PHASE_STABLE
325
  ),
326
  GTM4WP_OPTION_BLACKLIST_MACRO_EVENTNAME => array(
327
- "label" => __( "Event Name Macro", GTM4WP_TEXTDOMAIN ),
328
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
329
  "phase" => GTM4WP_PHASE_STABLE
330
  ),
331
  GTM4WP_OPTION_BLACKLIST_MACRO_JSVAR => array(
332
- "label" => __( "JavaScript Variable Macro", GTM4WP_TEXTDOMAIN ),
333
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
334
  "phase" => GTM4WP_PHASE_STABLE
335
  ),
336
  GTM4WP_OPTION_BLACKLIST_MACRO_DLAYERVAR => array(
337
- "label" => __( "DataLayer Variable Macro", GTM4WP_TEXTDOMAIN ),
338
- "description" => __( "It is not recommended to blacklist this type of macro since most features of this plugin depend on dataLayer macros.", GTM4WP_TEXTDOMAIN ),
339
  "phase" => GTM4WP_PHASE_STABLE
340
  ),
341
  GTM4WP_OPTION_BLACKLIST_MACRO_RANDOMNUM => array(
342
- "label" => __( "Random Number Macro", GTM4WP_TEXTDOMAIN ),
343
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
344
  "phase" => GTM4WP_PHASE_STABLE
345
  ),
346
  GTM4WP_OPTION_BLACKLIST_MACRO_REFERRER => array(
347
- "label" => __( "Referrer Macro", GTM4WP_TEXTDOMAIN ),
348
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
349
  "phase" => GTM4WP_PHASE_STABLE
350
  ),
351
  GTM4WP_OPTION_BLACKLIST_MACRO_URL => array(
352
- "label" => __( "URL Macro", GTM4WP_TEXTDOMAIN ),
353
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
354
  "phase" => GTM4WP_PHASE_STABLE
355
  ),
356
  GTM4WP_OPTION_BLACKLIST_MACRO_AUTOEVENT => array(
357
- "label" => __( "Auto-Event Variable Macro", GTM4WP_TEXTDOMAIN ),
358
- "description" => __( "", GTM4WP_TEXTDOMAIN ),
359
  "phase" => GTM4WP_PHASE_STABLE
360
  )
361
  );
362
 
363
  $GLOBALS["gtm4wp_integratefieldtexts"] = array(
364
  GTM4WP_OPTION_INTEGRATE_WPCF7 => array(
365
- "label" => __( "Contact Form 7", GTM4WP_TEXTDOMAIN ),
366
- "description" => __( "Check this to include a dataLayer event after a successfull form submission.", GTM4WP_TEXTDOMAIN ),
367
  "phase" => GTM4WP_PHASE_STABLE,
368
  "plugintocheck" => "contact-form-7/wp-contact-form-7.php"
369
  ),
370
  /*
371
  GTM4WP_OPTION_INTEGRATE_WOOCOMMERCE => array(
372
- "label" => __( "WooCommerce", GTM4WP_TEXTDOMAIN ),
373
- "description" => __( "Enable this and you will get:<br /> - Add-to-cart events<br /> - E-commerce transaction data ready to be used with Google Analytics and Universal Analytics tags<br /> - Google AdWords dynamic remarketing tags", GTM4WP_TEXTDOMAIN ),
374
  "plugintocheck" => "woocommerce/woocommerce.php"
375
  )
376
  */
377
  GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC => array(
378
- "label" => __( "Track classic e-commerce", GTM4WP_TEXTDOMAIN ),
379
- "description" => __( sprintf( __( "Choose this option if you would like to track e-commerce data using <a href=\"%s\" target=\"_blank\">classic transaction data</a>.", GTM4WP_TEXTDOMAIN ) , 'https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce'), GTM4WP_TEXTDOMAIN ),
380
  "phase" => GTM4WP_PHASE_STABLE,
381
  "plugintocheck" => "woocommerce/woocommerce.php"
382
  ),
383
  GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC => array(
384
- "label" => __( "Track enhanced e-commerce", GTM4WP_TEXTDOMAIN ),
385
- "description" => __( sprintf( __( "Choose this option if you would like to track e-commerce data using <a href=\"%s\" target=\"_blank\">enhanced ecommerce tracking</a>.", GTM4WP_TEXTDOMAIN ) , 'https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce'), GTM4WP_TEXTDOMAIN ),
386
  "phase" => GTM4WP_PHASE_BETA,
387
  "plugintocheck" => "woocommerce/woocommerce.php"
388
  ),
389
  GTM4WP_OPTION_INTEGRATE_WCREMARKETING => array(
390
- "label" => __( "AdWords Remarketing", GTM4WP_TEXTDOMAIN ),
391
- "description" => __( "Enable this to add Google AdWords dynamic remarketing variables to the dataLayer", GTM4WP_TEXTDOMAIN ),
392
  "phase" => GTM4WP_PHASE_STABLE,
393
  "plugintocheck" => "woocommerce/woocommerce.php"
394
  ),
395
  GTM4WP_OPTION_INTEGRATE_WCREMARKETINGSKU => array(
396
- "label" => __( "Use SKU instead of ID", GTM4WP_TEXTDOMAIN ),
397
- "description" => __( "Check this to use product SKU in the dynamic remarketing variables instead of the ID of the products. Will fallback to ID if no SKU is set.", GTM4WP_TEXTDOMAIN ),
398
  "phase" => GTM4WP_PHASE_EXPERIMENTAL,
399
  "plugintocheck" => "woocommerce/woocommerce.php"
400
  )
@@ -405,62 +405,62 @@ function gtm4wp_admin_output_section( $args ) {
405
 
406
  switch( $args["id"] ) {
407
  case GTM4WP_ADMIN_GROUP_GENERAL: {
408
- _e( 'This plugin is intended to be used by IT guys and marketing staff. Please be sure you read the <a href="https://developers.google.com/tag-manager/" target="_blank">Google Tag Manager Help Center</a> before you start using this plugin.<br /><br />', GTM4WP_TEXTDOMAIN );
409
 
410
  break;
411
  }
412
 
413
  case GTM4WP_ADMIN_GROUP_INCLUDES: {
414
- _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", GTM4WP_TEXTDOMAIN );
415
  echo "<br />";
416
- printf( __( '* Browser, OS and Device data is provided using <a href="%s">WhichBrowser</a> library.', GTM4WP_TEXTDOMAIN ), "http://whichbrowser.net/" );
417
 
418
  break;
419
  }
420
 
421
  case GTM4WP_ADMIN_GROUP_EVENTS: {
422
- _e( "Fire tags in Google Tag Manager on special events on your website", GTM4WP_TEXTDOMAIN );
423
  echo '<p style="font-weight: bold;">';
424
- _e( 'In October 2013 Google released a new feature called <a href="https://support.google.com/tagmanager/answer/3415369?hl=en" target="_blank">auto event tracking</a>. It is up to you how you use click events either using Google\'s solution or the settings below.', GTM4WP_TEXTDOMAIN );
425
  echo '</p>';
426
 
427
  break;
428
  }
429
 
430
  case GTM4WP_ADMIN_GROUP_SCROLLER: {
431
- _e( "Fire tags based on how the visitor scrolls through your page.", GTM4WP_TEXTDOMAIN );
432
  echo '<br />';
433
- printf( __( 'Based on the script originaly posted to <a href="%s">Analytics Talk</a>', GTM4WP_TEXTDOMAIN ) , "http://cutroni.com/blog/2012/02/21/advanced-content-tracking-with-google-analytics-part-1/");
434
 
435
  break;
436
  }
437
 
438
  case GTM4WP_ADMIN_GROUP_BLACKLIST: {
439
- _e( "Here you can control which types of tags and macros 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!", GTM4WP_TEXTDOMAIN );
440
  echo '<br />';
441
- _e( "Do not modify if you do not know what to do since it can cause issues in your tag deployment!", GTM4WP_TEXTDOMAIN );
442
  echo '<br />';
443
- _e( "Blacklisting of macros only work if you enable blacklist or whilelist of tags on the previous tab.", GTM4WP_TEXTDOMAIN );
444
  echo '<br />';
445
- _e( "Uncheck a row to blacklist a macro type.", GTM4WP_TEXTDOMAIN );
446
 
447
  break;
448
  }
449
 
450
  case GTM4WP_ADMIN_GROUP_INTEGRATION: {
451
- _e( "Google Tag Manager for WordPress can integrate with several popular plugins. Please check the plugins you would like to integrate with:", GTM4WP_TEXTDOMAIN );
452
 
453
  break;
454
  }
455
 
456
  case GTM4WP_ADMIN_GROUP_ADVANCED: {
457
- _e( "You usually do not need to modify thoose settings. Please be carefull while hacking here.", GTM4WP_TEXTDOMAIN );
458
 
459
  break;
460
  }
461
 
462
  case GTM4WP_ADMIN_GROUP_CREDITS: {
463
- _e( "Some info about the author of this plugin", GTM4WP_TEXTDOMAIN );
464
 
465
  break;
466
  }
@@ -475,38 +475,38 @@ function gtm4wp_admin_output_field( $args ) {
475
  switch( $args["label_for"] ) {
476
  case GTM4WP_ADMIN_GROUP_GTMID: {
477
  echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']" value="' . $gtm4wp_options[GTM4WP_OPTION_GTM_CODE] . '" /><br />' . $args["description"];
478
- echo '<br /><span class="gtmid_validation_error">' . __( "This does not seems to be a valid Google Tag Manager ID! Please check and try again", GTM4WP_TEXTDOMAIN ) . '</span>';
479
 
480
  break;
481
  }
482
 
483
  case GTM4WP_ADMIN_GROUP_PLACEMENT: {
484
- echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']_' . GTM4WP_PLACEMENT_FOOTER . '" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']" value="' . GTM4WP_PLACEMENT_FOOTER . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_FOOTER ? 'checked="checked"' : '' ) . '/> ' . __( "Footer of the page (not recommended by Google, no tweak in your template required)", GTM4WP_TEXTDOMAIN ) . '<br />';
485
- echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']_' . GTM4WP_PLACEMENT_BODYOPEN . '" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']" value="' . GTM4WP_PLACEMENT_BODYOPEN . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_BODYOPEN ? 'checked="checked"' : '' ) . '/> ' . __( "Custom (needs tweak in your template)", GTM4WP_TEXTDOMAIN ) . '<br />';
486
- echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']_' . GTM4WP_PLACEMENT_BODYOPEN_AUTO . '" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']" value="' . GTM4WP_PLACEMENT_BODYOPEN_AUTO . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_BODYOPEN_AUTO ? 'checked="checked"' : '' ) . '/> ' . __( "Codeless injection (no tweak, right placement but experimental, could break your frontend)", GTM4WP_TEXTDOMAIN ) . '<br /><br />' . $args["description"];
487
 
488
  break;
489
  }
490
 
491
  case GTM4WP_ADMIN_GROUP_DATALAYER: {
492
  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"];
493
- echo '<br /><span class="datalayername_validation_error">' . __( "This does not seems to be a valid JavaScript variable name! Please check and try again", GTM4WP_TEXTDOMAIN ) . '</span>';
494
 
495
  break;
496
  }
497
 
498
  case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_BLACKLIST_ENABLE . "]": {
499
- 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", GTM4WP_TEXTDOMAIN ) . '<br />';
500
- 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 below (blacklist)", GTM4WP_TEXTDOMAIN ) . '<br />';
501
- 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 below (whitelist)", GTM4WP_TEXTDOMAIN ) . '<br />';
502
  echo $args["description"];
503
 
504
  break;
505
  }
506
 
507
  case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . "]": {
508
- 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", GTM4WP_TEXTDOMAIN ) . '<br />';
509
- 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", GTM4WP_TEXTDOMAIN ) . '<br />';
510
  echo $args["description"];
511
 
512
  break;
@@ -532,9 +532,9 @@ function gtm4wp_admin_output_field( $args ) {
532
 
533
  if ( isset( $args["plugintocheck"] ) ) {
534
  if ( is_plugin_active( $args["plugintocheck"] ) ) {
535
- echo "<br />" . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recomment to enable this integration!', GTM4WP_TEXTDOMAIN );
536
  } else {
537
- echo "<br />" . __( 'This plugin is <strong class="gtm4wp-plugin-not-active">not active</strong>, enabling this integration could cause issues on frontend!', GTM4WP_TEXTDOMAIN );
538
  }
539
  }
540
 
@@ -546,9 +546,9 @@ function gtm4wp_admin_output_field( $args ) {
546
 
547
  if ( isset( $args["plugintocheck"] ) ) {
548
  if ( is_plugin_active( $args["plugintocheck"] ) ) {
549
- echo "<br />" . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recomment to enable this integration!', GTM4WP_TEXTDOMAIN );
550
  } else {
551
- echo "<br />" . __( 'This plugin is <strong class="gtm4wp-plugin-not-active">not active</strong>, enabling this integration could cause issues on frontend!', GTM4WP_TEXTDOMAIN );
552
  }
553
  }
554
 
@@ -606,11 +606,23 @@ function gtm4wp_sanitize_options($options) {
606
  } else if ( ( $optionname == GTM4WP_OPTION_GTM_CODE ) || ( $optionname == GTM4WP_OPTION_DATALAYER_NAME ) ) {
607
  $newoptionvalue = trim($newoptionvalue);
608
 
609
- if ( ( $optionname == GTM4WP_OPTION_GTM_CODE ) && ( ! preg_match( "/^GTM-[A-Z0-9]+$/", $newoptionvalue ) ) ) {
610
- add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']', __( "Invalid Google Tag Manager ID. Valid ID format: GTM-XXXXX", GTM4WP_TEXTDOMAIN ) );
 
 
 
 
 
 
 
611
 
 
 
 
 
 
612
  } else if ( ( $optionname == GTM4WP_OPTION_DATALAYER_NAME ) && ( $newoptionvalue != "" ) && ( ! preg_match( "/^[a-zA-Z][a-zA-Z0-9_-]*$/", $newoptionvalue ) ) ) {
613
- 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 '-'!", GTM4WP_TEXTDOMAIN ) );
614
 
615
  } else {
616
  $output[$optionname] = $newoptionvalue;
@@ -659,38 +671,38 @@ function gtm4wp_admin_init() {
659
 
660
  add_settings_section(
661
  GTM4WP_ADMIN_GROUP_GENERAL,
662
- __( 'General', GTM4WP_TEXTDOMAIN ),
663
  'gtm4wp_admin_output_section',
664
  GTM4WP_ADMINSLUG
665
  );
666
 
667
  add_settings_field(
668
  GTM4WP_ADMIN_GROUP_GTMID,
669
- __( 'Google Tag Manager ID', GTM4WP_TEXTDOMAIN ),
670
  'gtm4wp_admin_output_field',
671
  GTM4WP_ADMINSLUG,
672
  GTM4WP_ADMIN_GROUP_GENERAL,
673
  array(
674
  "label_for" => GTM4WP_ADMIN_GROUP_GTMID,
675
- "description" => __( "Enter your Google Tag Manager ID here.", GTM4WP_TEXTDOMAIN )
676
  )
677
  );
678
 
679
  add_settings_field(
680
  GTM4WP_ADMIN_GROUP_PLACEMENT,
681
- __( 'Container code placement', GTM4WP_TEXTDOMAIN ),
682
  'gtm4wp_admin_output_field',
683
  GTM4WP_ADMINSLUG,
684
  GTM4WP_ADMIN_GROUP_GENERAL,
685
  array(
686
  "label_for" => GTM4WP_ADMIN_GROUP_PLACEMENT,
687
- "description" => __( "Select how your container code should be included in your website.<br />If you select 'Custom' you need to edit your template file and add the following line just after the opening &lt;body&gt; tag:<br /><code>&lt;?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?&gt;</code>", GTM4WP_TEXTDOMAIN )
688
  )
689
  );
690
 
691
  add_settings_section(
692
  GTM4WP_ADMIN_GROUP_INCLUDES,
693
- __( 'Basic data', GTM4WP_TEXTDOMAIN ),
694
  'gtm4wp_admin_output_section',
695
  GTM4WP_ADMINSLUG
696
  );
@@ -712,7 +724,7 @@ function gtm4wp_admin_init() {
712
 
713
  add_settings_section(
714
  GTM4WP_ADMIN_GROUP_EVENTS,
715
- __( 'Events', GTM4WP_TEXTDOMAIN ),
716
  'gtm4wp_admin_output_section',
717
  GTM4WP_ADMINSLUG
718
  );
@@ -734,7 +746,7 @@ function gtm4wp_admin_init() {
734
 
735
  add_settings_section(
736
  GTM4WP_ADMIN_GROUP_SCROLLER,
737
- __( 'Scroll tracking', GTM4WP_TEXTDOMAIN ),
738
  'gtm4wp_admin_output_section',
739
  GTM4WP_ADMINSLUG
740
  );
@@ -756,7 +768,7 @@ function gtm4wp_admin_init() {
756
 
757
  add_settings_section(
758
  GTM4WP_ADMIN_GROUP_BLACKLIST,
759
- __( 'Blacklist tags', GTM4WP_TEXTDOMAIN ),
760
  'gtm4wp_admin_output_section',
761
  GTM4WP_ADMINSLUG
762
  );
@@ -793,7 +805,7 @@ function gtm4wp_admin_init() {
793
 
794
  add_settings_section(
795
  GTM4WP_ADMIN_GROUP_INTEGRATION,
796
- __( 'Integration', GTM4WP_TEXTDOMAIN ),
797
  'gtm4wp_admin_output_section',
798
  GTM4WP_ADMINSLUG
799
  );
@@ -816,33 +828,33 @@ function gtm4wp_admin_init() {
816
 
817
  add_settings_section(
818
  GTM4WP_ADMIN_GROUP_ADVANCED,
819
- __( 'Advanced', GTM4WP_TEXTDOMAIN ),
820
  'gtm4wp_admin_output_section',
821
  GTM4WP_ADMINSLUG
822
  );
823
 
824
  add_settings_field(
825
  GTM4WP_ADMIN_GROUP_DATALAYER,
826
- __( 'dataLayer variable name', GTM4WP_TEXTDOMAIN ),
827
  'gtm4wp_admin_output_field',
828
  GTM4WP_ADMINSLUG,
829
  GTM4WP_ADMIN_GROUP_ADVANCED,
830
  array(
831
  "label_for" => GTM4WP_ADMIN_GROUP_DATALAYER,
832
- "description" => __( "In some cases you need to rename the dataLayer variable. You can enter your name here. Leave black for default name: dataLayer", GTM4WP_TEXTDOMAIN )
833
  )
834
  );
835
 
836
  add_settings_section(
837
  GTM4WP_ADMIN_GROUP_CREDITS,
838
- __( 'Credits', GTM4WP_TEXTDOMAIN ),
839
  'gtm4wp_admin_output_section',
840
  GTM4WP_ADMINSLUG
841
  );
842
 
843
  add_settings_field(
844
  GTM4WP_ADMIN_GROUP_INFO,
845
- __( 'Author', GTM4WP_TEXTDOMAIN ),
846
  'gtm4wp_admin_output_field',
847
  GTM4WP_ADMINSLUG,
848
  GTM4WP_ADMIN_GROUP_CREDITS,
@@ -867,7 +879,7 @@ function gtm4wp_show_admin_page() {
867
  ?>
868
  <div class="wrap">
869
  <div id="gtm4wp-icon" class="icon32" style="background-image: url(<?php echo $gtp4wp_plugin_url; ?>admin/images/tag_manager-32.png);"><br /></div>
870
- <h2><?php _e( 'Google Tag Manager for WordPress options', GTM4WP_TEXTDOMAIN ); ?></h2>
871
  <form action="options.php" method="post">
872
  <?php settings_fields( GTM4WP_ADMIN_GROUP ); ?>
873
  <?php do_settings_sections( GTM4WP_ADMINSLUG ); ?>
@@ -880,8 +892,8 @@ function gtm4wp_show_admin_page() {
880
 
881
  function gtm4wp_add_admin_page() {
882
  add_options_page(
883
- __( 'Google Tag Manager for WordPress settings', GTM4WP_TEXTDOMAIN ),
884
- __( 'Google Tag Manager', GTM4WP_TEXTDOMAIN ),
885
  'manage_options',
886
  GTM4WP_ADMINSLUG,
887
  'gtm4wp_show_admin_page'
@@ -895,19 +907,19 @@ function gtm4wp_add_admin_js($hook) {
895
  wp_register_script( "admin-subtabs", $gtp4wp_plugin_url . "js/admin-subtabs.js" );
896
 
897
  $subtabtexts = array(
898
- "posttabtitle" => __( "Posts" , GTM4WP_TEXTDOMAIN ),
899
- "searchtabtitle" => __( "Search" , GTM4WP_TEXTDOMAIN ),
900
- "visitortabtitle" => __( "Visitors" , GTM4WP_TEXTDOMAIN ),
901
- "adwordstabtitle" => __( "AdWords" , GTM4WP_TEXTDOMAIN ),
902
- "browsertabtitle" => __( "Browser/OS/Device" , GTM4WP_TEXTDOMAIN ),
903
- "blocktagstabtitle" => __( "Blacklist tags" , GTM4WP_TEXTDOMAIN ),
904
- "blockmacrostabtitle" => __( "Blacklist macros" , GTM4WP_TEXTDOMAIN ),
905
- "wpcf7tabtitle" => __( "Contact Form 7" , GTM4WP_TEXTDOMAIN ),
906
- "wctabtitle" => __( "WooCommerce" , GTM4WP_TEXTDOMAIN ),
907
- "weathertabtitle" => __( "Weather data" , GTM4WP_TEXTDOMAIN ),
908
- "generaleventstabtitle" => __( "General events" , GTM4WP_TEXTDOMAIN ),
909
- "mediaeventstabtitle" => __( "Media events" , GTM4WP_TEXTDOMAIN ),
910
- "depecratedeventstabtitle" => __( "Depecrated" , GTM4WP_TEXTDOMAIN )
911
  );
912
  wp_localize_script( "admin-subtabs", 'gtm4wp', $subtabtexts );
913
  wp_enqueue_script( "admin-subtabs" );
@@ -933,7 +945,14 @@ function gtm4wp_admin_head() {
933
  jQuery( "#gtm4wp-options\\\\[gtm-code\\\\]" )
934
  .bind( "blur", function() {
935
  var gtmid_regex = /^GTM-[A-Z0-9]+$/;
936
- if ( ! gtmid_regex.test( jQuery( this ).val() ) ) {
 
 
 
 
 
 
 
937
  jQuery( ".gtmid_validation_error" )
938
  .show();
939
  } else {
@@ -959,7 +978,7 @@ function gtm4wp_admin_head() {
959
  }
960
  });
961
 
962
- jQuery( ".dismiss-notice" )
963
  .bind( "click", function( e ) {
964
  e.preventDefault();
965
 
@@ -969,7 +988,7 @@ function gtm4wp_admin_head() {
969
  .attr( "href" )
970
  .substring( 1 )
971
  }, function ( response ) {
972
- jQuery( ".dismiss-notice" )
973
  .parent()
974
  .parent()
975
  .fadeOut( "slow" );
@@ -995,7 +1014,7 @@ function gtm4wp_show_warning() {
995
  $gtm4wp_user_notices_dismisses = array_merge( $gtm4wp_def_user_notices_dismisses, $gtm4wp_user_notices_dismisses );
996
 
997
  if ( ( trim( $gtm4wp_options[GTM4WP_OPTION_GTM_CODE] ) == "" ) && ( false === $gtm4wp_user_notices_dismisses["enter-gtm-code"] ) ) {
998
- echo '<div id="message" class="error"><p><strong>' . sprintf( __( 'To start using Google Tag Manager for WordPress, please <a href="%s">enter your GTM ID</a>', GTM4WP_TEXTDOMAIN ), "options-general.php?page=" . GTM4WP_ADMINSLUG ) . '</strong> | <a href="?enter-gtm-code" class="dismiss-notice">' . __( 'Dismiss', GTM4WP_TEXTDOMAIN ) . '</a></p></div>';
999
  }
1000
 
1001
  if ( ( false === $gtm4wp_user_notices_dismisses["wc-ga-plugin-warning"] ) || ( false === $gtm4wp_user_notices_dismisses["wc-gayoast-plugin-warning"] ) ) {
@@ -1007,17 +1026,17 @@ function gtm4wp_show_warning() {
1007
  $woo_ga_options = get_option( "woocommerce_google_analytics_settings" );
1008
  if ( $woo_ga_options ) {
1009
  if ( "" != $woo_ga_options["ga_id"] ) {
1010
- echo '<div id="message" class="error"><p><strong>' . __( 'Notice: you should disable Google Analytics tracking <a href="admin.php?page=woocommerce_settings&tab=integration&section=google_analytics">in WooCommerce settings</a> by leaving Google Analytics ID field empty if you are using Google Analytics tags inside Google Tag Manager!', GTM4WP_TEXTDOMAIN ) . '</strong> | <a href="?wc-ga-plugin-warning" class="dismiss-notice">' . __( 'Dismiss', GTM4WP_TEXTDOMAIN ) . '</a></p></div>';
1011
  }
1012
  }
1013
  }
1014
 
1015
  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" ) ) {
1016
- echo '<div id="message" class="error"><p><strong>' . __( 'Notice: you should deactivate the plugin "WooCommerce Google Analytics Integration" if you are using Google Analytics tags inside Google Tag Manager!', GTM4WP_TEXTDOMAIN ) . '</strong> | <a href="?wc-ga-plugin-warning" class="dismiss-notice">' . __( 'Dismiss', GTM4WP_TEXTDOMAIN ) . '</a></p></div>';
1017
  }
1018
 
1019
  if ( ( false === $gtm4wp_user_notices_dismisses["wc-gayoast-plugin-warning"] ) && $is_wc_active && is_plugin_active( "google-analytics-for-wordpress/googleanalytics.php" ) ) {
1020
- echo '<div id="message" class="error"><p><strong>' . __( 'Notice: you should deactivate the plugin "Google Analytics for WordPress by Yoast" if you are using Google Analytics tags inside Google Tag Manager!', GTM4WP_TEXTDOMAIN ) . '</strong> | <a href="?wc-gayoast-plugin-warning" class="dismiss-notice">' . __( 'Dismiss', GTM4WP_TEXTDOMAIN ) . '</a></p></div>';
1021
  }
1022
  }
1023
  }
32
 
33
  $GLOBALS["gtm4wp_includefieldtexts"] = array(
34
  GTM4WP_OPTION_INCLUDE_POSTTYPE => array(
35
+ "label" => __( "Posttype of current post/archive", 'duracelltomi-google-tag-manager' ),
36
+ "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' ),
37
  "phase" => GTM4WP_PHASE_STABLE
38
  ),
39
  GTM4WP_OPTION_INCLUDE_CATEGORIES => array(
40
+ "label" => __( "Category list of current post/archive", 'duracelltomi-google-tag-manager' ),
41
+ "description" => __( "Check this option to include the category names of the current post or archive page", 'duracelltomi-google-tag-manager' ),
42
  "phase" => GTM4WP_PHASE_STABLE
43
  ),
44
  GTM4WP_OPTION_INCLUDE_TAGS => array(
45
+ "label" => __( "Tags of current post", 'duracelltomi-google-tag-manager' ),
46
+ "description" => __( "Check this option to include the tags of the current post.", 'duracelltomi-google-tag-manager' ),
47
  "phase" => GTM4WP_PHASE_STABLE
48
  ),
49
  GTM4WP_OPTION_INCLUDE_AUTHOR => array(
50
+ "label" => __( "Post author name", 'duracelltomi-google-tag-manager' ),
51
+ "description" => __( "Check this option to include the author's name of the current post or author page.", 'duracelltomi-google-tag-manager' ),
52
  "phase" => GTM4WP_PHASE_STABLE
53
  ),
54
  GTM4WP_OPTION_INCLUDE_POSTDATE => array(
55
+ "label" => __( "Post date", 'duracelltomi-google-tag-manager' ),
56
+ "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' ),
57
  "phase" => GTM4WP_PHASE_STABLE
58
  ),
59
  GTM4WP_OPTION_INCLUDE_POSTTITLE => array(
60
+ "label" => __( "Post title", 'duracelltomi-google-tag-manager' ),
61
+ "description" => __( "Check this option to include the title of the current post.", 'duracelltomi-google-tag-manager' ),
62
  "phase" => GTM4WP_PHASE_STABLE
63
  ),
64
  GTM4WP_OPTION_INCLUDE_POSTCOUNT => array(
65
+ "label" => __( "Post count", 'duracelltomi-google-tag-manager' ),
66
+ "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' ),
67
  "phase" => GTM4WP_PHASE_STABLE
68
  ),
69
  GTM4WP_OPTION_INCLUDE_SEARCHDATA => array(
70
+ "label" => __( "Search data", 'duracelltomi-google-tag-manager' ),
71
+ "description" => __( "Check this option to include the search term, referring page URL and number of results on the search page.", 'duracelltomi-google-tag-manager' ),
72
  "phase" => GTM4WP_PHASE_STABLE
73
  ),
74
  GTM4WP_OPTION_INCLUDE_LOGGEDIN => array(
75
+ "label" => __( "Logged in status", 'duracelltomi-google-tag-manager' ),
76
+ "description" => __( "Check this option to include whether there is a logged in user on your website.", 'duracelltomi-google-tag-manager' ),
77
  "phase" => GTM4WP_PHASE_STABLE
78
  ),
79
  GTM4WP_OPTION_INCLUDE_USERROLE => array(
80
+ "label" => __( "Logged in user role", 'duracelltomi-google-tag-manager' ),
81
+ "description" => __( "Check this option to include the role of the logged in user.", 'duracelltomi-google-tag-manager' ),
82
  "phase" => GTM4WP_PHASE_STABLE
83
  ),
84
  GTM4WP_OPTION_INCLUDE_USERID => array(
85
+ "label" => __( "Logged in user ID", 'duracelltomi-google-tag-manager' ),
86
+ "description" => __( "Check this option to include the ID of the logged in user.", 'duracelltomi-google-tag-manager' ),
87
  "phase" => GTM4WP_PHASE_STABLE
88
  ),
89
  GTM4WP_OPTION_INCLUDE_REMARKETING => array(
90
+ "label" => __( "Remarketing variable", 'duracelltomi-google-tag-manager' ),
91
+ "description" => __( "Check this option to include a dataLayer variable where all dataLayer values are stored to be included in your AdWords remarketing tag as a custom variable field", 'duracelltomi-google-tag-manager' ),
92
  "phase" => GTM4WP_PHASE_STABLE
93
  ),
94
  GTM4WP_OPTION_INCLUDE_BROWSERDATA => array(
95
+ "label" => __( "Browser data *", 'duracelltomi-google-tag-manager' ),
96
+ "description" => __( "Check this option to include the name, version and engine data of the browser the visitor uses.", 'duracelltomi-google-tag-manager' ),
97
  "phase" => GTM4WP_PHASE_BETA
98
  ),
99
  GTM4WP_OPTION_INCLUDE_OSDATA => array(
100
+ "label" => __( "OS data *", 'duracelltomi-google-tag-manager' ),
101
+ "description" => __( "Check this option to include the name and version of the operating system the visitor uses.", 'duracelltomi-google-tag-manager' ),
102
  "phase" => GTM4WP_PHASE_BETA
103
  ),
104
  GTM4WP_OPTION_INCLUDE_DEVICEDATA => array(
105
+ "label" => __( "Device data *", 'duracelltomi-google-tag-manager' ),
106
+ "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' ),
107
  "phase" => GTM4WP_PHASE_BETA
108
  ),
109
  GTM4WP_OPTION_INCLUDE_WEATHER => array(
110
+ "label" => __( "Weather data", 'duracelltomi-google-tag-manager' ),
111
+ "description" => sprintf( __( "Check this option to include the current weather conditions around the current visitor.<br /><strong>Attention!</strong> This feature uses <a href=\"%s\" target=\"_blank\">geoplugin.com</a> and <a href=\"%s\" target=\"_blank\">openweathermap.org</a> to collect data.<br />Depending on your website's traffic, additional fees may apply!<br />This plugin caches weather data for 1 hour to lower the need to access those services.", 'duracelltomi-google-tag-manager' ), "http://www.geoplugin.com/premium?utm_source=gtm4wp&utm_medium=link&utm_campaign=duracelltomi-google-tag-manager-for-wordpress", "http://openweathermap.org/price?utm_source=gtm4wp&utm_medium=link&utm_campaign=duracelltomi-google-tag-manager-for-wordpress" ),
112
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
113
  ),
114
  GTM4WP_OPTION_INCLUDE_WEATHERUNITS => array(
115
+ "label" => __( "Weather data units", 'duracelltomi-google-tag-manager' ),
116
+ "description" => __( "Select which temperature units you would like to use.", 'duracelltomi-google-tag-manager' ),
117
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
118
  )
119
  );
120
 
121
  $GLOBALS["gtm4wp_eventfieldtexts"] = array(
122
  GTM4WP_OPTION_EVENTS_FORMMOVE => array(
123
+ "label" => __( "Form fill events (gtm4wp.formElementEnter & gtm4wp.formElementLeave)", 'duracelltomi-google-tag-manager' ),
124
+ "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' ),
125
  "phase" => GTM4WP_PHASE_STABLE
126
  ),
127
  GTM4WP_OPTION_EVENTS_SOCIAL => array(
128
+ "label" => __( "Social actions (gtm4wp.socialAction)", 'duracelltomi-google-tag-manager' ),
129
+ "description" => __( "Check this option to include a Tag Manager event when a visitor uses a social button to share/like content on a social network.", 'duracelltomi-google-tag-manager' ),
130
  "phase" => GTM4WP_PHASE_STABLE
131
  ),
132
  GTM4WP_OPTION_EVENTS_YOUTUBE => array(
133
+ "label" => __( "YouTube video events", 'duracelltomi-google-tag-manager' ),
134
+ "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' ),
135
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
136
  ),
137
  GTM4WP_OPTION_EVENTS_VIMEO => array(
138
+ "label" => __( "Vimeo video events", 'duracelltomi-google-tag-manager' ),
139
+ "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' ),
140
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
141
  ),
142
  GTM4WP_OPTION_EVENTS_SOUNDCLOUD => array(
143
+ "label" => __( "Soundcloud events", 'duracelltomi-google-tag-manager' ),
144
+ "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' ),
145
  "phase" => GTM4WP_PHASE_EXPERIMENTAL
146
  ),
147
  GTM4WP_OPTION_EVENTS_OUTBOUND => array(
148
+ "label" => __( "Outbound link click events (gtm4wp.outboundClick)", 'duracelltomi-google-tag-manager' ),
149
+ "description" => __( "Check this option to include a Tag Manager event when a visitor clicks on a link directing the visitor out of your website.", 'duracelltomi-google-tag-manager' ),
150
  "phase" => GTM4WP_PHASE_DEPRECATED
151
  ),
152
  GTM4WP_OPTION_EVENTS_DOWNLOADS => array(
153
+ "label" => __( "Download click events (gtm4wp.downloadClick)", 'duracelltomi-google-tag-manager' ),
154
+ "description" => __( "Check this option to include a Tag Manager event when a visitors clicks on a link that leads to a downloadable file on your website.", 'duracelltomi-google-tag-manager' ),
155
  "phase" => GTM4WP_PHASE_DEPRECATED
156
  ),
157
  GTM4WP_OPTION_EVENTS_DWLEXT => array(
158
+ "label" => __( "Extensions to track", 'duracelltomi-google-tag-manager' ),
159
+ "description" => __( "Enter a comma separated list of extensions to track when 'Include download click events' option is set.", 'duracelltomi-google-tag-manager' ),
160
  "phase" => GTM4WP_PHASE_DEPRECATED
161
  ),
162
  GTM4WP_OPTION_EVENTS_EMAILCLICKS => array(
163
+ "label" => __( "Email click events (gtm4wp.emailClick)", 'duracelltomi-google-tag-manager' ),
164
+ "description" => __( "Check this option to include a Tag Manager event when a visitor clicks on an email link.", 'duracelltomi-google-tag-manager' ),
165
  "phase" => GTM4WP_PHASE_DEPRECATED
166
  )
167
  );
168
 
169
  $GLOBALS["gtm4wp_scrollerfieldtexts"] = array(
170
  GTM4WP_OPTION_SCROLLER_ENABLED => array(
171
+ "label" => __( "Enabled", 'duracelltomi-google-tag-manager' ),
172
+ "description" => __( "Enable scroll tracker script on your website.", 'duracelltomi-google-tag-manager' ),
173
  "phase" => GTM4WP_PHASE_STABLE
174
  ),
175
  GTM4WP_OPTION_SCROLLER_DEBUGMODE => array(
176
+ "label" => __( "Debug mode", 'duracelltomi-google-tag-manager' ),
177
+ "description" => __( "Fire console.log() commands instead of dataLayer events.", 'duracelltomi-google-tag-manager' ),
178
  "phase" => GTM4WP_PHASE_STABLE
179
  ),
180
  GTM4WP_OPTION_SCROLLER_CALLBACKTIME => array(
181
+ "label" => __( "Time delay before location check", 'duracelltomi-google-tag-manager' ),
182
+ "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' ),
183
  "phase" => GTM4WP_PHASE_STABLE
184
  ),
185
  GTM4WP_OPTION_SCROLLER_DISTANCE => array(
186
+ "label" => __( "Minimum distance", 'duracelltomi-google-tag-manager' ),
187
+ "description" => __( "The minimum amount of pixels that a visitor has to scroll before we treat the move as scrolling.", 'duracelltomi-google-tag-manager' ),
188
  "phase" => GTM4WP_PHASE_STABLE
189
  ),
190
  GTM4WP_OPTION_SCROLLER_CONTENTID => array(
191
+ "label" => __( "Content ID", 'duracelltomi-google-tag-manager' ),
192
+ "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' ),
193
  "phase" => GTM4WP_PHASE_STABLE
194
  ),
195
  GTM4WP_OPTION_SCROLLER_READERTIME => array(
196
+ "label" => __( "Scroller time", 'duracelltomi-google-tag-manager' ),
197
+ "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' ),
198
  "phase" => GTM4WP_PHASE_STABLE
199
  )
200
  );
201
 
202
  $GLOBALS["gtm4wp_blacklistfieldtexts"] = array(
203
  GTM4WP_OPTION_BLACKLIST_ENABLE => array(
204
+ "label" => __( "Enable blacklist/whitelist", 'duracelltomi-google-tag-manager' ),
205
+ "description" => __( "Disable feature or select whether you want to whitelist or blacklist tags", 'duracelltomi-google-tag-manager' ),
206
  "phase" => GTM4WP_PHASE_STABLE
207
  ),
208
  GTM4WP_OPTION_BLACKLIST_AWCONV => array(
209
+ "label" => __( "AdWords Conversion Tracking Tag", 'duracelltomi-google-tag-manager' ),
210
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
211
  "phase" => GTM4WP_PHASE_STABLE
212
  ),
213
  GTM4WP_OPTION_BLACKLIST_AWREMARKET => array(
214
+ "label" => __( "AdWords Remarketing Tag", 'duracelltomi-google-tag-manager' ),
215
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
216
  "phase" => GTM4WP_PHASE_STABLE
217
  ),
218
  GTM4WP_OPTION_BLACKLIST_GACLASSIC => array(
219
+ "label" => __( "Google Analytics Tag", 'duracelltomi-google-tag-manager' ),
220
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
221
  "phase" => GTM4WP_PHASE_STABLE
222
  ),
223
  GTM4WP_OPTION_BLACKLIST_UA => array(
224
+ "label" => __( "Universal Analytics Tag", 'duracelltomi-google-tag-manager' ),
225
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
226
  "phase" => GTM4WP_PHASE_STABLE
227
  ),
228
  GTM4WP_OPTION_BLACKLIST_ADADVISOR => array(
229
+ "label" => __( "AdAdvisor Tag", 'duracelltomi-google-tag-manager' ),
230
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
231
  "phase" => GTM4WP_PHASE_STABLE
232
  ),
233
  GTM4WP_OPTION_BLACKLIST_ADROLL => array(
234
+ "label" => __( "AdRoll Smart Pixel Tag", 'duracelltomi-google-tag-manager' ),
235
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
236
  "phase" => GTM4WP_PHASE_STABLE
237
  ),
238
  GTM4WP_OPTION_BLACKLIST_BIZO => array(
239
+ "label" => __( "Bizo Insight Tag", 'duracelltomi-google-tag-manager' ),
240
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
241
  "phase" => GTM4WP_PHASE_STABLE
242
  ),
243
  GTM4WP_OPTION_BLACKLIST_CLICKTALE => array(
244
+ "label" => __( "ClickTale Standard Tracking Tag", 'duracelltomi-google-tag-manager' ),
245
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
246
  "phase" => GTM4WP_PHASE_STABLE
247
  ),
248
  GTM4WP_OPTION_BLACKLIST_COMSCORE => array(
249
+ "label" => __( "comScore Unified Digital Measurement Tag", 'duracelltomi-google-tag-manager' ),
250
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
251
  "phase" => GTM4WP_PHASE_STABLE
252
  ),
253
  GTM4WP_OPTION_BLACKLIST_CUSTOMHTML => array(
254
+ "label" => __( "Custom HTML Tag", 'duracelltomi-google-tag-manager' ),
255
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
256
  "phase" => GTM4WP_PHASE_STABLE
257
  ),
258
  GTM4WP_OPTION_BLACKLIST_CUSTOMIMG => array(
259
+ "label" => __( "Custom Image Tag", 'duracelltomi-google-tag-manager' ),
260
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
261
  "phase" => GTM4WP_PHASE_STABLE
262
  ),
263
  GTM4WP_OPTION_BLACKLIST_DBLCLKCOUNT => array(
264
+ "label" => __( "DoubleClick Floodlight Counter Tag", 'duracelltomi-google-tag-manager' ),
265
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
266
  "phase" => GTM4WP_PHASE_STABLE
267
  ),
268
  GTM4WP_OPTION_BLACKLIST_DBLCLKSALES => array(
269
+ "label" => __( "DoubleClick Floodlight Sales Tag", 'duracelltomi-google-tag-manager' ),
270
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
271
  "phase" => GTM4WP_PHASE_STABLE
272
  ),
273
  GTM4WP_OPTION_BLACKLIST_MARIN => array(
274
+ "label" => __( "Marin Software Tag", 'duracelltomi-google-tag-manager' ),
275
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
276
  "phase" => GTM4WP_PHASE_STABLE
277
  ),
278
  GTM4WP_OPTION_BLACKLIST_MPLEXIFRAME => array(
279
+ "label" => __( "Mediaplex - IFRAME MCT Tag", 'duracelltomi-google-tag-manager' ),
280
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
281
  "phase" => GTM4WP_PHASE_STABLE
282
  ),
283
  GTM4WP_OPTION_BLACKLIST_MPLEXROI => array(
284
+ "label" => __( "Mediaplex - Standard IMG ROI Tag", 'duracelltomi-google-tag-manager' ),
285
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
286
  "phase" => GTM4WP_PHASE_STABLE
287
  ),
288
  GTM4WP_OPTION_BLACKLIST_MEDIA6DEG => array(
289
+ "label" => __( "Media6Degrees Universal Pixel Tag", 'duracelltomi-google-tag-manager' ),
290
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
291
  "phase" => GTM4WP_PHASE_STABLE
292
  ),
293
  GTM4WP_OPTION_BLACKLIST_TURNCONV => array(
294
+ "label" => __( "Turn Conversion Tracking Tag", 'duracelltomi-google-tag-manager' ),
295
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
296
  "phase" => GTM4WP_PHASE_STABLE
297
  ),
298
  GTM4WP_OPTION_BLACKLIST_TURNDATA => array(
299
+ "label" => __( "Turn Data Collection Tag", 'duracelltomi-google-tag-manager' ),
300
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
301
  "phase" => GTM4WP_PHASE_STABLE
302
  )
303
  );
304
 
305
  $GLOBALS["gtm4wp_blacklistmfieldtexts"] = array(
306
  GTM4WP_OPTION_BLACKLIST_MACRO_DOMELEMENT => array(
307
+ "label" => __( "DOM element Macro", 'duracelltomi-google-tag-manager' ),
308
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
309
  "phase" => GTM4WP_PHASE_STABLE
310
  ),
311
  GTM4WP_OPTION_BLACKLIST_MACRO_CUSTOMJS => array(
312
+ "label" => __( "Custom JavaScript Macro", 'duracelltomi-google-tag-manager' ),
313
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
314
  "phase" => GTM4WP_PHASE_STABLE
315
  ),
316
  GTM4WP_OPTION_BLACKLIST_MACRO_CONSTANT => array(
317
+ "label" => __( "Constant Macro", 'duracelltomi-google-tag-manager' ),
318
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
319
  "phase" => GTM4WP_PHASE_STABLE
320
  ),
321
  GTM4WP_OPTION_BLACKLIST_MACRO_1STCOOKIE => array(
322
+ "label" => __( "First Party Cookie Macro", 'duracelltomi-google-tag-manager' ),
323
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
324
  "phase" => GTM4WP_PHASE_STABLE
325
  ),
326
  GTM4WP_OPTION_BLACKLIST_MACRO_EVENTNAME => array(
327
+ "label" => __( "Event Name Macro", 'duracelltomi-google-tag-manager' ),
328
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
329
  "phase" => GTM4WP_PHASE_STABLE
330
  ),
331
  GTM4WP_OPTION_BLACKLIST_MACRO_JSVAR => array(
332
+ "label" => __( "JavaScript Variable Macro", 'duracelltomi-google-tag-manager' ),
333
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
334
  "phase" => GTM4WP_PHASE_STABLE
335
  ),
336
  GTM4WP_OPTION_BLACKLIST_MACRO_DLAYERVAR => array(
337
+ "label" => __( "DataLayer Variable Macro", 'duracelltomi-google-tag-manager' ),
338
+ "description" => __( "It is not recommended to blacklist this type of macro since most features of this plugin depend on dataLayer macros.", 'duracelltomi-google-tag-manager' ),
339
  "phase" => GTM4WP_PHASE_STABLE
340
  ),
341
  GTM4WP_OPTION_BLACKLIST_MACRO_RANDOMNUM => array(
342
+ "label" => __( "Random Number Macro", 'duracelltomi-google-tag-manager' ),
343
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
344
  "phase" => GTM4WP_PHASE_STABLE
345
  ),
346
  GTM4WP_OPTION_BLACKLIST_MACRO_REFERRER => array(
347
+ "label" => __( "Referrer Macro", 'duracelltomi-google-tag-manager' ),
348
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
349
  "phase" => GTM4WP_PHASE_STABLE
350
  ),
351
  GTM4WP_OPTION_BLACKLIST_MACRO_URL => array(
352
+ "label" => __( "URL Macro", 'duracelltomi-google-tag-manager' ),
353
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
354
  "phase" => GTM4WP_PHASE_STABLE
355
  ),
356
  GTM4WP_OPTION_BLACKLIST_MACRO_AUTOEVENT => array(
357
+ "label" => __( "Auto-Event Variable Macro", 'duracelltomi-google-tag-manager' ),
358
+ "description" => __( "", 'duracelltomi-google-tag-manager' ),
359
  "phase" => GTM4WP_PHASE_STABLE
360
  )
361
  );
362
 
363
  $GLOBALS["gtm4wp_integratefieldtexts"] = array(
364
  GTM4WP_OPTION_INTEGRATE_WPCF7 => array(
365
+ "label" => __( "Contact Form 7", 'duracelltomi-google-tag-manager' ),
366
+ "description" => __( "Check this to include a dataLayer event after a successfull form submission.", 'duracelltomi-google-tag-manager' ),
367
  "phase" => GTM4WP_PHASE_STABLE,
368
  "plugintocheck" => "contact-form-7/wp-contact-form-7.php"
369
  ),
370
  /*
371
  GTM4WP_OPTION_INTEGRATE_WOOCOMMERCE => array(
372
+ "label" => __( "WooCommerce", 'duracelltomi-google-tag-manager' ),
373
+ "description" => __( "Enable this and you will get:<br /> - Add-to-cart events<br /> - E-commerce transaction data ready to be used with Google Analytics and Universal Analytics tags<br /> - Google AdWords dynamic remarketing tags", 'duracelltomi-google-tag-manager' ),
374
  "plugintocheck" => "woocommerce/woocommerce.php"
375
  )
376
  */
377
  GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC => array(
378
+ "label" => __( "Track classic e-commerce", 'duracelltomi-google-tag-manager' ),
379
+ "description" => __( sprintf( __( "Choose this option if you would like to track e-commerce data using <a href=\"%s\" target=\"_blank\">classic transaction data</a>.", 'duracelltomi-google-tag-manager' ) , 'https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce'), 'duracelltomi-google-tag-manager' ),
380
  "phase" => GTM4WP_PHASE_STABLE,
381
  "plugintocheck" => "woocommerce/woocommerce.php"
382
  ),
383
  GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC => array(
384
+ "label" => __( "Track enhanced e-commerce", 'duracelltomi-google-tag-manager' ),
385
+ "description" => __( sprintf( __( "Choose this option if you would like to track e-commerce data using <a href=\"%s\" target=\"_blank\">enhanced ecommerce tracking</a>.", 'duracelltomi-google-tag-manager' ) , 'https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce'), 'duracelltomi-google-tag-manager' ),
386
  "phase" => GTM4WP_PHASE_BETA,
387
  "plugintocheck" => "woocommerce/woocommerce.php"
388
  ),
389
  GTM4WP_OPTION_INTEGRATE_WCREMARKETING => array(
390
+ "label" => __( "AdWords Remarketing", 'duracelltomi-google-tag-manager' ),
391
+ "description" => __( "Enable this to add Google AdWords dynamic remarketing variables to the dataLayer", 'duracelltomi-google-tag-manager' ),
392
  "phase" => GTM4WP_PHASE_STABLE,
393
  "plugintocheck" => "woocommerce/woocommerce.php"
394
  ),
395
  GTM4WP_OPTION_INTEGRATE_WCREMARKETINGSKU => array(
396
+ "label" => __( "Use SKU instead of ID", 'duracelltomi-google-tag-manager' ),
397
+ "description" => __( "Check this to use product SKU in the dynamic remarketing variables instead of the ID of the products. Will fallback to ID if no SKU is set.", 'duracelltomi-google-tag-manager' ),
398
  "phase" => GTM4WP_PHASE_EXPERIMENTAL,
399
  "plugintocheck" => "woocommerce/woocommerce.php"
400
  )
405
 
406
  switch( $args["id"] ) {
407
  case GTM4WP_ADMIN_GROUP_GENERAL: {
408
+ _e( 'This plugin is intended to be used by IT guys and marketing staff. Please be sure you read the <a href="https://developers.google.com/tag-manager/" target="_blank">Google Tag Manager Help Center</a> before you start using this plugin.<br /><br />', 'duracelltomi-google-tag-manager' );
409
 
410
  break;
411
  }
412
 
413
  case GTM4WP_ADMIN_GROUP_INCLUDES: {
414
+ _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' );
415
  echo "<br />";
416
+ printf( __( '* Browser, OS and Device data is provided using <a href="%s">WhichBrowser</a> library.', 'duracelltomi-google-tag-manager' ), "http://whichbrowser.net/" );
417
 
418
  break;
419
  }
420
 
421
  case GTM4WP_ADMIN_GROUP_EVENTS: {
422
+ _e( "Fire tags in Google Tag Manager on special events on your website", 'duracelltomi-google-tag-manager' );
423
  echo '<p style="font-weight: bold;">';
424
+ _e( 'In October 2013 Google released a new feature called <a href="https://support.google.com/tagmanager/answer/3415369?hl=en" target="_blank">auto event tracking</a>. It is up to you how you use click events either using Google\'s solution or the settings below.', 'duracelltomi-google-tag-manager' );
425
  echo '</p>';
426
 
427
  break;
428
  }
429
 
430
  case GTM4WP_ADMIN_GROUP_SCROLLER: {
431
+ _e( "Fire tags based on how the visitor scrolls through your page.", 'duracelltomi-google-tag-manager' );
432
  echo '<br />';
433
+ 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/");
434
 
435
  break;
436
  }
437
 
438
  case GTM4WP_ADMIN_GROUP_BLACKLIST: {
439
+ _e( "Here you can control which types of tags and macros 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' );
440
  echo '<br />';
441
+ _e( "Do not modify if you do not know what to do since it can cause issues in your tag deployment!", 'duracelltomi-google-tag-manager' );
442
  echo '<br />';
443
+ _e( "Blacklisting of macros only work if you enable blacklist or whilelist of tags on the previous tab.", 'duracelltomi-google-tag-manager' );
444
  echo '<br />';
445
+ _e( "Uncheck a row to blacklist a macro type.", 'duracelltomi-google-tag-manager' );
446
 
447
  break;
448
  }
449
 
450
  case GTM4WP_ADMIN_GROUP_INTEGRATION: {
451
+ _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' );
452
 
453
  break;
454
  }
455
 
456
  case GTM4WP_ADMIN_GROUP_ADVANCED: {
457
+ _e( "You usually do not need to modify thoose settings. Please be carefull while hacking here.", 'duracelltomi-google-tag-manager' );
458
 
459
  break;
460
  }
461
 
462
  case GTM4WP_ADMIN_GROUP_CREDITS: {
463
+ _e( "Some info about the author of this plugin", 'duracelltomi-google-tag-manager' );
464
 
465
  break;
466
  }
475
  switch( $args["label_for"] ) {
476
  case GTM4WP_ADMIN_GROUP_GTMID: {
477
  echo '<input type="text" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']" value="' . $gtm4wp_options[GTM4WP_OPTION_GTM_CODE] . '" /><br />' . $args["description"];
478
+ 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>';
479
 
480
  break;
481
  }
482
 
483
  case GTM4WP_ADMIN_GROUP_PLACEMENT: {
484
+ echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']_' . GTM4WP_PLACEMENT_FOOTER . '" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']" value="' . GTM4WP_PLACEMENT_FOOTER . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_FOOTER ? 'checked="checked"' : '' ) . '/> ' . __( "Footer of the page (not recommended by Google, no tweak in your template required)", 'duracelltomi-google-tag-manager' ) . '<br />';
485
+ echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']_' . GTM4WP_PLACEMENT_BODYOPEN . '" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']" value="' . GTM4WP_PLACEMENT_BODYOPEN . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_BODYOPEN ? 'checked="checked"' : '' ) . '/> ' . __( "Custom (needs tweak in your template)", 'duracelltomi-google-tag-manager' ) . '<br />';
486
+ echo '<input type="radio" id="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']_' . GTM4WP_PLACEMENT_BODYOPEN_AUTO . '" name="' . GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_PLACEMENT . ']" value="' . GTM4WP_PLACEMENT_BODYOPEN_AUTO . '" ' . ( $gtm4wp_options[ GTM4WP_OPTION_GTM_PLACEMENT ] == GTM4WP_PLACEMENT_BODYOPEN_AUTO ? 'checked="checked"' : '' ) . '/> ' . __( "Codeless injection (no tweak, right placement but experimental, could break your frontend)", 'duracelltomi-google-tag-manager' ) . '<br /><br />' . $args["description"];
487
 
488
  break;
489
  }
490
 
491
  case GTM4WP_ADMIN_GROUP_DATALAYER: {
492
  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"];
493
+ 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>';
494
 
495
  break;
496
  }
497
 
498
  case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_BLACKLIST_ENABLE . "]": {
499
+ 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 />';
500
+ 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 below (blacklist)", 'duracelltomi-google-tag-manager' ) . '<br />';
501
+ 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 below (whitelist)", 'duracelltomi-google-tag-manager' ) . '<br />';
502
  echo $args["description"];
503
 
504
  break;
505
  }
506
 
507
  case GTM4WP_OPTIONS . "[" . GTM4WP_OPTION_INCLUDE_WEATHERUNITS . "]": {
508
+ 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 />';
509
+ 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 />';
510
  echo $args["description"];
511
 
512
  break;
532
 
533
  if ( isset( $args["plugintocheck"] ) ) {
534
  if ( is_plugin_active( $args["plugintocheck"] ) ) {
535
+ echo "<br />" . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recommended to enable this integration!', 'duracelltomi-google-tag-manager' );
536
  } else {
537
+ 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' );
538
  }
539
  }
540
 
546
 
547
  if ( isset( $args["plugintocheck"] ) ) {
548
  if ( is_plugin_active( $args["plugintocheck"] ) ) {
549
+ echo "<br />" . __( 'This plugin is <strong class="gtm4wp-plugin-active">active</strong>, it is strongly recommended to enable this integration!', 'duracelltomi-google-tag-manager' );
550
  } else {
551
+ 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' );
552
  }
553
  }
554
 
606
  } else if ( ( $optionname == GTM4WP_OPTION_GTM_CODE ) || ( $optionname == GTM4WP_OPTION_DATALAYER_NAME ) ) {
607
  $newoptionvalue = trim($newoptionvalue);
608
 
609
+ // if ( ( $optionname == GTM4WP_OPTION_GTM_CODE ) && ( ! preg_match( "/^GTM-[A-Z0-9]+$/", $newoptionvalue ) ) ) {
610
+ // add_settings_error( GTM4WP_ADMIN_GROUP, GTM4WP_OPTIONS . '[' . GTM4WP_OPTION_GTM_CODE . ']', __( "Invalid Google Tag Manager ID. Valid ID format: GTM-XXXXX", 'duracelltomi-google-tag-manager' ) );
611
+ if ( $optionname == GTM4WP_OPTION_GTM_CODE ) {
612
+ $_gtmid_list = explode( ",", $newoptionvalue );
613
+ $_gtmid_haserror = false;
614
+
615
+ foreach( $_gtmid_list as $one_gtm_id ) {
616
+ $_gtmid_haserror = $_gtmid_haserror || !preg_match( "/^GTM-[A-Z0-9]+$/", $one_gtm_id );
617
+ }
618
 
619
+ if ( $_gtmid_haserror ) {
620
+ 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' ) );
621
+ } else {
622
+ $output[$optionname] = $newoptionvalue;
623
+ }
624
  } else if ( ( $optionname == GTM4WP_OPTION_DATALAYER_NAME ) && ( $newoptionvalue != "" ) && ( ! preg_match( "/^[a-zA-Z][a-zA-Z0-9_-]*$/", $newoptionvalue ) ) ) {
625
+ 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' ) );
626
 
627
  } else {
628
  $output[$optionname] = $newoptionvalue;
671
 
672
  add_settings_section(
673
  GTM4WP_ADMIN_GROUP_GENERAL,
674
+ __( 'General', 'duracelltomi-google-tag-manager' ),
675
  'gtm4wp_admin_output_section',
676
  GTM4WP_ADMINSLUG
677
  );
678
 
679
  add_settings_field(
680
  GTM4WP_ADMIN_GROUP_GTMID,
681
+ __( 'Google Tag Manager ID', 'duracelltomi-google-tag-manager' ),
682
  'gtm4wp_admin_output_field',
683
  GTM4WP_ADMINSLUG,
684
  GTM4WP_ADMIN_GROUP_GENERAL,
685
  array(
686
  "label_for" => GTM4WP_ADMIN_GROUP_GTMID,
687
+ "description" => __( "Enter your Google Tag Manager ID here. Use comma without space (,) to enter multiple IDs.", 'duracelltomi-google-tag-manager' )
688
  )
689
  );
690
 
691
  add_settings_field(
692
  GTM4WP_ADMIN_GROUP_PLACEMENT,
693
+ __( 'Container code placement', 'duracelltomi-google-tag-manager' ),
694
  'gtm4wp_admin_output_field',
695
  GTM4WP_ADMINSLUG,
696
  GTM4WP_ADMIN_GROUP_GENERAL,
697
  array(
698
  "label_for" => GTM4WP_ADMIN_GROUP_PLACEMENT,
699
+ "description" => __( "Select how your container code should be included in your website.<br />If you select 'Custom' you need to edit your template file and add the following line just after the opening &lt;body&gt; tag:<br /><code>&lt;?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?&gt;</code>", 'duracelltomi-google-tag-manager' )
700
  )
701
  );
702
 
703
  add_settings_section(
704
  GTM4WP_ADMIN_GROUP_INCLUDES,
705
+ __( 'Basic data', 'duracelltomi-google-tag-manager' ),
706
  'gtm4wp_admin_output_section',
707
  GTM4WP_ADMINSLUG
708
  );
724
 
725
  add_settings_section(
726
  GTM4WP_ADMIN_GROUP_EVENTS,
727
+ __( 'Events', 'duracelltomi-google-tag-manager' ),
728
  'gtm4wp_admin_output_section',
729
  GTM4WP_ADMINSLUG
730
  );
746
 
747
  add_settings_section(
748
  GTM4WP_ADMIN_GROUP_SCROLLER,
749
+ __( 'Scroll tracking', 'duracelltomi-google-tag-manager' ),
750
  'gtm4wp_admin_output_section',
751
  GTM4WP_ADMINSLUG
752
  );
768
 
769
  add_settings_section(
770
  GTM4WP_ADMIN_GROUP_BLACKLIST,
771
+ __( 'Blacklist tags', 'duracelltomi-google-tag-manager' ),
772
  'gtm4wp_admin_output_section',
773
  GTM4WP_ADMINSLUG
774
  );
805
 
806
  add_settings_section(
807
  GTM4WP_ADMIN_GROUP_INTEGRATION,
808
+ __( 'Integration', 'duracelltomi-google-tag-manager' ),
809
  'gtm4wp_admin_output_section',
810
  GTM4WP_ADMINSLUG
811
  );
828
 
829
  add_settings_section(
830
  GTM4WP_ADMIN_GROUP_ADVANCED,
831
+ __( 'Advanced', 'duracelltomi-google-tag-manager' ),
832
  'gtm4wp_admin_output_section',
833
  GTM4WP_ADMINSLUG
834
  );
835
 
836
  add_settings_field(
837
  GTM4WP_ADMIN_GROUP_DATALAYER,
838
+ __( 'dataLayer variable name', 'duracelltomi-google-tag-manager' ),
839
  'gtm4wp_admin_output_field',
840
  GTM4WP_ADMINSLUG,
841
  GTM4WP_ADMIN_GROUP_ADVANCED,
842
  array(
843
  "label_for" => GTM4WP_ADMIN_GROUP_DATALAYER,
844
+ "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' )
845
  )
846
  );
847
 
848
  add_settings_section(
849
  GTM4WP_ADMIN_GROUP_CREDITS,
850
+ __( 'Credits', 'duracelltomi-google-tag-manager' ),
851
  'gtm4wp_admin_output_section',
852
  GTM4WP_ADMINSLUG
853
  );
854
 
855
  add_settings_field(
856
  GTM4WP_ADMIN_GROUP_INFO,
857
+ __( 'Author', 'duracelltomi-google-tag-manager' ),
858
  'gtm4wp_admin_output_field',
859
  GTM4WP_ADMINSLUG,
860
  GTM4WP_ADMIN_GROUP_CREDITS,
879
  ?>
880
  <div class="wrap">
881
  <div id="gtm4wp-icon" class="icon32" style="background-image: url(<?php echo $gtp4wp_plugin_url; ?>admin/images/tag_manager-32.png);"><br /></div>
882
+ <h2><?php _e( 'Google Tag Manager for WordPress options', 'duracelltomi-google-tag-manager' ); ?></h2>
883
  <form action="options.php" method="post">
884
  <?php settings_fields( GTM4WP_ADMIN_GROUP ); ?>
885
  <?php do_settings_sections( GTM4WP_ADMINSLUG ); ?>
892
 
893
  function gtm4wp_add_admin_page() {
894
  add_options_page(
895
+ __( 'Google Tag Manager for WordPress settings', 'duracelltomi-google-tag-manager' ),
896
+ __( 'Google Tag Manager', 'duracelltomi-google-tag-manager' ),
897
  'manage_options',
898
  GTM4WP_ADMINSLUG,
899
  'gtm4wp_show_admin_page'
907
  wp_register_script( "admin-subtabs", $gtp4wp_plugin_url . "js/admin-subtabs.js" );
908
 
909
  $subtabtexts = array(
910
+ "posttabtitle" => __( "Posts" , 'duracelltomi-google-tag-manager' ),
911
+ "searchtabtitle" => __( "Search" , 'duracelltomi-google-tag-manager' ),
912
+ "visitortabtitle" => __( "Visitors" , 'duracelltomi-google-tag-manager' ),
913
+ "adwordstabtitle" => __( "AdWords" , 'duracelltomi-google-tag-manager' ),
914
+ "browsertabtitle" => __( "Browser/OS/Device" , 'duracelltomi-google-tag-manager' ),
915
+ "blocktagstabtitle" => __( "Blacklist tags" , 'duracelltomi-google-tag-manager' ),
916
+ "blockmacrostabtitle" => __( "Blacklist macros" , 'duracelltomi-google-tag-manager' ),
917
+ "wpcf7tabtitle" => __( "Contact Form 7" , 'duracelltomi-google-tag-manager' ),
918
+ "wctabtitle" => __( "WooCommerce" , 'duracelltomi-google-tag-manager' ),
919
+ "weathertabtitle" => __( "Weather data" , 'duracelltomi-google-tag-manager' ),
920
+ "generaleventstabtitle" => __( "General events" , 'duracelltomi-google-tag-manager' ),
921
+ "mediaeventstabtitle" => __( "Media events" , 'duracelltomi-google-tag-manager' ),
922
+ "depecratedeventstabtitle" => __( "Deprecated" , 'duracelltomi-google-tag-manager' )
923
  );
924
  wp_localize_script( "admin-subtabs", 'gtm4wp', $subtabtexts );
925
  wp_enqueue_script( "admin-subtabs" );
945
  jQuery( "#gtm4wp-options\\\\[gtm-code\\\\]" )
946
  .bind( "blur", function() {
947
  var gtmid_regex = /^GTM-[A-Z0-9]+$/;
948
+ var gtmid_list = jQuery( this ).val().split( "," );
949
+
950
+ var gtmid_haserror = false;
951
+ for( var i=0; i<gtmid_list.length; i++ ) {
952
+ gtmid_haserror = gtmid_haserror || !gtmid_regex.test( gtmid_list[ i ] );
953
+ }
954
+
955
+ if ( gtmid_haserror ) {
956
  jQuery( ".gtmid_validation_error" )
957
  .show();
958
  } else {
978
  }
979
  });
980
 
981
+ jQuery( ".gtm4wp-dismiss-notice" )
982
  .bind( "click", function( e ) {
983
  e.preventDefault();
984
 
988
  .attr( "href" )
989
  .substring( 1 )
990
  }, function ( response ) {
991
+ jQuery( ".gtm4wp-dismiss-notice" )
992
  .parent()
993
  .parent()
994
  .fadeOut( "slow" );
1014
  $gtm4wp_user_notices_dismisses = array_merge( $gtm4wp_def_user_notices_dismisses, $gtm4wp_user_notices_dismisses );
1015
 
1016
  if ( ( trim( $gtm4wp_options[GTM4WP_OPTION_GTM_CODE] ) == "" ) && ( false === $gtm4wp_user_notices_dismisses["enter-gtm-code"] ) ) {
1017
+ echo '<div id="message" class="error"><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> | <a href="?enter-gtm-code" class="gtm4wp-dismiss-notice">' . __( 'Dismiss', 'duracelltomi-google-tag-manager' ) . '</a></p></div>';
1018
  }
1019
 
1020
  if ( ( false === $gtm4wp_user_notices_dismisses["wc-ga-plugin-warning"] ) || ( false === $gtm4wp_user_notices_dismisses["wc-gayoast-plugin-warning"] ) ) {
1026
  $woo_ga_options = get_option( "woocommerce_google_analytics_settings" );
1027
  if ( $woo_ga_options ) {
1028
  if ( "" != $woo_ga_options["ga_id"] ) {
1029
+ echo '<div id="message" class="error"><p><strong>' . __( 'Notice: you should disable Google Analytics tracking <a href="admin.php?page=woocommerce_settings&tab=integration&section=google_analytics">in WooCommerce settings</a> by leaving Google Analytics ID field empty if you are using Google Analytics tags inside Google Tag Manager!', 'duracelltomi-google-tag-manager' ) . '</strong> | <a href="?wc-ga-plugin-warning" class="gtm4wp-dismiss-notice">' . __( 'Dismiss', 'duracelltomi-google-tag-manager' ) . '</a></p></div>';
1030
  }
1031
  }
1032
  }
1033
 
1034
  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" ) ) {
1035
+ echo '<div id="message" class="error"><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> | <a href="?wc-ga-plugin-warning" class="gtm4wp-dismiss-notice">' . __( 'Dismiss', 'duracelltomi-google-tag-manager' ) . '</a></p></div>';
1036
  }
1037
 
1038
  if ( ( false === $gtm4wp_user_notices_dismisses["wc-gayoast-plugin-warning"] ) && $is_wc_active && is_plugin_active( "google-analytics-for-wordpress/googleanalytics.php" ) ) {
1039
+ echo '<div id="message" class="error"><p><strong>' . __( 'Notice: you should deactivate the plugin "Google Analytics for WordPress by Yoast" if you are using Google Analytics tags inside Google Tag Manager!', 'duracelltomi-google-tag-manager' ) . '</strong> | <a href="?wc-gayoast-plugin-warning" class="gtm4wp-dismiss-notice">' . __( 'Dismiss', 'duracelltomi-google-tag-manager' ) . '</a></p></div>';
1040
  }
1041
  }
1042
  }
duracelltomi-google-tag-manager-for-wordpress.php CHANGED
@@ -1,23 +1,22 @@
1
  <?php
2
  /*
3
  Plugin Name: Google Tag Manager for Wordpress
4
- Version: 1.1.1
5
  Plugin URI: https://duracelltomi.com/google-tag-manager-for-wordpress/
6
  Description: The first Google Tag Manager plugin for WordPress with business goals in mind
7
  Author: Thomas Geiger
8
  Author URI: https://duracelltomi.com/
9
  */
10
 
11
- define( 'GTM4WP_VERSION', '1.1.1' );
12
  define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
13
- define( 'GTM4WP_TEXTDOMAIN', 'gtm4wp-lang' );
14
 
15
  $gtp4wp_plugin_url = plugin_dir_url( __FILE__ );
16
  $gtp4wp_plugin_basename = plugin_basename( __FILE__ );
17
  require_once( GTM4WP_PATH."/common/readoptions.php" );
18
 
19
  function gtm4wp_init() {
20
- load_plugin_textdomain( GTM4WP_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
21
  if ( is_admin() ) {
22
  require_once( GTM4WP_PATH."/admin/admin.php" );
23
  } else {
1
  <?php
2
  /*
3
  Plugin Name: Google Tag Manager for Wordpress
4
+ Version: 1.2
5
  Plugin URI: https://duracelltomi.com/google-tag-manager-for-wordpress/
6
  Description: The first Google Tag Manager plugin for WordPress with business goals in mind
7
  Author: Thomas Geiger
8
  Author URI: https://duracelltomi.com/
9
  */
10
 
11
+ define( 'GTM4WP_VERSION', '1.2' );
12
  define( 'GTM4WP_PATH', plugin_dir_path( __FILE__ ) );
 
13
 
14
  $gtp4wp_plugin_url = plugin_dir_url( __FILE__ );
15
  $gtp4wp_plugin_basename = plugin_basename( __FILE__ );
16
  require_once( GTM4WP_PATH."/common/readoptions.php" );
17
 
18
  function gtm4wp_init() {
19
+ load_plugin_textdomain( 'duracelltomi-google-tag-manager', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
20
  if ( is_admin() ) {
21
  require_once( GTM4WP_PATH."/admin/admin.php" );
22
  } else {
integration/woocommerce.php CHANGED
@@ -254,7 +254,7 @@ function gtm4wp_woocommerce_datalayer_filter_items( $dataLayer ) {
254
  $_products[] = array(
255
  "id" => $_product->id,
256
  "name" => $item['name'],
257
- "sku" => $product_sku ? __( 'SKU:', GTM4WP_TEXTDOMAIN ) . ' ' . $product_sku : $_product->id,
258
  "category" => $_category,
259
  "price" => $_prodprice,
260
  "currency" => get_woocommerce_currency(),
254
  $_products[] = array(
255
  "id" => $_product->id,
256
  "name" => $item['name'],
257
+ "sku" => $product_sku ? __( 'SKU:', 'duracelltomi-google-tag-manager' ) . ' ' . $product_sku : $_product->id,
258
  "category" => $_category,
259
  "price" => $_prodprice,
260
  "currency" => get_woocommerce_currency(),
js/admin-tabcreator.js CHANGED
@@ -3,7 +3,7 @@
3
  var adminsubtabsdata = window[ 'adminsubtabs' ] || {};
4
  var adminsubtabs = [];
5
 
6
- jQuery( '#wpbody form h3' ).each(function( i ) {
7
  admintabs.push( '<a class="nav-tab" href="#">' + jQuery(this).text() + '</a>' );
8
 
9
  jQuery(this)
@@ -24,7 +24,7 @@
24
  }
25
  });
26
 
27
- jQuery( '#wpbody form' )
28
  .prepend( adminsubtabs.join('') )
29
  .prepend( '<h2 class="nav-tab-wrapper">' + admintabs.join('') + '</h2>' );
30
 
@@ -64,11 +64,11 @@
64
  jQuery( '#wpbody form .tabinfo:eq(' + tabindex + '),#wpbody form .form-table:eq(' + tabindex + ')' )
65
  .show();
66
 
67
- jQuery( '#adminsubtabs' + tabindex + ':not(.subtab-activated)' )
68
  .find( 'a:first' )
69
  .trigger( 'click' );
70
 
71
- jQuery( '#adminsubtabs' + tabindex )
72
  .addClass( 'subtab-activated' )
73
  .show();
74
 
3
  var adminsubtabsdata = window[ 'adminsubtabs' ] || {};
4
  var adminsubtabs = [];
5
 
6
+ jQuery( '#wpbody form h2' ).each(function( i ) {
7
  admintabs.push( '<a class="nav-tab" href="#">' + jQuery(this).text() + '</a>' );
8
 
9
  jQuery(this)
24
  }
25
  });
26
 
27
+ jQuery("#wpbody form[action='options.php']")
28
  .prepend( adminsubtabs.join('') )
29
  .prepend( '<h2 class="nav-tab-wrapper">' + admintabs.join('') + '</h2>' );
30
 
64
  jQuery( '#wpbody form .tabinfo:eq(' + tabindex + '),#wpbody form .form-table:eq(' + tabindex + ')' )
65
  .show();
66
 
67
+ jQuery( '#wpbody #adminsubtabs' + tabindex + ':not(.subtab-activated)' )
68
  .find( 'a:first' )
69
  .trigger( 'click' );
70
 
71
+ jQuery( '#wpbody #adminsubtabs' + tabindex )
72
  .addClass( 'subtab-activated' )
73
  .show();
74
 
js/gtm4wp-contact-form-7-tracker.js CHANGED
@@ -1,8 +1,14 @@
1
  jQuery( function() {
2
  jQuery( ".wpcf7" )
3
- .on( 'mailsent.wpcf7', function(){
 
 
 
 
 
4
  window[ gtm4wp_datalayer_name ].push({
5
- 'event': 'gtm4wp.contactForm7Submitted'
 
6
  });
7
  });
8
  });
1
  jQuery( function() {
2
  jQuery( ".wpcf7" )
3
+ .on( 'wpcf7:mailsent', function(e) {
4
+ var gtm4wp_cf7formid = '(not set)';
5
+ if ( e && e.target && e.target.id ) {
6
+ gtm4wp_cf7formid = e.target.id;
7
+ }
8
+
9
  window[ gtm4wp_datalayer_name ].push({
10
+ 'event': 'gtm4wp.contactForm7Submitted',
11
+ 'gtm4wp.cf7formid': gtm4wp_cf7formid
12
  });
13
  });
14
  });
js/gtm4wp-social-tracker.js CHANGED
@@ -51,7 +51,7 @@ jQuery( function() {
51
  });
52
  } // end of Facebook social events
53
 
54
- if ( typeof twttr == "undefined" ) {
55
  window.twttr = (function ( d, s, id ) {
56
  var t, js, fjs = d.getElementsByTagName(s)[0];
57
  if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
51
  });
52
  } // end of Facebook social events
53
 
54
+ if ( typeof window.twttr == "undefined" ) {
55
  window.twttr = (function ( d, s, id ) {
56
  var t, js, fjs = d.getElementsByTagName(s)[0];
57
  if (d.getElementById(id)) return; js=d.createElement(s); js.id=id;
languages/en.pot CHANGED
@@ -209,7 +209,7 @@ msgstr ""
209
  #: ../admin/admin.php:171
210
  msgid ""
211
  "This plugin is <strong class=\"gtm4wp-plugin-active\">active</strong>, it is "
212
- "strongly recomment to enable this integration!"
213
  msgstr ""
214
 
215
  #: ../admin/admin.php:173
209
  #: ../admin/admin.php:171
210
  msgid ""
211
  "This plugin is <strong class=\"gtm4wp-plugin-active\">active</strong>, it is "
212
+ "strongly recommended to enable this integration!"
213
  msgstr ""
214
 
215
  #: ../admin/admin.php:173
languages/gtm4wp-lang-hu_HU.mo CHANGED
Binary file
languages/gtm4wp-lang-hu_HU.po CHANGED
@@ -8,7 +8,7 @@ msgstr ""
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.7.3\n"
12
  "Language: hu_HU\n"
13
 
14
  #: ../admin/admin.php:18
@@ -253,7 +253,7 @@ msgstr "Néhány információ ezen bővítmény szerzőjéről"
253
  #: ../admin/admin.php:171
254
  msgid ""
255
  "This plugin is <strong class=\"gtm4wp-plugin-active\">active</strong>, it is "
256
- "strongly recomment to enable this integration!"
257
  msgstr ""
258
  "Ez a bővítmény <strong class=\"gtm4wp-plugin-active\">aktív</strong>, "
259
  "ajánlott bekapcsolni ezt az integrációt!"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.8.6\n"
12
  "Language: hu_HU\n"
13
 
14
  #: ../admin/admin.php:18
253
  #: ../admin/admin.php:171
254
  msgid ""
255
  "This plugin is <strong class=\"gtm4wp-plugin-active\">active</strong>, it is "
256
+ "strongly recommended to enable this integration!"
257
  msgstr ""
258
  "Ez a bővítmény <strong class=\"gtm4wp-plugin-active\">aktív</strong>, "
259
  "ajánlott bekapcsolni ezt az integrációt!"
public/frontend.php CHANGED
@@ -5,7 +5,9 @@ define( 'GTM4WP_WPFILTER_GETTHEGTMTAG', 'gtm4wp_get_the_gtm_tag' );
5
 
6
  $GLOBALS[ "gtm4wp_container_code_written" ] = false;
7
 
8
- if ( $GLOBALS[ "gtm4wp_options" ][ GTM4WP_OPTION_DATALAYER_NAME ] == "" ) {
 
 
9
  $GLOBALS[ "gtm4wp_datalayer_name" ] = "dataLayer";
10
  } else {
11
  $GLOBALS[ "gtm4wp_datalayer_name" ] = $GLOBALS[ "gtm4wp_options" ][ GTM4WP_OPTION_DATALAYER_NAME ];
@@ -161,7 +163,7 @@ function gtm4wp_add_basic_datalayer_data( $dataLayer ) {
161
 
162
  if ( is_search() ) {
163
  $dataLayer["siteSearchTerm"] = get_search_query();
164
- $dataLayer["siteSearchFrom"] = $_SERVER["HTTP_REFERER"];
165
  $dataLayer["siteSearchResults"] = $wp_query->post_count;
166
  }
167
 
@@ -322,8 +324,8 @@ function gtm4wp_add_basic_datalayer_data( $dataLayer ) {
322
  }
323
 
324
  if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_WEATHER ] ) {
325
- $dataLayer[ "weatherCategory" ] = __( "(no weather data available)", GTM4WP_TEXTDOMAIN );
326
- $dataLayer[ "weatherDescription" ] = __( "(no weather data available)", GTM4WP_TEXTDOMAIN );
327
  $dataLayer[ "weatherTemp" ] = 0;
328
  $dataLayer[ "weatherPressure" ] = 0;
329
  $dataLayer[ "weatherWindSpeed" ] = 0;
@@ -389,14 +391,20 @@ function gtm4wp_get_the_gtm_tag() {
389
  $_gtm_tag = '';
390
 
391
  if ( ( $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] != "" ) && ( ! $gtm4wp_container_code_written ) ) {
392
- $_gtm_tag .= '
393
- <noscript><iframe src="//www.googletagmanager.com/ns.html?id=' . $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] . '"
 
 
 
394
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
395
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({\'gtm.start\':
396
  new Date().getTime(),event:\'gtm.js\'});var f=d.getElementsByTagName(s)[0],
397
  j=d.createElement(s),dl=l!=\'dataLayer\'?\'&l=\'+l:\'\';j.async=true;j.src=
398
  \'//www.googletagmanager.com/gtm.js?id=\'+i+dl;f.parentNode.insertBefore(j,f);
399
- })(window,document,\'script\',\'' . $gtm4wp_datalayer_name . '\',\'' . $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] . '\');</script>
 
 
 
400
  <!-- End Google Tag Manager -->';
401
 
402
  $_gtm_tag = apply_filters( GTM4WP_WPFILTER_GETTHEGTMTAG, $_gtm_tag );
@@ -414,27 +422,27 @@ function gtm4wp_enqueue_scripts() {
414
  global $gtm4wp_options, $gtp4wp_plugin_url;
415
 
416
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_OUTBOUND ] ) {
417
- wp_enqueue_script( "gtm4wp-outbound-click-tracker", $gtp4wp_plugin_url . "js/gtm4wp-outbound-click-tracker.js", array( "jquery" ), "1.0", false );
418
  }
419
 
420
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_DOWNLOADS ] ) {
421
- wp_enqueue_script( "gtm4wp-download-tracker", $gtp4wp_plugin_url . "js/gtm4wp-download-tracker.js", array( "jquery" ), "1.0", false );
422
  }
423
 
424
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_EMAILCLICKS ] ) {
425
- wp_enqueue_script( "gtm4wp-email-link-tracker", $gtp4wp_plugin_url . "js/gtm4wp-email-link-tracker.js", array( "jquery" ), "1.0", false );
426
  }
427
 
428
  if ( $gtm4wp_options[ GTM4WP_OPTION_INTEGRATE_WPCF7 ] ) {
429
- wp_enqueue_script( "gtm4wp-contact-form-7-tracker", $gtp4wp_plugin_url . "js/gtm4wp-contact-form-7-tracker.js", array( "jquery" ), "1.0", false );
430
  }
431
 
432
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_FORMMOVE ] ) {
433
- wp_enqueue_script( "gtm4wp-form-move-tracker", $gtp4wp_plugin_url . "js/gtm4wp-form-move-tracker.js", array( "jquery" ), "1.0", false );
434
  }
435
 
436
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_SOCIAL ] ) {
437
- wp_enqueue_script( "gtm4wp-social-actions", $gtp4wp_plugin_url . "js/gtm4wp-social-tracker.js", array( "jquery" ), "1.0", false );
438
  }
439
 
440
  if ( isset ( $GLOBALS["woocommerce"] ) ) {
@@ -454,7 +462,7 @@ function gtm4wp_enqueue_scripts() {
454
  }
455
 
456
  if ( $gtm4wp_options[ GTM4WP_OPTION_SCROLLER_ENABLED ] ) {
457
- wp_enqueue_script( "gtm4wp-scroll-tracking", $gtp4wp_plugin_url . "js/analytics-talk-content-tracking.js", array( "jquery" ), "1.0", false );
458
  }
459
  }
460
 
5
 
6
  $GLOBALS[ "gtm4wp_container_code_written" ] = false;
7
 
8
+ // check for empty is needed to prevent error in WP CLI
9
+ // bugfix by Patrick Holberg Hesselberg
10
+ if ( empty($GLOBALS[ "gtm4wp_options" ] ) || ($GLOBALS[ "gtm4wp_options" ][ GTM4WP_OPTION_DATALAYER_NAME ] == "") ) {
11
  $GLOBALS[ "gtm4wp_datalayer_name" ] = "dataLayer";
12
  } else {
13
  $GLOBALS[ "gtm4wp_datalayer_name" ] = $GLOBALS[ "gtm4wp_options" ][ GTM4WP_OPTION_DATALAYER_NAME ];
163
 
164
  if ( is_search() ) {
165
  $dataLayer["siteSearchTerm"] = get_search_query();
166
+ $dataLayer["siteSearchFrom"] = ( isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "" );
167
  $dataLayer["siteSearchResults"] = $wp_query->post_count;
168
  }
169
 
324
  }
325
 
326
  if ( $gtm4wp_options[ GTM4WP_OPTION_INCLUDE_WEATHER ] ) {
327
+ $dataLayer[ "weatherCategory" ] = __( "(no weather data available)", 'duracelltomi-google-tag-manager' );
328
+ $dataLayer[ "weatherDescription" ] = __( "(no weather data available)", 'duracelltomi-google-tag-manager' );
329
  $dataLayer[ "weatherTemp" ] = 0;
330
  $dataLayer[ "weatherPressure" ] = 0;
331
  $dataLayer[ "weatherWindSpeed" ] = 0;
391
  $_gtm_tag = '';
392
 
393
  if ( ( $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] != "" ) && ( ! $gtm4wp_container_code_written ) ) {
394
+ $_gtm_codes = explode( ",", str_replace( array(";"," "), array(",",""), $gtm4wp_options[ GTM4WP_OPTION_GTM_CODE ] ) );
395
+
396
+ foreach( $_gtm_codes as $one_gtm_code ) {
397
+ $_gtm_tag .= '
398
+ <noscript><iframe src="//www.googletagmanager.com/ns.html?id=' . $one_gtm_code . '"
399
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
400
  <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({\'gtm.start\':
401
  new Date().getTime(),event:\'gtm.js\'});var f=d.getElementsByTagName(s)[0],
402
  j=d.createElement(s),dl=l!=\'dataLayer\'?\'&l=\'+l:\'\';j.async=true;j.src=
403
  \'//www.googletagmanager.com/gtm.js?id=\'+i+dl;f.parentNode.insertBefore(j,f);
404
+ })(window,document,\'script\',\'' . $gtm4wp_datalayer_name . '\',\'' . $one_gtm_code . '\');</script>';
405
+ }
406
+
407
+ $_gtm_tag .= '
408
  <!-- End Google Tag Manager -->';
409
 
410
  $_gtm_tag = apply_filters( GTM4WP_WPFILTER_GETTHEGTMTAG, $_gtm_tag );
422
  global $gtm4wp_options, $gtp4wp_plugin_url;
423
 
424
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_OUTBOUND ] ) {
425
+ wp_enqueue_script( "gtm4wp-outbound-click-tracker", $gtp4wp_plugin_url . "js/gtm4wp-outbound-click-tracker.js", array( "jquery" ), GTM4WP_VERSION, false );
426
  }
427
 
428
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_DOWNLOADS ] ) {
429
+ wp_enqueue_script( "gtm4wp-download-tracker", $gtp4wp_plugin_url . "js/gtm4wp-download-tracker.js", array( "jquery" ), GTM4WP_VERSION, false );
430
  }
431
 
432
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_EMAILCLICKS ] ) {
433
+ wp_enqueue_script( "gtm4wp-email-link-tracker", $gtp4wp_plugin_url . "js/gtm4wp-email-link-tracker.js", array( "jquery" ), GTM4WP_VERSION, false );
434
  }
435
 
436
  if ( $gtm4wp_options[ GTM4WP_OPTION_INTEGRATE_WPCF7 ] ) {
437
+ wp_enqueue_script( "gtm4wp-contact-form-7-tracker", $gtp4wp_plugin_url . "js/gtm4wp-contact-form-7-tracker.js", array( "jquery" ), GTM4WP_VERSION, false );
438
  }
439
 
440
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_FORMMOVE ] ) {
441
+ wp_enqueue_script( "gtm4wp-form-move-tracker", $gtp4wp_plugin_url . "js/gtm4wp-form-move-tracker.js", array( "jquery" ), GTM4WP_VERSION, false );
442
  }
443
 
444
  if ( $gtm4wp_options[ GTM4WP_OPTION_EVENTS_SOCIAL ] ) {
445
+ wp_enqueue_script( "gtm4wp-social-actions", $gtp4wp_plugin_url . "js/gtm4wp-social-tracker.js", array( "jquery" ), GTM4WP_VERSION, false );
446
  }
447
 
448
  if ( isset ( $GLOBALS["woocommerce"] ) ) {
462
  }
463
 
464
  if ( $gtm4wp_options[ GTM4WP_OPTION_SCROLLER_ENABLED ] ) {
465
+ wp_enqueue_script( "gtm4wp-scroll-tracking", $gtp4wp_plugin_url . "js/analytics-talk-content-tracking.js", array( "jquery" ), GTM4WP_VERSION, false );
466
  }
467
  }
468
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: duracelltomi
3
  Donate link: https://duracelltomi.com/
4
  Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, adwords remarketing, remarketing, google analytics, analytics
5
- Requires at least: 3.0.1
6
- Tested up to: 4.2.1
7
- Stable tag: 1.1.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -16,6 +16,7 @@ Google Tag Manager (GTM) is Google's free tool to everyone to be able to manage
16
  using an intuitive web UI.
17
 
18
  This plugin can place the necessary container code snippet into your website so that you do not need to edit your theme files.
 
19
 
20
  = Basic data included =
21
 
@@ -49,6 +50,9 @@ http://www.affectivia.com/blog/placing-the-google-tag-manager-in-wordpress-after
49
 
50
  I added this solution to the plugin, currently as an experimental option.
51
 
 
 
 
52
  = Browser / OS / Device data =
53
 
54
  (beta)
@@ -158,16 +162,6 @@ Google Tag Manager for WordPress can integrate with several popular plugins.
158
 
159
  More integration to come!
160
 
161
- = Planned features =
162
-
163
- Note: list of planned features can change as development goes on!
164
-
165
- * 1.3
166
- * dataLayer elements to include when JavaScript is turned of in a browser (request by Simo Ahava)
167
- * 1.2
168
- * MailChimp for WordPress support (request by I-Visio)
169
- * Custom dataLayer elements: place your own items site-wide or per page/post
170
-
171
  == Installation ==
172
 
173
  1. Upload `duracelltomi-google-tag-manager-for-wordpress` to the `/wp-content/plugins/` directory
@@ -286,6 +280,18 @@ If you or your social plugin inserts the Facebook buttons using IFRAMEs (like So
286
 
287
  == Changelog ==
288
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  = 1.1.1 =
290
 
291
  * Fixed: PHP errors in frontend.php and admin.php
@@ -407,6 +413,10 @@ Please report all bugs found in my plugin using the [contact form on my website]
407
 
408
  == Upgrade Notice ==
409
 
 
 
 
 
410
  = 1.1.1 =
411
 
412
  This is a bugfix release to address some issues with v1.1
2
  Contributors: duracelltomi
3
  Donate link: https://duracelltomi.com/
4
  Tags: google tag manager, tag manager, gtm, google, adwords, google adwords, adwords remarketing, remarketing, google analytics, analytics
5
+ Requires at least: 3.4.0
6
+ Tested up to: 4.4
7
+ Stable tag: 1.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
16
  using an intuitive web UI.
17
 
18
  This plugin can place the necessary container code snippet into your website so that you do not need to edit your theme files.
19
+ Multiple containers are supported!
20
 
21
  = Basic data included =
22
 
50
 
51
  I added this solution to the plugin, currently as an experimental option.
52
 
53
+ Users of the Genisis Framework should use the "Custom" option but without altering the theme.
54
+ The Google Tag Manager container code will be added automatically.
55
+
56
  = Browser / OS / Device data =
57
 
58
  (beta)
162
 
163
  More integration to come!
164
 
 
 
 
 
 
 
 
 
 
 
165
  == Installation ==
166
 
167
  1. Upload `duracelltomi-google-tag-manager-for-wordpress` to the `/wp-content/plugins/` directory
280
 
281
  == Changelog ==
282
 
283
+ = 1.2 =
284
+
285
+ * Fixed: subtabs on admin page now showing in certain cases
286
+ * Fixed: error message when running the site using WP CLI (thanks Patrick Holberg Hesselberg)
287
+ * Fixed: some typos on admin page
288
+ * Fixed: dismissable notices did not disappear in some cases
289
+ * Fixed: tracking of Twitter event cased sometimes JS errors
290
+ * Fixed: site search tracking caused sometimes PHP errors when HTTP_REFERER was not set
291
+ * Updated: preparation for translate.wordpress.org
292
+ * Added: support for multiple container IDs
293
+ * Added: added form ID when sending a Contact Form 7 form. Variable name: gtm4wp.cf7formid
294
+
295
  = 1.1.1 =
296
 
297
  * Fixed: PHP errors in frontend.php and admin.php
413
 
414
  == Upgrade Notice ==
415
 
416
+ = 1.2 =
417
+
418
+ New release with lots of fixes from the past months and new features like multiple container support!
419
+
420
  = 1.1.1 =
421
 
422
  This is a bugfix release to address some issues with v1.1