diff --git a/example/src/main/java/com/example/MainActivity.java b/example/src/main/java/com/example/MainActivity.java index ee286ef8..e45e721d 100644 --- a/example/src/main/java/com/example/MainActivity.java +++ b/example/src/main/java/com/example/MainActivity.java @@ -132,6 +132,7 @@ public void trackPlay(View view) { "http://example.com/thumbs/video-1234", "Awesome Video #1234", Calendar.getInstance(), + "post", 90 ); // NOTE: For videos embedded in an article, "url" should be the URL for that article. diff --git a/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java b/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java index 805902ab..c90c261c 100644 --- a/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java +++ b/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java @@ -17,7 +17,7 @@ */ public class ParselyMetadata { public ArrayList authors, tags; - public String link, section, thumbUrl, title; + public String link, section, thumbUrl, title, pageType; public Calendar pubDate; /** @@ -30,6 +30,7 @@ public class ParselyMetadata { * @param thumbUrl URL at which the main image for this content is located. * @param title The title of the content. * @param pubDate The date this piece of content was published. + * @param pageType The type of page being tracked. */ public ParselyMetadata( @Nullable ArrayList authors, @@ -38,7 +39,8 @@ public ParselyMetadata( @Nullable ArrayList tags, @Nullable String thumbUrl, @Nullable String title, - @Nullable Calendar pubDate + @Nullable Calendar pubDate, + @Nullable String pageType ) { this.authors = authors; this.link = link; @@ -47,6 +49,7 @@ public ParselyMetadata( this.thumbUrl = thumbUrl; this.title = title; this.pubDate = pubDate; + this.pageType = pageType; } /** @@ -77,6 +80,9 @@ public Map toMap() { if (this.pubDate != null) { output.put("pub_date_tmsp", this.pubDate.getTimeInMillis() / 1000); } + if (this.pageType != null) { + output.put("page_type", this.pageType); + } return output; } } diff --git a/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java b/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java index 874ead34..109233fe 100644 --- a/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java +++ b/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java @@ -34,9 +34,10 @@ public ParselyVideoMetadata( @Nullable String thumbUrl, @Nullable String title, @Nullable Calendar pubDate, + @Nullable String pageType, @NonNull int durationSeconds ) { - super(authors, videoId, section, tags, thumbUrl, title, pubDate); + super(authors, videoId, section, tags, thumbUrl, title, pubDate, pageType); if (videoId == null) { throw new NullPointerException("videoId cannot be null"); }