Edit in GitHubLog an issue

ContentCard - DEPRECATED

An object representing the default content card created in the Adobe Journey Optimizer UI.

Content cards must be rendered by the app developer. Tracking a content card is done via calls to the track(_:withEdgeEventType:) API.

iOS Interface

Copied to your clipboard
@objc(AEPContentCard)
@objcMembers
public class ContentCard: NSObject, Codable {
/// Plain-text title for the content card
public let title: String
/// Plain-text body representing the content for the content card
public let body: String
/// String representing a URI that contains an image to be used for this content card
public let imageUrl: String?
/// Contains a URL to be opened if the user interacts with the content card
public let actionUrl: String?
/// Required if `actionUrl` is provided. Text to be used in title of button or link in content card
public let actionTitle: String?
...
}

Public functions


track(_:withEdgeEventType:)

Tracks an interaction with the given ContentCard.

Syntax

Copied to your clipboard
public func track(_ interaction: String? = nil, withEdgeEventType eventType: MessagingEdgeEventType)

Parameters

  • interaction - a custom String value to be recorded in the interaction
  • eventType - the MessagingEdgeEventType to be used for the ensuing Edge Event

Example

Copied to your clipboard
var contentCard: ContentCard
// tracking a display
contentCard.track(withEdgeEventType: .display)
// tracking a user interaction
contentCard.track("itemSelected", withEdgeEventType: .interact)

Android Interface

Copied to your clipboard
public class ContentCard {
// Plain-text title for the content card
private String title;
// Plain-text body representing the content for the content card
private String body;
// String representing a URI that contains an image to be used for this content card
private String imageUrl;
// Contains a URL to be opened if the user interacts with the content card
private String actionUrl;
// Required if actionUrl is provided. Text to be used in title of button or link in content card
private String actionTitle;
public String getTitle() { return title; }
public String getBody() { return body; }
@Nullable public String getImageUrl() { return imageUrl; }
@Nullable public String getActionUrl() { return actionUrl; }
@Nullable public String getActionTitle() { return actionTitle; }
...
}

Public functions


track

Tracks an interaction with the given ContentCard.

Syntax

Copied to your clipboard
public void track(final String interaction, final MessagingEdgeEventType eventType);

Parameters

  • interaction - a custom String value to be recorded in the interaction
  • eventType - the MessagingEdgeEventType to be used for the ensuing Edge Event

Example

Kotlin

Copied to your clipboard
// Get content card schema data from a PropositionItem object
val contentCardData = item?.contentCardSchemaData
val contentCard = contentCardData?.contentCard
// tracking a display
contentCard?.track(null, MessagingEdgeEventType.DISPLAY)
// tracking a user interaction
contentCard?.track("itemSelected", MessagingEdgeEventType.INTERACT)

Java

Copied to your clipboard
// Get content card schema data from a PropositionItem object
ContentCardSchemaData contentCardData = item.getContentCardSchemaData();
ContentCard contentCard = contentCardData.getContentCard();
// tracking a display
contentCard.track(null, MessagingEdgeEventType.DISPLAY);
// tracking a user interaction
contentCard.track("itemSelected", MessagingEdgeEventType.INTERACT);
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.