diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2015-08-28 11:15:57 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2015-08-31 09:33:27 +0300 |
commit | 84a945446e6655c7a15bcd2fc92aa5b1f30713a7 (patch) | |
tree | 2d7ffe8440c1210856ff4651e470a8e7caa78675 /js | |
parent | 96ae06bdeff514e579237776bd148794003af262 (diff) |
added method to piwik.js to log all detected content blocks
Diffstat (limited to 'js')
-rw-r--r-- | js/piwik.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/js/piwik.js b/js/piwik.js index b568d541a0..9d012d6941 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -455,7 +455,7 @@ if (typeof JSON2 !== 'object') { getTrackedContentImpressions, getCurrentlyVisibleContentImpressionsRequestsIfNotTrackedYet, contentInteractionTrackingSetupDone, contains, match, pathname, piece, trackContentInteractionNode, trackContentInteractionNode, trackContentImpressionsWithinNode, trackContentImpression, - enableTrackOnlyVisibleContent, trackContentInteraction, clearEnableTrackOnlyVisibleContent, + enableTrackOnlyVisibleContent, trackContentInteraction, clearEnableTrackOnlyVisibleContent, logAllContentBlocksOnPage, trackVisibleContentImpressions, isTrackOnlyVisibleContentEnabled, port, isUrlToCurrentDomain, isNodeAuthorizedToTriggerInteraction, replaceHrefIfInternalLink, getConfigDownloadExtensions, disableLinkTracking, substr, setAnyAttribute, wasContentTargetAttrReplaced, max, abs, childNodes, compareDocumentPosition, body, @@ -474,6 +474,7 @@ if (typeof JSON2 !== 'object') { /*members amd */ /*global console:true */ /*members error */ +/*members log */ // asynchronous tracker (or proxy) if (typeof _paq !== 'object') { @@ -5319,6 +5320,20 @@ if (typeof Piwik !== 'object') { }, /** + * Useful to debug content tracking. This method will log all detected content blocks to console + * (if the browser supports the console). It will list the detected name, piece, and target of each + * content block. + */ + logAllContentBlocksOnPage: function () { + var contentNodes = content.findContentNodes(); + var contents = content.collectContent(contentNodes); + + if (console !== undefined && console && console.log) { + console.log(contents); + } + }, + + /** * Records an event * * @param string category The Event Category (Videos, Music, Games...) |