Demo on how to force cache refresh with AMP
NB : all the follwing instructions are on node.js
| /** | |
| * Welcome to your Workbox-powered service worker! | |
| * | |
| * You'll need to register this file in your web app and you should | |
| * disable HTTP caching for this file too. | |
| * See https://goo.gl/nhQhGp | |
| * | |
| * The rest of the code is auto-generated. Please don't update this file | |
| * directly; instead, make changes to your Workbox build configuration | |
| * and re-run your build process. |
| <script> | |
| // more documentation : https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce | |
| ga('require', 'ecommerce'); // You have to require the ecommerce Addon | |
| ga('ecommerce:addTransaction', { | |
| 'id': '{{orderId}}', // Transaction ID. Required. | |
| 'revenue': '{{orderToal}}', // Grand Total. |
Demo on how to force cache refresh with AMP
NB : all the follwing instructions are on node.js
| <amp-list src="https://cors-anywhere.herokuapp.com/https://www.energiedirect.nl/api/v1/search?maxContentLength=150&maxresults=5&q=home" single-item items="Results" width="900" height="100" layout="responsive" > | |
| <template type="amp-mustache"> | |
| <p class="listitem">Dynamic DATA fetched with AJAX with amp-list 👍 : \{{Title}} </p> | |
| </template> | |
| </amp-list> | |
const getContent = async () => {
const response = await fetch('https://jsonplaceholder.typicode.com/posts');
// reponse is not correct
if (!response.ok) throw new Error(`We received an invalid response ${await response.text()}`);
const reponseJson = await response.json(); | gtag('event', 'purchase', { | |
| "transaction_id": "24.031608523954162", | |
| "affiliation": "Google online store", | |
| "value": 23.07, | |
| "currency": "USD", | |
| "tax": 1.24, | |
| "shipping": 0, | |
| "items": [ | |
| { | |
| "id": "P12345", |