Plugin Directory

Changeset 1504124


Ignore:
Timestamp:
09/28/2016 01:02:21 AM (10 years ago)
Author:
adamlytics
Message:

Updates to ownership and new features

Location:
adobe-dtm
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • adobe-dtm/trunk/admin.php

    r1069079 r1504124  
    151151?>
    152152<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>
    154154    <h2><?php _e( 'Adobe DTM for WordPress Options' ); ?></h2>
    155155    <form action="options.php" method="post">
  • adobe-dtm/trunk/adobe-dtm.php

    r1382226 r1504124  
    22/*
    33Plugin Name: Adobe DTM for Wordpress
    4 Version: 1.3
    5 Plugin URI: http://www.searchdiscovery.com/adobe-dtm-for-wordpress/
     4Version: 1.4
     5Plugin URI: http://www.disruptiveadvertising.com/analytics/tag-management/adobe-dtm-wordpress-plugin/?utm_medium=social&utm_source=wordpress.org&utm_campaign=dtm_wp_plugin
    66Description: The first Adobe Dynamic Tag Management (DTM) plugin for WordPress.
    7 Author: Search Discovery
    8 Author URI: http://www.searchdiscovery.com
     7Author: Disruptive Advertising
     8Author URI: http://www.disruptiveadvertising.com/?utm_medium=social&utm_source=wordpress.org&utm_campaign=dtm_wp_plugin
    99*/
    1010
  • adobe-dtm/trunk/dtm.php

    r1382226 r1504124  
    2121  $isDisabled = false;
    2222  $disable = SDIDTM_get_options('disable');
    23   $perms = array();
     23  //$perms = array();
    2424  $guest = array();
    2525
     
    109109  }
    110110
    111   $date = array();
     111  $date = $modifiedDate = array();
    112112
    113113  if(isset($s['include-loggedin'])){
     
    131131      if (SDIDTM_include($s['include-posttitle'])) {
    132132        $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";
    133163      }
    134164  }
     
    204234    $date["month"] = get_the_date("m");
    205235    $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");
    206241  }
    207242
     
    222257
    223258        $date["year"] = get_the_date("Y");
     259        $modifiedDate["year"] = get_the_modified_date("Y");
    224260      } else if (is_month()) {
    225261        $dataLayer[$subPostLbl] = "month-" . get_post_type();
    226262        $date["year"] = get_the_date("Y");
    227263        $date["month"] = get_the_date("m");
     264
     265        $modifiedDate["year"] = get_the_modified_date("Y");
     266        $modifiedDate["month"] = get_the_modified_date("m");
    228267      } else if (is_day()) {
    229268        $dataLayer[$subPostLbl] = "day-" . get_post_type();
     
    233272        $date["month"] = get_the_date("m");
    234273        $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");
    235279      } else if (is_time()) {
    236280        $dataLayer[$subPostLbl] = "time-" . get_post_type();
     
    242286        $date["month"] = get_the_date("m");
    243287        $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");
    244293      }
    245294    }
     
    291340  }
    292341
     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
    293348  return $dataLayer;
    294349}
     
    300355  $dataLayer = array();
    301356  $dataLayer = (array)apply_filters("sdidtm_build_datalayer", $dataLayer);
     357  $dataLayer = SDIDTM_parseDataLayerConfig($dataLayer);
    302358
    303359  $_dtm_header_content = '';
     
    328384    $_dtm_tag.= '
    329385<script type="text/javascript">
    330 if(typeof _satellite != "undefined"){
     386if(typeof _satellite !== "undefined"){
    331387  _satellite.pageBottom();
    332388}
     
    335391
    336392  echo $_dtm_tag;
     393}
     394
     395
     396/*
     397 * Convert the dot notation into a nested array
     398 */
     399function 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
     422function 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;
    337445}
    338446
  • adobe-dtm/trunk/options.json

    r1067347 r1504124  
    11{
    2   "slug": "sdi-dtm",
     2  "slug": "disruptive-dtm",
    33  "prefix": {
    44    "config": "",
     
    88  "adminSections": {
    99    "config": "This plugin is intended to be used by those implementing Adobe DTM on the site. &nbsp;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.",
    1111    "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."
    1212  },
     
    3636  "dataLayer": [
    3737    {
     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    {
    3862      "label": "Post Type",
    3963      "name": "posttype",
     
    78102    },
    79103    {
     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    {
    80110      "label": "Post Title",
    81111      "name": "posttitle",
    82112      "default": "postTitle",
    83113      "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."
    84120    },
    85121    {
     
    165201  ],
    166202  "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 />"
    168204  }
    169205}
  • adobe-dtm/trunk/readme.txt

    r1382226 r1504124  
    1 === Search Discovery's Adobe DTM for Wordpress ===
     1=== Adobe DTM for Wordpress ===
    22Contributors: adamlytics
    3 Tags: adobe dynamic tag manager, adobe dtm, dtm, tag manager, google analytics, analytics, web analytics
     3Tags: adobe dynamic tag manager, adobe dtm, dtm, tag manager, google analytics, analytics, web analytics, adobe activation
    44Requires at least: 3.0.1
    5 Tested up to: 4.1
    6 Stable tag: 1.1
     5Tested up to: 4.6.1
     6Stable tag: 1.4
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    3535* Comment Count
    3636
    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.
     37The 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.
    3838
    3939== Installation ==
     
    4848
    4949== Changelog ==
     50
     51= 1.4 =
     52Configurable Data Layer JSON Schema
    5053
    5154= 1.3 =
Note: See TracChangeset for help on using the changeset viewer.