Skip to content
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

Added a very basic version of analytics for AMP. #982

Merged
merged 1 commit into from Dec 4, 2015

Conversation

avimehta
Copy link
Contributor

This is the first PR in a series of PRs to implement the spec outlined in #871.

In this commit, the tag parses the inline config and uses one builtin type to listen for
document.load events and sends a GET request when that happens. There is
primitive support for request templates and platform variables.

Things that are still to come:

  • Support for more platform variables (future PR)
  • Better instrumentation class (future PR)
  • User specified variables (future PR)
  • Readme.md (Future PR)

* limitations under the License.
*/

amp-analytics {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too late. We have to move this definition to amp.css.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in a previous commit.

@dvoytenko
Copy link
Contributor

Please reference in the description:

  1. Issue#
  2. Spec

{
"on": "TAP",
"request": "default",
"selector": ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does empty selector do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined behavior for now. I removed it since the implementation for that part is not ready yet. Once we start working on it, we can define what empty selector does.

*/
handleEvent_(trigger, event) {
const baseConfig = AnalyticsConfig[this.type_] || {};
const host = this.config_['host'] || baseConfig['host'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, why are we still doing this if it was merged above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed removing it. removed

@dvoytenko
Copy link
Contributor

Cool. I think we are pretty close. But one request: could you please respond to each comment we make? It makes it a lot easier to review.

@dvoytenko
Copy link
Contributor

Good. So, two more actions:

  1. Squash commits
  2. Please make sure you create the issue for the <script> thing.

Otherwise, LGTM.

So far, the tag parses the inline config and uses one builtin type to listen for
document.load events and sends a GET request when that happens. There is
premitive support for request templates and platform variables.

Things that are pending:
- Support for more platform variables (future PR)
- Better instrumentation class (future PR)
- User specified variables (future PR)
and more...
@dvoytenko
Copy link
Contributor

LGTM

dvoytenko added a commit that referenced this pull request Dec 4, 2015
Added a very basic version of analytics for AMP.
@dvoytenko dvoytenko merged commit 1c6c972 into ampproject:master Dec 4, 2015
@rudygalfi
Copy link
Contributor

👍

@cramforce
Copy link
Member

Woot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants