Skip to content

Commit

Permalink
updates impression payload sent to the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Greer committed Oct 16, 2023
1 parent 85bcc7d commit 9618b65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,13 @@ public void trackEmbeddedSession(@NonNull IterableEmbeddedSession session) {
sessionJson.put(IterableConstants.ITERABLE_EMBEDDED_SESSION_END, session.getEnd().getTime());

requestJSON.put(IterableConstants.ITERABLE_EMBEDDED_SESSION, sessionJson);
requestJSON.put(IterableConstants.ITERABLE_EMBEDDED_MESSAGE_PLACEMENT_ID, session.getPlacementId());

if (session.getImpressions() != null) {
JSONArray impressionsJsonArray = new JSONArray();
for (IterableEmbeddedImpression impression : session.getImpressions()) {
JSONObject impressionJson = new JSONObject();
impressionJson.put(IterableConstants.KEY_MESSAGE_ID, impression.getMessageId());
impressionJson.put(IterableConstants.KEY_PLACEMENT_ID, impression.getPlacementId());
impressionJson.put(IterableConstants.ITERABLE_EMBEDDED_IMP_DISPLAY_COUNT, impression.getDisplayCount());
impressionJson.put(IterableConstants.ITERABLE_EMBEDDED_IMP_DISPLAY_DURATION, impression.getDuration());
impressionsJsonArray.put(impressionJson);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public final class IterableConstants {
public static final String KEY_TEMPLATE_ID = "templateId";
public static final String KEY_MESSAGE_CONTEXT = "messageContext";
public static final String KEY_MESSAGE_ID = "messageId";
public static final String KEY_PLACEMENT_ID = "placementId";
public static final String KEY_TOKEN = "token";
public static final String KEY_TOTAL = "total";
public static final String KEY_UNSUB_CHANNEL = "unsubscribedChannelIds";
Expand Down

0 comments on commit 9618b65

Please sign in to comment.