Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Audience
English French
English French

"Tagging" recs clicks for Piano Insight

In Piano Insight, page views from content recommendation clicks include the custom parameter cx_source=cxrecs.

You can also add your own custom parameters as query parameters on the click URL.

Example: use this with itemDefaults to distinguish clicks from different branches
(similar to tag paths in the Content applications).

image-20211217-131106.png
<!--%
var items = data.response.items;
for (var i = 0; i < items.length; i++) {
  var item = items[i];
  var itemsrc = item.src || 'generic'; # get the injected item key/value or set a default
  var tagged_click_url = item.click_url + '?cx_tag=' + itemsrc; # add it as a custom parameter to the click_url
  %-->
  <div class="item">
    <!-- use the tagged_click_url instead of item.click_url -->
    <a class="allclick" tmp:id="{{cX.clickTracker(tagged_click_url)}}" tmp:href="{{item.url}}" tmp:target="_top">
      <!--%
      cX.renderContainedImage({
        container: { width: 321, height: 160 },
        image: { src: item.dominantthumbnail, dimensions: item.dominantthumbnaildimensions }
      });
      %-->
      <h3>{{item.title}}</h3>
    </a>
  </div>
  <!--%
}
%-->


Last updated: