logAllContentBlocksOnPage

The logAllContentBlocksOnPage() method logs in the console all content blocks present on a page. The content block is an HTML element tagged with the data-track-content attribute or the piwikTrackContent class.

Syntax

logAllContentBlocksOnPage()
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void

Example

To return all content blocks present on a page:

_paq.push(["logAllContentBlocksOnPage"]);
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void
logAllContentBlocksOnPage(): void

An example output:

[  
    {  
        "name": "bike-jump-video",  
        "piece": "https://example.com/big-jump.mp4",  
        "target": "https://example.com/bikes/"  
    }  
]

Notes

  • The content block is an HTML element tagged with the data-track-content attribute or the piwikTrackContent class.

Related methods