sendContentInteraction

The sendContentInteraction() method tracks content block interactions and sends the content name, interaction type, piece, and target.

Syntax

PiwikTracker.sharedInstance()?.sendContentInteraction(
    name: "name",
    interaction: "interaction",
    piece: "piece",
    target: "target"
)
[[PiwikTracker sharedInstance] sendContentInteractionWithName:@"name"
                                                  interaction:@"interaction"
                                                        piece:@"piece"
                                                       target:@"target"];

Parameters

  • name (string, required)
    The name of the tracked content block.
  • interaction (string, required)
    The type of interaction with the tracked content block. Example: tap or click.
  • 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.

Examples

To track content block interactions in your mobile app:

PiwikTracker.sharedInstance()?.sendContentInteraction(
    name: "gravel bikes collection",
    interaction: "tap",
    piece: "banner",
    target: "https://example.com/bikes/"
)
[[PiwikTracker sharedInstance]
    sendContentInteractionWithName:@"gravel bikes collection"
                       interaction:@"tap"
                             piece:@"banner"
                            target:@"https://example.com/bikes/"];

Notes

  • Tracked interactions appear in Analytics > Reports > Content performance.
  • Use the same name and piece values as in sendContentImpression() when tracking impressions for the same content so conversion rates can be calculated correctly.

Related methods


Did this page help you?