/
githubmirror
/
amphtml
Обзор
Документация
Войти
/
githubmirror
/
amphtml
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/manual/amp-analytics/default-data-vars.html
52 строки
2 KB
Caroline Liu
♿ Apply `lang="en"` to relevant snippets in `test/` (#34768)
11 июн 2021, 16:59
Не верифицирован
11 июн 2021, 16:59
c3608d2
Код
Авторство
О чём код?
<!doctype html> <html ⚡ lang="en"> <head> <meta charset="utf-8"> <title>My AMP Page</title> <link rel="canonical" href="self.html" /> <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script> <script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script> <script async src="https://cdn.ampproject.org/v0.js"></script> <meta name="viewport" content="width=device-width,minimum-scale=1"> <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> </head> <body> <h2>Testing feature</h2> <p>data-vars should be passed to analytics and can be used as a filter</p> <ul> <li> Add to cart should send a ping to exampl.test </li> <li> View cart should NOT send an analytics ping </li> </ul> <form data-vars-add-to-cart-form=true method="post" action-xhr="https://example.com/subscribe" target="_top"> <button type="submit">Add to cart</button> </form> <form data-vars-add-to-cart-form=false method="post" action-xhr="https://example.com/subscribe" target="_top"> <button type="submit">View Cart</button> </form> <amp-analytics> <script type="application/json"> { "requests": { "test": "https://example.test?test-form" }, "triggers":{ "trackForm":{ "on":"amp-form-submit", "enabled": "${addToCartForm}", "request":"test" } } } </script> </amp-analytics> </body> </html>