Skip to content

Conversation

@kdaswani
Copy link
Contributor

@kdaswani kdaswani commented Jun 25, 2020

https://segment.atlassian.net/browse/CC-6682

What does this PR do?

  • Removes trackComplete from Video Content Completed events and only calls chapterComplete on these events. It also adds trackComplete to Video Playback Completed events. This is in line with Adobe's documentation and also allows for parity between iOS, a.js, and Android.
  • Stringifies context data values which are booleans. The AA SDK tends to reject false boolean values when setting them on the window object. This does not break existing behavior since booleans are stringified when they're sent in the query string.
  • Reads session playhead values from window._segHBPlayheads if it exists. This solves an issue where the playhead is only updated when Video Content Playing (+ various others) events are tracked. To get around this, we allow video implementations to set the playhead value as often as possible without the need to trigger an event. Adobe Analytics expects the playhead to be updated at least every second.

Note: It does not seem like we pause the playhead ever in the a.js integration so I did not add this to Video Playback Completed.

Are there breaking changes in this PR?
No.

Is there parity with the server-side/android/iOS integration components (if applicable)?
iOS and a.js integrations are being updated with the same changes.

Does this require a new integration setting? If so, please explain how the new setting works
No.

Links to helpful docs and other external resources
Adobe docs
Core playback on Android: https://docs.adobe.com/content/help/en/media-analytics/using/sdk-implement/track-av-playback/track-core/track-core-javascript/track-core-js3.html
Chapters on Android: https://docs.adobe.com/content/help/en/media-analytics/using/sdk-implement/track-chapters/track-chapters-js/track-chapters-js3.html

@kdaswani kdaswani requested a review from gpsamson June 25, 2020 00:13
* Stringify context vals of type bool

* Add tests

* LINT
@gpsamson gpsamson changed the title [STRATCONN-272] update trackComplete logic on video events [STRATCONN-272, STRATCONN-265] Update trackComplete + Stringify context data Jun 26, 2020
@gpsamson gpsamson requested a review from briemcnally June 26, 2020 21:42
@gpsamson gpsamson changed the title [STRATCONN-272, STRATCONN-265] Update trackComplete + Stringify context data [STRATCONN-272, STRATCONN-265] Update trackComplete, Stringify context data, Support window-based playhead Jun 29, 2020
@gpsamson
Copy link
Contributor

Merged in #473 since only one version can be pinned to a source at a time.

@briemcnally
Copy link
Contributor

@gpsamson I just pulled this and tested with compiler.I passed video_genre: true and video_genre: video_genre in my contextValues in settings. It looks like false values are dropped whether or not they are stringified:

http://exchangepartnersegment.sc.omtrdc.net/b/ss/sgmbrietest/1/JS-2.20.0/s39562923460904?AQB=1&pccr=true&ndh=1&pf=1&t=29%2F5%2F2020%2016%3A55%3A52%201%20420&ts=2020-06-29T23%3A55%3A52.530Z&fid=20BABEE0B555DE7B-3E3F6227ACE3F571&ce=UTF-8&pageName=hello&g=http%3A%2F%2Flocalhost%3A3000%2F&c.&name=hello&path=%2F&url=http%3A%2F%2Flocalhost%3A3000%2F&.c&events=hello&s=1440x900&c=30&j=1.6&v=N&k=Y&bw=1440&bh=687&lrt=102&AQE=1

@gpsamson
Copy link
Contributor

gpsamson commented Jun 30, 2020

@briemcnally. That's odd. An event with video_genre: false is getting appended correctly for me:

http://exchangepartnersegment.sc.omtrdc.net/b/ss/sgmtest/1/JS-2.20.0/s44858310890909?AQB=1&ndh=1&pf=1&t=29%2F5%2F2020%2017%3A0%3A59%201%20420&ts=2020-06-30T00%3A00%3A59.700Z&mid=14465157012152281642777866379740413748&ce=UTF-8&pageName=AJS%20Testing%20Boilerplate&g=http%3A%2F%2Flocalhost%3A9000%2F&c.&url=http%3A%2F%2Flocalhost%3A9000%2F&video_genre=false&.c&events=event21&pe=lnk_o&pev2=CC&s=1680x1050&c=30&j=1.6&v=N&k=Y&bw=1439&bh=916&mcorgid=1234567ABC%40AdobeOrg&AQE=1

My context settings has video_genre: video_genre set and my a,.js call looks like:

  analytics.track('CC', {}, {
    video_genre: false
  })

The same is also true when the value is set to true.

@briemcnally
Copy link
Contributor

🤔 Wonder why it didn't work for me. I'll try it again later.

@gpsamson gpsamson merged commit 32b6ab4 into master Jul 13, 2020
@gpsamson gpsamson deleted the kiara/stratconn-272-update-trackcomplete branch July 13, 2020 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants