-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add managing user state docs #7433
Conversation
Suggest that you change terminology in image from "google.com" to something more generic and use google.com as example. |
The contents of this doc are discussed in much more detail in the new amp-managing-user-stage.md doc
ping @bpaduch @cramforce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor fixes for style; reviewed text b4.
### Display contexts for AMP pages | ||
|
||
You can think of AMP as a portable content format that enables content to be loaded fast anywhere. AMP documents can be displayed via three noteworthy contexts: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table would look better if you specified width, the old-fashioned HTML way (sorry, no markdown).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
converted to tables
spec/amp-managing-user-state.md
Outdated
|
||
**Case #1: Initial visit.** Upon first landing on the non-AMP page, there will be no cookie. If you checked for the cookie before one was set, you’d see no values set in the cookie corresponding to the `uid`: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all your code blocks, please specify a language - html, hs, or text
Example:
```text
blah,blah
...
@@ -0,0 +1,444 @@ | |||
# Managing non-authenticated user state with AMP | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TOC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
spec/amp-managing-user-state.md
Outdated
|
||
### Task 3: Process analytics pings from pages on the publisher origin | ||
|
||
Because of the setup performed in Tasks 1 and 2, when someone accesses the AMP version (from any context) or the non-AMP version on the publisher origin the analytics ping will use the same identifier. By following the guidance in Task 2 to choose a Client ID "scope" that was the same name as the name of the cookie you used in Task 1, AMP reuses the same cookie. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reference to specific Tasks, please link to them - helps the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
spec/amp-managing-user-state.md
Outdated
|
||
This is illustrated in the table below: | ||
|
||
| An analytics ping coming from... | ... looks like this: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This table would look better if you used HTML and specified width so that the 1st column isn't so squished, and hard to read.
Addressed all comments from @bpaduch |
* Add managing user state docs * Adding image resources * Delete placeholder for image folder * Add amp-managing-user-state.md * Delete cross-origin-tracking.md The contents of this doc are discussed in much more detail in the new amp-managing-user-stage.md doc * Change tables to HMTL, specify language of code blocks * Fix orig_user_id and user_id that didn't get updated * Added TOC; added some more code block type indicators * Add links for tasks
* Add managing user state docs * Adding image resources * Delete placeholder for image folder * Add amp-managing-user-state.md * Delete cross-origin-tracking.md The contents of this doc are discussed in much more detail in the new amp-managing-user-stage.md doc * Change tables to HMTL, specify language of code blocks * Fix orig_user_id and user_id that didn't get updated * Added TOC; added some more code block type indicators * Add links for tasks
|
||
Through usage of features that require Client ID, AMP will do the “under the hood” work to generate and store client ID values and surface them to the features that require them. One of the principal features that can use AMP’s Client ID is [amp-analytics](https://www.ampproject.org/docs/reference/components/amp-analytics), which happens to be exactly what we’ll need to implement our analytics use case example. | ||
|
||
On AMP pages, construct an analytics-analytics ping containing the Client ID: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rudygalfi what is analytics-analytics
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be amp-analytics. Thanks - I'll fix.
This PR will introduce a guide on managing non-authenticated user state in AMP.
Major sections are: