Changeset 1504124
- Timestamp:
- 09/28/2016 01:02:21 AM (10 years ago)
- Location:
- adobe-dtm
- Files:
-
- 2 added
- 7 edited
-
assets/banner-1544x500.jpg (added)
-
assets/banner-772x250.jpg (added)
-
assets/icon-128x128.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
trunk/admin.php (modified) (1 diff)
-
trunk/adobe-dtm.php (modified) (1 diff)
-
trunk/dtm.php (modified) (11 diffs)
-
trunk/options.json (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
adobe-dtm/trunk/admin.php
r1069079 r1504124 151 151 ?> 152 152 <div class="wrap"> 153 <div id="sdidtm-icon" style="background-image: url(<?php echo $sdidtm_url; ?>images/ sdi-dtm.png); height: 50px; width: 58px;"><br /></div>153 <div id="sdidtm-icon" style="background-image: url(<?php echo $sdidtm_url; ?>images/da-dtm.png); height: 81px; width: 280px;"><br /></div> 154 154 <h2><?php _e( 'Adobe DTM for WordPress Options' ); ?></h2> 155 155 <form action="options.php" method="post"> -
adobe-dtm/trunk/adobe-dtm.php
r1382226 r1504124 2 2 /* 3 3 Plugin Name: Adobe DTM for Wordpress 4 Version: 1. 35 Plugin URI: http://www. searchdiscovery.com/adobe-dtm-for-wordpress/4 Version: 1.4 5 Plugin URI: http://www.disruptiveadvertising.com/analytics/tag-management/adobe-dtm-wordpress-plugin/?utm_medium=social&utm_source=wordpress.org&utm_campaign=dtm_wp_plugin 6 6 Description: The first Adobe Dynamic Tag Management (DTM) plugin for WordPress. 7 Author: Search Discovery8 Author URI: http://www. searchdiscovery.com7 Author: Disruptive Advertising 8 Author URI: http://www.disruptiveadvertising.com/?utm_medium=social&utm_source=wordpress.org&utm_campaign=dtm_wp_plugin 9 9 */ 10 10 -
adobe-dtm/trunk/dtm.php
r1382226 r1504124 21 21 $isDisabled = false; 22 22 $disable = SDIDTM_get_options('disable'); 23 $perms = array();23 //$perms = array(); 24 24 $guest = array(); 25 25 … … 109 109 } 110 110 111 $date = array();111 $date = $modifiedDate = array(); 112 112 113 113 if(isset($s['include-loggedin'])){ … … 131 131 if (SDIDTM_include($s['include-posttitle'])) { 132 132 $dataLayer[SDIDTM_value($data['posttitle'])] = strip_tags(wp_title("|", false, "right")); 133 } 134 } 135 136 if(isset($s['include-postexcerpt'])){ 137 if (SDIDTM_include($s['include-postexcerpt'])) { 138 $dataLayer[SDIDTM_value($data['postexcerpt'])] = strip_tags(get_the_excerpt()); 139 } 140 } 141 142 if(isset($s['include-sitetitle'])){ 143 if (SDIDTM_include($s['include-sitetitle'])) { 144 $dataLayer[SDIDTM_value($data['sitetitle'])] = get_bloginfo('name', 'display'); 145 } 146 } 147 148 if(isset($s['include-siteurl'])){ 149 if (SDIDTM_include($s['include-siteurl'])) { 150 $dataLayer[SDIDTM_value($data['siteurl'])] = get_bloginfo('url', 'display'); 151 } 152 } 153 154 if(isset($s['include-sitedescription'])){ 155 if (SDIDTM_include($s['include-sitedescription'])) { 156 $dataLayer[SDIDTM_value($data['sitedescription'])] = get_bloginfo('description', 'display'); 157 } 158 } 159 160 if(isset($s['include-siteplatform'])){ 161 if (SDIDTM_include($s['include-siteplatform'])) { 162 $dataLayer[SDIDTM_value($data['siteplatform'])] = "WordPress"; 133 163 } 134 164 } … … 204 234 $date["month"] = get_the_date("m"); 205 235 $date["day"] = get_the_date("d"); 236 237 $modifiedDate["date"] = get_the_modified_date(); 238 $modifiedDate["year"] = get_the_date("Y"); 239 $modifiedDate["month"] = get_the_date("m"); 240 $modifiedDate["day"] = get_the_date("d"); 206 241 } 207 242 … … 222 257 223 258 $date["year"] = get_the_date("Y"); 259 $modifiedDate["year"] = get_the_modified_date("Y"); 224 260 } else if (is_month()) { 225 261 $dataLayer[$subPostLbl] = "month-" . get_post_type(); 226 262 $date["year"] = get_the_date("Y"); 227 263 $date["month"] = get_the_date("m"); 264 265 $modifiedDate["year"] = get_the_modified_date("Y"); 266 $modifiedDate["month"] = get_the_modified_date("m"); 228 267 } else if (is_day()) { 229 268 $dataLayer[$subPostLbl] = "day-" . get_post_type(); … … 233 272 $date["month"] = get_the_date("m"); 234 273 $date["day"] = get_the_date("d"); 274 275 $modifiedDate["date"] = get_the_modified_date('Y-m-d\TH:i:sO'); 276 $modifiedDate["year"] = get_the_modified_date("Y"); 277 $modifiedDate["month"] = get_the_modified_date("m"); 278 $modifiedDate["day"] = get_the_modified_date("d"); 235 279 } else if (is_time()) { 236 280 $dataLayer[$subPostLbl] = "time-" . get_post_type(); … … 242 286 $date["month"] = get_the_date("m"); 243 287 $date["day"] = get_the_date("d"); 288 289 $modifiedDate["date"] = get_the_modified_date('Y-m-d\TH:i:sO'); 290 $modifiedDate["year"] = get_the_modified_date("Y"); 291 $modifiedDate["month"] = get_the_modified_date("m"); 292 $modifiedDate["day"] = get_the_modified_date("d"); 244 293 } 245 294 } … … 291 340 } 292 341 342 if(isset($s['include-modifieddate'])){ 343 if (SDIDTM_include($s['include-modifieddate']) && count($modifiedDate)>0) { 344 $dataLayer[SDIDTM_value($data['modifieddate'])] = $modifiedDate; 345 } 346 } 347 293 348 return $dataLayer; 294 349 } … … 300 355 $dataLayer = array(); 301 356 $dataLayer = (array)apply_filters("sdidtm_build_datalayer", $dataLayer); 357 $dataLayer = SDIDTM_parseDataLayerConfig($dataLayer); 302 358 303 359 $_dtm_header_content = ''; … … 328 384 $_dtm_tag.= ' 329 385 <script type="text/javascript"> 330 if(typeof _satellite != "undefined"){386 if(typeof _satellite !== "undefined"){ 331 387 _satellite.pageBottom(); 332 388 } … … 335 391 336 392 echo $_dtm_tag; 393 } 394 395 396 /* 397 * Convert the dot notation into a nested array 398 */ 399 function SDIDTM_parseDataLayerConfig($config) { 400 if (is_array($config) && sizeof($config) > 0) { 401 $dataLayer = array(); 402 403 foreach($config as $key => $value){ 404 if ( isset($dataLayer[$key]) ) { 405 if ( is_array($dataLayer[$key]) && sizeof($dataLayer[$key]) === sizeof($dataLayer[$key], COUNT_RECURSIVE)) { 406 $dataLayer[$key][] = $value; 407 }else{ 408 $dataLayer[$key] = $value; 409 } 410 } else { 411 $dataLayer = array_merge_recursive($dataLayer, SDIDTM_createElement($key, $value)); 412 } 413 } 414 }else{ 415 $dataLayer = $config; 416 } 417 418 return $dataLayer; 419 } 420 421 // recursive function to construct an object from dot-notation 422 function SDIDTM_createElement($key, $value) { 423 $element = array(); 424 $key = (string)$key; 425 // if the key is a property 426 if (strpos($key, '.') !== false) { 427 // extract the first part with the name of the object 428 $list = explode('.', $key); 429 // the rest of the key 430 $sub_key = substr_replace($key, "", 0, strlen($list[0])+1); 431 // create the object if it doesnt exist 432 if (!$element[$list[0]]) $element[$list[0]] = array(); 433 // if the key is not empty, create it in the object 434 if ($sub_key !== '') { 435 $element[$list[0]] = SDIDTM_createElement($sub_key, $value); 436 } else { 437 //var_export('SDIDTM_createElement :: empty property in key "'. $key .'"'); 438 } 439 } 440 // just normal key 441 else { 442 $element[$key] = $value; 443 } 444 return $element; 337 445 } 338 446 -
adobe-dtm/trunk/options.json
r1067347 r1504124 1 1 { 2 "slug": " sdi-dtm",2 "slug": "disruptive-dtm", 3 3 "prefix": { 4 4 "config": "", … … 8 8 "adminSections": { 9 9 "config": "This plugin is intended to be used by those implementing Adobe DTM on the site. Please be aware to test on all pages before deploying to production.", 10 "dataLayer": "Use the meta data available within WordPress to easily build a data layer that you can use with DTM. Check an item to add it to the data layer. You can also configure the name of the item in the data layer. ",10 "dataLayer": "Use the meta data available within WordPress to easily build a data layer that you can use with DTM. Check an item to add it to the data layer. You can also configure the name of the item in the data layer. Sub-objects are supported, use dot notation if you wish to create elements as sub-objects.", 11 11 "disable": "Disable DTM from loading for anyone logged in or not logged in. A great feature for disabling tracking for employees, or disabling tracking for guests while the implementation is underway." 12 12 }, … … 36 36 "dataLayer": [ 37 37 { 38 "label": "Site Title", 39 "name": "sitetitle", 40 "default": "siteTitle", 41 "desc": "Check this option to include the Site Title." 42 }, 43 { 44 "label": "Site Description / Tagline", 45 "name": "sitedescription", 46 "default": "siteDescription", 47 "desc": "Check this option to include the Site Description / Tagline." 48 }, 49 { 50 "label": "Site Platform", 51 "name": "siteplatform", 52 "default": "sitePlatform", 53 "desc": "Check this option to include the platform name: 'WordPress'." 54 }, 55 { 56 "label": "Site URL", 57 "name": "siteurl", 58 "default": "siteUrl", 59 "desc": "Check this option to include the Site URL." 60 }, 61 { 38 62 "label": "Post Type", 39 63 "name": "posttype", … … 78 102 }, 79 103 { 104 "label": "Modified Date", 105 "name": "modifieddate", 106 "default": "pageModifiedDate", 107 "desc": "Check this option to include the last modified date of the post. This will be an object with 4 sub objects: date, year, month, and day." 108 }, 109 { 80 110 "label": "Post Title", 81 111 "name": "posttitle", 82 112 "default": "postTitle", 83 113 "desc": "Check this option to include the meta title of the post/page." 114 }, 115 { 116 "label": "Post Excerpt", 117 "name": "postexcerpt", 118 "default": "postExcerpt", 119 "desc": "Check this option to include the excerpt of the post/page." 84 120 }, 85 121 { … … 165 201 ], 166 202 "credits": { 167 "desc": "<strong>Adam Haining</strong><br />Website: <a href='http://www. searchdiscovery.com/?cid=wordpress:dtm_plugin&utm_source=wordpress&utm_content=dtm_plugin&utm_campaign=dtm_wordpress_plugin' target='_blank'>www.searchdiscovery.com</a><br /><a href='http://www.searchdiscovery.com/satellite/blog/adobe-dtm-plugin-wordpress/?cid=wordpress:dtm_plugin_help&utm_source=wordpress&utm_content=dtm_plugin_help&utm_campaign=dtm_wordpress_plugin' target='_blank'>Help With the Plugin</a><br /><a href='https://www.linkedin.com/in/adamhaining' target='_blank'>LinkedIn</a><br /><a href='http://www.linkedin.com/company/search-discovery' target='_blank'>Search Discovery on LinkedIn</a><br />"203 "desc": "<strong>Adam Haining</strong><br />Website: <a href='http://www.disruptiveadvertising.com/?utm_medium=social&utm_source=wordpress.org&utm_campaign=dtm_wp_plugin' target='_blank'>www.disruptiveadvertising.com</a><br /><a href='http://www.disruptiveadvertising.com/analytics/tag-management/adobe-dtm-wordpress/?utm_medium=social&utm_source=wordpress.org&utm_campaign=dtm_wp_plugin' target='_blank'>Help With the Plugin</a><br /><a href='https://www.linkedin.com/in/adamhaining' target='_blank'>LinkedIn</a><br /><br />" 168 204 } 169 205 } -
adobe-dtm/trunk/readme.txt
r1382226 r1504124 1 === Search Discovery'sAdobe DTM for Wordpress ===1 === Adobe DTM for Wordpress === 2 2 Contributors: adamlytics 3 Tags: adobe dynamic tag manager, adobe dtm, dtm, tag manager, google analytics, analytics, web analytics 3 Tags: adobe dynamic tag manager, adobe dtm, dtm, tag manager, google analytics, analytics, web analytics, adobe activation 4 4 Requires at least: 3.0.1 5 Tested up to: 4. 16 Stable tag: 1. 15 Tested up to: 4.6.1 6 Stable tag: 1.4 7 7 License: GPLv3 8 8 License URI: http://www.gnu.org/licenses/gpl.html … … 35 35 * Comment Count 36 36 37 The plugin will also allow you to rename the JavaScript variable for the data layer, as well as each sub object in the data layer. 37 The plugin will also allow you to rename the JavaScript variable for the data layer, as well as each sub object in the data layer. You can use dot notation when defining the sub-objects, and it will allow you to build the data layer with sub-objects. 38 38 39 39 == Installation == … … 48 48 49 49 == Changelog == 50 51 = 1.4 = 52 Configurable Data Layer JSON Schema 50 53 51 54 = 1.3 =
Note: See TracChangeset
for help on using the changeset viewer.