track().impression
The track().impression() method tracks the impressions of a content block and passes data about the content name, piece and target.
Syntax
TrackHelper.track()
.impression("contentName")
.piece("contentPiece")
.target("contentTarget")
.with(tracker)TrackHelper.track()
.impression("contentName")
.piece("contentPiece")
.target("contentTarget")
.with(getTracker());Parameters
contentName (string, required)
The name of the tracked content block.
contentPiece (string, optional)
The piece of the tracked content block. Example: a creative, banner or video.
contentTarget (string, optional)
The target of the tracked content block. Example: a link in the content block.
contentUrl (string, optional)
The URL of the page where the content block is displayed.
Examples
To track the impression of a content block on your mobile app:
val tracker: Tracker = (application as PiwikApplication).tracker
TrackHelper.track()
.impression("gravel bikes collection")
.piece("banner")
.target("https://example.com/bikes/")
.with(tracker)Tracker tracker = ((PiwikApplication) getApplication()).getTracker();
TrackHelper.track()
.impression("gravel bikes collection")
.piece("banner")
.target("https://example.com/bikes/")
.with(tracker);Notes
- Tracked impressions will be visible in Analytics > Reports > Content performance.
Related methods
Updated 4 days ago