amp-carousel: tracking events #4292

Closed
eike-hass opened this Issue Aug 1, 2016 · 21 comments

Projects

None yet

8 participants

@eike-hass
eike-hass commented Aug 1, 2016 edited

We would like to track interactions with an amp-carousel. Specifically we would like to track a user-triggered navigation with the amp-analytics component using the "IVW"-provider.

Currently it would probably be possible to achieve this using the json event-tracking notation to track clicks on the amp-carousel-button-next-element. This would ignore swipe gestures on mobile though.

Would it instead be possible to expose a carouselNavigation-event (maybe with the id of carousel instance attached, similar to the amp-lightbox component like carouselNavigation:my-carousel) to access in the amp-analytics configuration? Do you see other possibilities?

@ericlindley-g
Collaborator

This is something we've been thinking about—cc'ing some folks working on the carousel and analytics to think through how this might be done (I'm not sure if the new approach using native scroll would change the approach)

CC @sriramkrish85 @rudygalfi @avimehta

@dvoytenko
Collaborator

It's totally reasonable to add forward/back or prev/next events events to carousel for analytics, it's also very easy to do.

The event definition in analytics should be able to supply selector to match different carousels, which would allow customization of analytics events.

@dvoytenko
Collaborator

/cc @avimehta, can we supply selector for custom events?

@avimehta
Collaborator
avimehta commented Aug 1, 2016 edited

@dvoytenko Yes, that should be possible. You can define the variables you want to add support for (carouselId and carouselAction makes sense to me) and then pass those values back to the listener here. Visibility listener and scroll listener do this to provide a bunch of variables. The variables are documented here and here

@dvoytenko
Collaborator

@avimehta cool!

@ericlindley-g please prioritize accordingly.

@rudygalfi
Contributor

It's a bit of a different trigger definition that we've been discussing, but I wonder if you can use visibilitySpec to do this (https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/amp-analytics.md#page-visible-trigger-on-visible). For instance, if you have a carousel of amp-imgs then you could configure amp-analytics to watch the IDs within the carousel and fire hits when they become >1%, >10%, >50% visible (your choice).

@avimehta Would something like this work?

@ericlindley-g ericlindley-g added this to the Next milestone Aug 10, 2016
@ericlindley-g
Collaborator

Putting into "next", as this would be nice to make some progress on soon

@avimehta avimehta self-assigned this Aug 11, 2016
@avimehta avimehta removed their assignment Sep 28, 2016
@rudygalfi
Contributor

@sriramkrish85 Could you take a look at this?

@camelburrito
Collaborator

@rudygalfi - should the events be triggered for touch only or for both touch and button navigation? do we need to distinguish between touch and button nav?

@dvoytenko
Collaborator

Any forward/backward nav in carousel should trigger analytics events.

@rudygalfi
Contributor

Agree - either one. I don't think the how is important to call out. I'm thinking:

  • new trigger type for a carousel advancement of any kind
  • contextual substitution variable to tell you about which slide was swiped to

@eike-hass for further feedback on needs

@cramforce
Member

We'll need something like data-slide-id that is being made available on the trigger.

@avimehta
Collaborator

@sriramkrish85 #4292 (comment) should give you an idea of how to integrate with amp-analytics. Also see amp-access on how to define custom triggers.

@camelburrito
Collaborator

@cramforce data-slide-id => would this be the index of the slide?

@dvoytenko
Collaborator

I'd assume it'd be a author-set ID. We don't need data- attributes to send indexes :)

@camelburrito
Collaborator

i meant when the author does not set it :) what do we do with this

@cramforce
Member

index seems like a reasonable default

On Fri, Sep 30, 2016 at 2:45 PM, Sriram Krishnan notifications@github.com
wrote:

i meant when the author does not set it :) what do we do with this


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4292 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFeTwM4A8ds_sgu-eBnbs8Y14FIFTGbks5qvYMUgaJpZM4JZb5A
.

@eike-hass

sounds great! can we have a rough ETA?

@rudygalfi rudygalfi modified the milestone: Current, Next Oct 5, 2016
@rudygalfi
Contributor

FYI: Documentation PR is here: #5724.

Is there anything left on this?

@sebastianbenz
Contributor

Update the sample on ABE.

On Mon, Oct 31, 2016 at 4:57 PM Rudy Galfi notifications@github.com wrote:

FYI: Documentation PR is here: #5724
#5724.

Is there anything left on this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#4292 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAXOOG7G_XUXpJv2t0biMG_PZWkt_zGRks5q5h3wgaJpZM4JZb5A
.

@camelburrito
Collaborator

Nope. This is all done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment