Amphtml: amp-carousel: tracking events

Created on 1 Aug 2016  Â·  21Comments  Â·  Source: ampproject/amphtml

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?

Feature Request analytics

Most helpful comment

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

All 21 comments

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

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.

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

@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

@avimehta cool!

@ericlindley-g please prioritize accordingly.

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?

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

@sriramkrish85 Could you take a look at this?

@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?

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

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

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

@sriramkrish85 https://github.com/ampproject/amphtml/issues/4292#issuecomment-236714336 should give you an idea of how to integrate with amp-analytics. Also see amp-access on how to define custom triggers.

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

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

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

index seems like a reasonable default

On Fri, Sep 30, 2016 at 2:45 PM, Sriram Krishnan [email protected]
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
https://github.com/ampproject/amphtml/issues/4292#issuecomment-250859908,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFeTwM4A8ds_sgu-eBnbs8Y14FIFTGbks5qvYMUgaJpZM4JZb5A
.

sounds great! can we have a rough ETA?

FYI: Documentation PR is here: #5724.

Is there anything left on this?

Update the sample on ABE.

On Mon, Oct 31, 2016 at 4:57 PM Rudy Galfi [email protected] wrote:

FYI: Documentation PR is here: #5724
https://github.com/ampproject/amphtml/pull/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
https://github.com/ampproject/amphtml/issues/4292#issuecomment-257351753,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAXOOG7G_XUXpJv2t0biMG_PZWkt_zGRks5q5h3wgaJpZM4JZb5A
.

Nope. This is all done!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edhollinghurst picture edhollinghurst  Â·  3Comments

radiovisual picture radiovisual  Â·  3Comments

sryze picture sryze  Â·  3Comments

akshaylive picture akshaylive  Â·  3Comments

westonruter picture westonruter  Â·  3Comments