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 | 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 +226 -207
- duracelltomi-google-tag-manager-for-wordpress.php +3 -4
- integration/woocommerce.php +1 -1
- js/admin-tabcreator.js +4 -4
- js/gtm4wp-contact-form-7-tracker.js +8 -2
- js/gtm4wp-social-tracker.js +1 -1
- languages/en.pot +1 -1
- languages/gtm4wp-lang-hu_HU.mo +0 -0
- languages/gtm4wp-lang-hu_HU.po +2 -2
- public/frontend.php +22 -14
- readme.txt +23 -13
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",
|
36 |
-
"description" => __( "Check this option to include the type of the current post or archive page (post, page or any custom post type).",
|
37 |
"phase" => GTM4WP_PHASE_STABLE
|
38 |
),
|
39 |
GTM4WP_OPTION_INCLUDE_CATEGORIES => array(
|
40 |
-
"label" => __( "Category list of current post/archive",
|
41 |
-
"description" => __( "Check this option to include the category names of the current post or archive page",
|
42 |
"phase" => GTM4WP_PHASE_STABLE
|
43 |
),
|
44 |
GTM4WP_OPTION_INCLUDE_TAGS => array(
|
45 |
-
"label" => __( "Tags of current post",
|
46 |
-
"description" => __( "Check this option to include the tags of the current post.",
|
47 |
"phase" => GTM4WP_PHASE_STABLE
|
48 |
),
|
49 |
GTM4WP_OPTION_INCLUDE_AUTHOR => array(
|
50 |
-
"label" => __( "Post author name",
|
51 |
-
"description" => __( "Check this option to include the author's name of the current post or author page.",
|
52 |
"phase" => GTM4WP_PHASE_STABLE
|
53 |
),
|
54 |
GTM4WP_OPTION_INCLUDE_POSTDATE => array(
|
55 |
-
"label" => __( "Post date",
|
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.",
|
57 |
"phase" => GTM4WP_PHASE_STABLE
|
58 |
),
|
59 |
GTM4WP_OPTION_INCLUDE_POSTTITLE => array(
|
60 |
-
"label" => __( "Post title",
|
61 |
-
"description" => __( "Check this option to include the title of the current post.",
|
62 |
"phase" => GTM4WP_PHASE_STABLE
|
63 |
),
|
64 |
GTM4WP_OPTION_INCLUDE_POSTCOUNT => array(
|
65 |
-
"label" => __( "Post count",
|
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.",
|
67 |
"phase" => GTM4WP_PHASE_STABLE
|
68 |
),
|
69 |
GTM4WP_OPTION_INCLUDE_SEARCHDATA => array(
|
70 |
-
"label" => __( "Search data",
|
71 |
-
"description" => __( "Check this option to include the search term, referring page URL and number of results on the search page.",
|
72 |
"phase" => GTM4WP_PHASE_STABLE
|
73 |
),
|
74 |
GTM4WP_OPTION_INCLUDE_LOGGEDIN => array(
|
75 |
-
"label" => __( "Logged in status",
|
76 |
-
"description" => __( "Check this option to include whether there is a logged in user on your website.",
|
77 |
"phase" => GTM4WP_PHASE_STABLE
|
78 |
),
|
79 |
GTM4WP_OPTION_INCLUDE_USERROLE => array(
|
80 |
-
"label" => __( "Logged in user role",
|
81 |
-
"description" => __( "Check this option to include the role of the logged in user.",
|
82 |
"phase" => GTM4WP_PHASE_STABLE
|
83 |
),
|
84 |
GTM4WP_OPTION_INCLUDE_USERID => array(
|
85 |
-
"label" => __( "Logged in user ID",
|
86 |
-
"description" => __( "Check this option to include the ID of the logged in user.",
|
87 |
"phase" => GTM4WP_PHASE_STABLE
|
88 |
),
|
89 |
GTM4WP_OPTION_INCLUDE_REMARKETING => array(
|
90 |
-
"label" => __( "Remarketing variable",
|
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",
|
92 |
"phase" => GTM4WP_PHASE_STABLE
|
93 |
),
|
94 |
GTM4WP_OPTION_INCLUDE_BROWSERDATA => array(
|
95 |
-
"label" => __( "Browser data *",
|
96 |
-
"description" => __( "Check this option to include the name, version and engine data of the browser the visitor uses.",
|
97 |
"phase" => GTM4WP_PHASE_BETA
|
98 |
),
|
99 |
GTM4WP_OPTION_INCLUDE_OSDATA => array(
|
100 |
-
"label" => __( "OS data *",
|
101 |
-
"description" => __( "Check this option to include the name and version of the operating system the visitor uses.",
|
102 |
"phase" => GTM4WP_PHASE_BETA
|
103 |
),
|
104 |
GTM4WP_OPTION_INCLUDE_DEVICEDATA => array(
|
105 |
-
"label" => __( "Device data *",
|
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.",
|
107 |
"phase" => GTM4WP_PHASE_BETA
|
108 |
),
|
109 |
GTM4WP_OPTION_INCLUDE_WEATHER => array(
|
110 |
-
"label" => __( "Weather data",
|
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.",
|
112 |
"phase" => GTM4WP_PHASE_EXPERIMENTAL
|
113 |
),
|
114 |
GTM4WP_OPTION_INCLUDE_WEATHERUNITS => array(
|
115 |
-
"label" => __( "Weather data units",
|
116 |
-
"description" => __( "Select which temperature units you would like to use.",
|
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)",
|
124 |
-
"description" => __( "Check this option to include a Tag Manager event when a visitor moves between elements of a form (comment, contact, etc).",
|
125 |
"phase" => GTM4WP_PHASE_STABLE
|
126 |
),
|
127 |
GTM4WP_OPTION_EVENTS_SOCIAL => array(
|
128 |
-
"label" => __( "Social actions (gtm4wp.socialAction)",
|
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.",
|
130 |
"phase" => GTM4WP_PHASE_STABLE
|
131 |
),
|
132 |
GTM4WP_OPTION_EVENTS_YOUTUBE => array(
|
133 |
-
"label" => __( "YouTube video events",
|
134 |
-
"description" => __( "Check this option to include a Tag Manager event when a visitor interacts with a YouTube video embeded on your site.",
|
135 |
"phase" => GTM4WP_PHASE_EXPERIMENTAL
|
136 |
),
|
137 |
GTM4WP_OPTION_EVENTS_VIMEO => array(
|
138 |
-
"label" => __( "Vimeo video events",
|
139 |
-
"description" => __( "Check this option to include a Tag Manager event when a visitor interacts with a Vimeo video embeded on your site.",
|
140 |
"phase" => GTM4WP_PHASE_EXPERIMENTAL
|
141 |
),
|
142 |
GTM4WP_OPTION_EVENTS_SOUNDCLOUD => array(
|
143 |
-
"label" => __( "Soundcloud events",
|
144 |
-
"description" => __( "Check this option to include a Tag Manager event when a visitor interacts with a Soundcloud media embeded on your site.",
|
145 |
"phase" => GTM4WP_PHASE_EXPERIMENTAL
|
146 |
),
|
147 |
GTM4WP_OPTION_EVENTS_OUTBOUND => array(
|
148 |
-
"label" => __( "Outbound link click events (gtm4wp.outboundClick)",
|
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.",
|
150 |
"phase" => GTM4WP_PHASE_DEPRECATED
|
151 |
),
|
152 |
GTM4WP_OPTION_EVENTS_DOWNLOADS => array(
|
153 |
-
"label" => __( "Download click events (gtm4wp.downloadClick)",
|
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.",
|
155 |
"phase" => GTM4WP_PHASE_DEPRECATED
|
156 |
),
|
157 |
GTM4WP_OPTION_EVENTS_DWLEXT => array(
|
158 |
-
"label" => __( "Extensions to track",
|
159 |
-
"description" => __( "Enter a comma separated list of extensions to track when 'Include download click events' option is set.",
|
160 |
"phase" => GTM4WP_PHASE_DEPRECATED
|
161 |
),
|
162 |
GTM4WP_OPTION_EVENTS_EMAILCLICKS => array(
|
163 |
-
"label" => __( "Email click events (gtm4wp.emailClick)",
|
164 |
-
"description" => __( "Check this option to include a Tag Manager event when a visitor clicks on an email link.",
|
165 |
"phase" => GTM4WP_PHASE_DEPRECATED
|
166 |
)
|
167 |
);
|
168 |
|
169 |
$GLOBALS["gtm4wp_scrollerfieldtexts"] = array(
|
170 |
GTM4WP_OPTION_SCROLLER_ENABLED => array(
|
171 |
-
"label" => __( "Enabled",
|
172 |
-
"description" => __( "Enable scroll tracker script on your website.",
|
173 |
"phase" => GTM4WP_PHASE_STABLE
|
174 |
),
|
175 |
GTM4WP_OPTION_SCROLLER_DEBUGMODE => array(
|
176 |
-
"label" => __( "Debug mode",
|
177 |
-
"description" => __( "Fire console.log() commands instead of dataLayer events.",
|
178 |
"phase" => GTM4WP_PHASE_STABLE
|
179 |
),
|
180 |
GTM4WP_OPTION_SCROLLER_CALLBACKTIME => array(
|
181 |
-
"label" => __( "Time delay before location check",
|
182 |
-
"description" => __( "Enter the number of milliseconds after the script checks the current location. It prevents too many events being fired while scrolling.",
|
183 |
"phase" => GTM4WP_PHASE_STABLE
|
184 |
),
|
185 |
GTM4WP_OPTION_SCROLLER_DISTANCE => array(
|
186 |
-
"label" => __( "Minimum distance",
|
187 |
-
"description" => __( "The minimum amount of pixels that a visitor has to scroll before we treat the move as scrolling.",
|
188 |
"phase" => GTM4WP_PHASE_STABLE
|
189 |
),
|
190 |
GTM4WP_OPTION_SCROLLER_CONTENTID => array(
|
191 |
-
"label" => __( "Content ID",
|
192 |
-
"description" => __( "Enter the DOM ID of the content element in your template. Leave it empty for default(content). Do not include the # sign.",
|
193 |
"phase" => GTM4WP_PHASE_STABLE
|
194 |
),
|
195 |
GTM4WP_OPTION_SCROLLER_READERTIME => array(
|
196 |
-
"label" => __( "Scroller time",
|
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.",
|
198 |
"phase" => GTM4WP_PHASE_STABLE
|
199 |
)
|
200 |
);
|
201 |
|
202 |
$GLOBALS["gtm4wp_blacklistfieldtexts"] = array(
|
203 |
GTM4WP_OPTION_BLACKLIST_ENABLE => array(
|
204 |
-
"label" => __( "Enable blacklist/whitelist",
|
205 |
-
"description" => __( "Disable feature or select whether you want to whitelist or blacklist tags",
|
206 |
"phase" => GTM4WP_PHASE_STABLE
|
207 |
),
|
208 |
GTM4WP_OPTION_BLACKLIST_AWCONV => array(
|
209 |
-
"label" => __( "AdWords Conversion Tracking Tag",
|
210 |
-
"description" => __( "",
|
211 |
"phase" => GTM4WP_PHASE_STABLE
|
212 |
),
|
213 |
GTM4WP_OPTION_BLACKLIST_AWREMARKET => array(
|
214 |
-
"label" => __( "AdWords Remarketing Tag",
|
215 |
-
"description" => __( "",
|
216 |
"phase" => GTM4WP_PHASE_STABLE
|
217 |
),
|
218 |
GTM4WP_OPTION_BLACKLIST_GACLASSIC => array(
|
219 |
-
"label" => __( "Google Analytics Tag",
|
220 |
-
"description" => __( "",
|
221 |
"phase" => GTM4WP_PHASE_STABLE
|
222 |
),
|
223 |
GTM4WP_OPTION_BLACKLIST_UA => array(
|
224 |
-
"label" => __( "Universal Analytics Tag",
|
225 |
-
"description" => __( "",
|
226 |
"phase" => GTM4WP_PHASE_STABLE
|
227 |
),
|
228 |
GTM4WP_OPTION_BLACKLIST_ADADVISOR => array(
|
229 |
-
"label" => __( "AdAdvisor Tag",
|
230 |
-
"description" => __( "",
|
231 |
"phase" => GTM4WP_PHASE_STABLE
|
232 |
),
|
233 |
GTM4WP_OPTION_BLACKLIST_ADROLL => array(
|
234 |
-
"label" => __( "AdRoll Smart Pixel Tag",
|
235 |
-
"description" => __( "",
|
236 |
"phase" => GTM4WP_PHASE_STABLE
|
237 |
),
|
238 |
GTM4WP_OPTION_BLACKLIST_BIZO => array(
|
239 |
-
"label" => __( "Bizo Insight Tag",
|
240 |
-
"description" => __( "",
|
241 |
"phase" => GTM4WP_PHASE_STABLE
|
242 |
),
|
243 |
GTM4WP_OPTION_BLACKLIST_CLICKTALE => array(
|
244 |
-
"label" => __( "ClickTale Standard Tracking Tag",
|
245 |
-
"description" => __( "",
|
246 |
"phase" => GTM4WP_PHASE_STABLE
|
247 |
),
|
248 |
GTM4WP_OPTION_BLACKLIST_COMSCORE => array(
|
249 |
-
"label" => __( "comScore Unified Digital Measurement Tag",
|
250 |
-
"description" => __( "",
|
251 |
"phase" => GTM4WP_PHASE_STABLE
|
252 |
),
|
253 |
GTM4WP_OPTION_BLACKLIST_CUSTOMHTML => array(
|
254 |
-
"label" => __( "Custom HTML Tag",
|
255 |
-
"description" => __( "",
|
256 |
"phase" => GTM4WP_PHASE_STABLE
|
257 |
),
|
258 |
GTM4WP_OPTION_BLACKLIST_CUSTOMIMG => array(
|
259 |
-
"label" => __( "Custom Image Tag",
|
260 |
-
"description" => __( "",
|
261 |
"phase" => GTM4WP_PHASE_STABLE
|
262 |
),
|
263 |
GTM4WP_OPTION_BLACKLIST_DBLCLKCOUNT => array(
|
264 |
-
"label" => __( "DoubleClick Floodlight Counter Tag",
|
265 |
-
"description" => __( "",
|
266 |
"phase" => GTM4WP_PHASE_STABLE
|
267 |
),
|
268 |
GTM4WP_OPTION_BLACKLIST_DBLCLKSALES => array(
|
269 |
-
"label" => __( "DoubleClick Floodlight Sales Tag",
|
270 |
-
"description" => __( "",
|
271 |
"phase" => GTM4WP_PHASE_STABLE
|
272 |
),
|
273 |
GTM4WP_OPTION_BLACKLIST_MARIN => array(
|
274 |
-
"label" => __( "Marin Software Tag",
|
275 |
-
"description" => __( "",
|
276 |
"phase" => GTM4WP_PHASE_STABLE
|
277 |
),
|
278 |
GTM4WP_OPTION_BLACKLIST_MPLEXIFRAME => array(
|
279 |
-
"label" => __( "Mediaplex - IFRAME MCT Tag",
|
280 |
-
"description" => __( "",
|
281 |
"phase" => GTM4WP_PHASE_STABLE
|
282 |
),
|
283 |
GTM4WP_OPTION_BLACKLIST_MPLEXROI => array(
|
284 |
-
"label" => __( "Mediaplex - Standard IMG ROI Tag",
|
285 |
-
"description" => __( "",
|
286 |
"phase" => GTM4WP_PHASE_STABLE
|
287 |
),
|
288 |
GTM4WP_OPTION_BLACKLIST_MEDIA6DEG => array(
|
289 |
-
"label" => __( "Media6Degrees Universal Pixel Tag",
|
290 |
-
"description" => __( "",
|
291 |
"phase" => GTM4WP_PHASE_STABLE
|
292 |
),
|
293 |
GTM4WP_OPTION_BLACKLIST_TURNCONV => array(
|
294 |
-
"label" => __( "Turn Conversion Tracking Tag",
|
295 |
-
"description" => __( "",
|
296 |
"phase" => GTM4WP_PHASE_STABLE
|
297 |
),
|
298 |
GTM4WP_OPTION_BLACKLIST_TURNDATA => array(
|
299 |
-
"label" => __( "Turn Data Collection Tag",
|
300 |
-
"description" => __( "",
|
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",
|
308 |
-
"description" => __( "",
|
309 |
"phase" => GTM4WP_PHASE_STABLE
|
310 |
),
|
311 |
GTM4WP_OPTION_BLACKLIST_MACRO_CUSTOMJS => array(
|
312 |
-
"label" => __( "Custom JavaScript Macro",
|
313 |
-
"description" => __( "",
|
314 |
"phase" => GTM4WP_PHASE_STABLE
|
315 |
),
|
316 |
GTM4WP_OPTION_BLACKLIST_MACRO_CONSTANT => array(
|
317 |
-
"label" => __( "Constant Macro",
|
318 |
-
"description" => __( "",
|
319 |
"phase" => GTM4WP_PHASE_STABLE
|
320 |
),
|
321 |
GTM4WP_OPTION_BLACKLIST_MACRO_1STCOOKIE => array(
|
322 |
-
"label" => __( "First Party Cookie Macro",
|
323 |
-
"description" => __( "",
|
324 |
"phase" => GTM4WP_PHASE_STABLE
|
325 |
),
|
326 |
GTM4WP_OPTION_BLACKLIST_MACRO_EVENTNAME => array(
|
327 |
-
"label" => __( "Event Name Macro",
|
328 |
-
"description" => __( "",
|
329 |
"phase" => GTM4WP_PHASE_STABLE
|
330 |
),
|
331 |
GTM4WP_OPTION_BLACKLIST_MACRO_JSVAR => array(
|
332 |
-
"label" => __( "JavaScript Variable Macro",
|
333 |
-
"description" => __( "",
|
334 |
"phase" => GTM4WP_PHASE_STABLE
|
335 |
),
|
336 |
GTM4WP_OPTION_BLACKLIST_MACRO_DLAYERVAR => array(
|
337 |
-
"label" => __( "DataLayer Variable Macro",
|
338 |
-
"description" => __( "It is not recommended to blacklist this type of macro since most features of this plugin depend on dataLayer macros.",
|
339 |
"phase" => GTM4WP_PHASE_STABLE
|
340 |
),
|
341 |
GTM4WP_OPTION_BLACKLIST_MACRO_RANDOMNUM => array(
|
342 |
-
"label" => __( "Random Number Macro",
|
343 |
-
"description" => __( "",
|
344 |
"phase" => GTM4WP_PHASE_STABLE
|
345 |
),
|
346 |
GTM4WP_OPTION_BLACKLIST_MACRO_REFERRER => array(
|
347 |
-
"label" => __( "Referrer Macro",
|
348 |
-
"description" => __( "",
|
349 |
"phase" => GTM4WP_PHASE_STABLE
|
350 |
),
|
351 |
GTM4WP_OPTION_BLACKLIST_MACRO_URL => array(
|
352 |
-
"label" => __( "URL Macro",
|
353 |
-
"description" => __( "",
|
354 |
"phase" => GTM4WP_PHASE_STABLE
|
355 |
),
|
356 |
GTM4WP_OPTION_BLACKLIST_MACRO_AUTOEVENT => array(
|
357 |
-
"label" => __( "Auto-Event Variable Macro",
|
358 |
-
"description" => __( "",
|
359 |
"phase" => GTM4WP_PHASE_STABLE
|
360 |
)
|
361 |
);
|
362 |
|
363 |
$GLOBALS["gtm4wp_integratefieldtexts"] = array(
|
364 |
GTM4WP_OPTION_INTEGRATE_WPCF7 => array(
|
365 |
-
"label" => __( "Contact Form 7",
|
366 |
-
"description" => __( "Check this to include a dataLayer event after a successfull form submission.",
|
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",
|
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",
|
374 |
"plugintocheck" => "woocommerce/woocommerce.php"
|
375 |
)
|
376 |
*/
|
377 |
GTM4WP_OPTION_INTEGRATE_WCTRACKCLASSICEC => array(
|
378 |
-
"label" => __( "Track classic e-commerce",
|
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>.",
|
380 |
"phase" => GTM4WP_PHASE_STABLE,
|
381 |
"plugintocheck" => "woocommerce/woocommerce.php"
|
382 |
),
|
383 |
GTM4WP_OPTION_INTEGRATE_WCTRACKENHANCEDEC => array(
|
384 |
-
"label" => __( "Track enhanced e-commerce",
|
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>.",
|
386 |
"phase" => GTM4WP_PHASE_BETA,
|
387 |
"plugintocheck" => "woocommerce/woocommerce.php"
|
388 |
),
|
389 |
GTM4WP_OPTION_INTEGRATE_WCREMARKETING => array(
|
390 |
-
"label" => __( "AdWords Remarketing",
|
391 |
-
"description" => __( "Enable this to add Google AdWords dynamic remarketing variables to the dataLayer",
|
392 |
"phase" => GTM4WP_PHASE_STABLE,
|
393 |
"plugintocheck" => "woocommerce/woocommerce.php"
|
394 |
),
|
395 |
GTM4WP_OPTION_INTEGRATE_WCREMARKETINGSKU => array(
|
396 |
-
"label" => __( "Use SKU instead of ID",
|
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.",
|
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 />',
|
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",
|
415 |
echo "<br />";
|
416 |
-
printf( __( '* Browser, OS and Device data is provided using <a href="%s">WhichBrowser</a> library.',
|
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",
|
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.',
|
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.",
|
432 |
echo '<br />';
|
433 |
-
printf( __( 'Based on the script originaly posted to <a href="%s">Analytics Talk</a>',
|
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!",
|
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!",
|
442 |
echo '<br />';
|
443 |
-
_e( "Blacklisting of macros only work if you enable blacklist or whilelist of tags on the previous tab.",
|
444 |
echo '<br />';
|
445 |
-
_e( "Uncheck a row to blacklist a macro type.",
|
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:",
|
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.",
|
458 |
|
459 |
break;
|
460 |
}
|
461 |
|
462 |
case GTM4WP_ADMIN_GROUP_CREDITS: {
|
463 |
-
_e( "Some info about the author of this plugin",
|
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!
|
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)",
|
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)",
|
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)",
|
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",
|
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",
|
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)",
|
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)",
|
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",
|
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",
|
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
|
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!',
|
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
|
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!',
|
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",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 '-'!",
|
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',
|
663 |
'gtm4wp_admin_output_section',
|
664 |
GTM4WP_ADMINSLUG
|
665 |
);
|
666 |
|
667 |
add_settings_field(
|
668 |
GTM4WP_ADMIN_GROUP_GTMID,
|
669 |
-
__( 'Google Tag Manager ID',
|
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.",
|
676 |
)
|
677 |
);
|
678 |
|
679 |
add_settings_field(
|
680 |
GTM4WP_ADMIN_GROUP_PLACEMENT,
|
681 |
-
__( 'Container code placement',
|
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 <body> tag:<br /><code><?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?></code>",
|
688 |
)
|
689 |
);
|
690 |
|
691 |
add_settings_section(
|
692 |
GTM4WP_ADMIN_GROUP_INCLUDES,
|
693 |
-
__( 'Basic data',
|
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',
|
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',
|
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',
|
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',
|
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',
|
820 |
'gtm4wp_admin_output_section',
|
821 |
GTM4WP_ADMINSLUG
|
822 |
);
|
823 |
|
824 |
add_settings_field(
|
825 |
GTM4WP_ADMIN_GROUP_DATALAYER,
|
826 |
-
__( 'dataLayer variable name',
|
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",
|
833 |
)
|
834 |
);
|
835 |
|
836 |
add_settings_section(
|
837 |
GTM4WP_ADMIN_GROUP_CREDITS,
|
838 |
-
__( 'Credits',
|
839 |
'gtm4wp_admin_output_section',
|
840 |
GTM4WP_ADMINSLUG
|
841 |
);
|
842 |
|
843 |
add_settings_field(
|
844 |
GTM4WP_ADMIN_GROUP_INFO,
|
845 |
-
__( 'Author',
|
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',
|
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',
|
884 |
-
__( 'Google Tag Manager',
|
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" ,
|
899 |
-
"searchtabtitle" => __( "Search" ,
|
900 |
-
"visitortabtitle" => __( "Visitors" ,
|
901 |
-
"adwordstabtitle" => __( "AdWords" ,
|
902 |
-
"browsertabtitle" => __( "Browser/OS/Device" ,
|
903 |
-
"blocktagstabtitle" => __( "Blacklist tags" ,
|
904 |
-
"blockmacrostabtitle" => __( "Blacklist macros" ,
|
905 |
-
"wpcf7tabtitle" => __( "Contact Form 7" ,
|
906 |
-
"wctabtitle" => __( "WooCommerce" ,
|
907 |
-
"weathertabtitle" => __( "Weather data" ,
|
908 |
-
"generaleventstabtitle" => __( "General events" ,
|
909 |
-
"mediaeventstabtitle" => __( "Media events" ,
|
910 |
-
"depecratedeventstabtitle" => __( "
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>',
|
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§ion=google_analytics">in WooCommerce settings</a> by leaving Google Analytics ID field empty if you are using Google Analytics tags inside Google Tag Manager!',
|
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!',
|
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!',
|
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 <body> tag:<br /><code><?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?></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§ion=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.
|
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.
|
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(
|
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:',
|
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
|
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(
|
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
|
|
|
|
|
|
|
|
|
|
|
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
|
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.
|
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
|
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 |
-
|
|
|
|
|
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)",
|
326 |
-
$dataLayer[ "weatherDescription" ] = __( "(no weather data available)",
|
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 |
-
$
|
393 |
-
|
|
|
|
|
|
|
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 . '\',\'' . $
|
|
|
|
|
|
|
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" ),
|
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" ),
|
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" ),
|
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" ),
|
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" ),
|
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" ),
|
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" ),
|
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
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 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
|