amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Better Grouping of Analytics requests from same Page View in large sites

Open micyeung opened this issue 8 years ago • 4 comments

Grouping requests from the same page view under the same ID is a common use case ([1],[2]), and is supported by PAGE_VIEW_ID.

Problem is that PAGE_VIEW_ID only has a small range 0-9999 - this is nowhere near enough. Large e-commerce sites with tens of millions of page views per day typically use UUIDs of 128 bits. A slight workaround would be a concatenation of CLIENT_ID and PAGE_VIEW_ID to reduce collisions, but that is still not nearly sufficient.

Possible Suggestions: Greatly extend the range of PAGE_VIEW_ID to accommodate use cases for large sites with a ton of page views? Introduce a new UUID?

micyeung avatar Jan 05 '18 06:01 micyeung

you can use :NAV_TIMING

hackshen avatar Jan 07 '18 15:01 hackshen

We went into this issue a couple of times. I think the current PAGE_VIEW_ID is a bit confusing and quite useless given its low entropy.

I want to see if there was any specific reason in the first place why we design this ID. If not, I suggest we introduce one with higher entropy.

A couple of options:

  • We update this value directly to a base64 with 128bit entropy, by taking the risk of breaking existing users (if the user think it's always a number or a length of < 6).
  • We introduce a new value and deprecate the old one. Tentative naming:
    • PAGEVIEW_ID
    • PAGE_VIEW_HID
  • We extend the current var to a function that takes a param: PAGE_VIEW_ID(128)

I'm leaning towards the 2nd option.

lannka avatar Jan 18 '18 20:01 lannka

Design review meeting notes

  • Low entropy PAGE_VIEW_ID was to avoid any privacy implication. But we think it's fine to introduce a high entropy one now.
  • will only support 64bit value encoded in URL safe Base64
  • naming: PAGE_VIEW_ID_64 or PAGE_VIEW_ID(64)

lannka avatar Jan 24 '18 21:01 lannka

Tracked as a GFI here: #13282

lannka avatar Feb 06 '18 00:02 lannka