sendContentImpression
The sendContentImpression() method tracks content block impressions and sends the content name, piece, target and (optionally) the URL of the content.
Syntax
PiwikTracker.sharedInstance()?.sendContentImpression(
name: "name",
piece: "piece",
target: "target",
url: "url"
)[[PiwikTracker sharedInstance] sendContentImpressionWithName:@"name"
piece:@"piece"
target:@"target"
url:@"url"];Parameters
- name (string, required)
The name of the tracked content block. - piece (string, optional)
The piece of the tracked content block. Example: a creative, banner or video. - target (string, optional)
The target of the tracked content block. Example: a link in the content block. - url (string, optional)
The URL of the content itself, such as an image, video, audio, or text resource. If not provided, the SDK uses the current page URL.
Examples
To track a content block impression in your mobile app:
PiwikTracker.sharedInstance()?.sendContentImpression(
name: "gravel bikes collection",
piece: "banner",
target: "https://example.com/bikes/",
url: "https://example.com/banners/gravel-bikes.png"
)[[PiwikTracker sharedInstance]
sendContentImpressionWithName:@"gravel bikes collection"
piece:@"banner"
target:@"https://example.com/bikes/"
url:@"https://example.com/banners/gravel-bikes.png"];Notes
- Tracked impressions appear in Analytics > Reports > Content performance.
Related methods
Updated 2 months ago
Did this page help you?