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
📖 Amp-analytics: Document feature to write cookie to origin domain #19590
Conversation
cc @lannka |
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.
Nice work! a few nits.
@@ -695,6 +695,12 @@ Detials on setting up your linker configuration are outlined in [Linker ID Forwa | |||
|
|||
If you need to ingest this paramter, information on how this parameter is created is illistrated in [Linker ID Receiving](./linker-id-receiving.md). | |||
|
|||
#### Cookies | |||
|
|||
The `cookies` feature supports writing cookies to the origin domain by extracting [`QUERY_PARAM`](https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#query-parameter) and [`LINKER_PARAM`](./linker-id-receiving.md#linker-param) information from the document url. It can be used along with `linkers` features to perform ID syncing from AMP proxy domain to AMP pages on the publisher domain. |
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.
...syncing from the AMP proxied domain to AMP pages on a publisher's domain.
|
||
#### Configuration | ||
|
||
The `cookies` example configuration looks like |
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.
s/The/A
The `enabled` value can be used to override default vendor settings. | ||
|
||
##### Cookie Names | ||
Each key value within the `cookies` config object defines the cookie key, where its value needs to be an object. |
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.
Each key within the
cookies config object defines the cookie name. It's value needs to be an object containing a single key value pair. That key should be 'value', and its value should be the macro that determines the information stored in the cookie.
This is a really hard sentence because the keys name is value
. Hopefully someone else will help improve :)
##### Cookie Values | ||
Each cookie to write is defined by an object, where the value is defined by the required `value` field. | ||
|
||
Two Macros are supported for the `value` field. [`QUERY_PARAM`](https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#query-parameter) and [`LINKER_PARAM`](#linker-param). |
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.
macros
|
||
Two Macros are supported for the `value` field. [`QUERY_PARAM`](https://github.com/ampproject/amphtml/blob/master/spec/amp-var-substitutions.md#query-parameter) and [`LINKER_PARAM`](#linker-param). | ||
|
||
When there's error resoving the value, or the value is resolved to empty string. Nothing will be written to the 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.
s/when/if
When there's error resoving the value, or the value is resolved to empty string. Nothing will be written to the cookie. | ||
|
||
##### LINKER PARAM | ||
`LINKER_PARAM` takes two params, the `name` and the `value`. It will verify the checksum and read the `idName1*idValue1` key value pair from linker param. The `value` ('idValue1' here) will be returned. |
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.
s/params/arguments
s/from linker param/ from the linker param
also cc/ @CrystalFaith for docs magic |
@calebcordry Thank you for reviewing! Addressed comments. |
Closes #19589