com.vaadin.polymer.platinum.widget.PlatinumSwOfflineAnalytics Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from platinum-sw project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.platinum.widget;
import com.vaadin.polymer.platinum.*;
import com.vaadin.polymer.*;
import com.vaadin.polymer.elemental.*;
import com.vaadin.polymer.PolymerWidget;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;
/**
* The <platinum-sw-offline-analytics>
element registers a service worker handler to
intercepts requests for Google Analytics pings.
* If the HTTP GET for the ping is successful (because the browser is online), then everything
proceeds as it normally would. If the HTTP GET fails, the ping request is saved to IndexedDB, and each time the service worker
script starts up it will attempt to “replay” those saved ping requests, giving up after one day
has passed.
* The qt
URL parameter is automatically added to the replayed HTTP GET and set to the number of
milliseconds that has passed since the initial ping request was attempted, to ensure that the
original time attribution is correct.
* <platinum-sw-offline-analytics>
does not take care of setting up Google Analytics on your
page, and assumes that you have properly configured
Google Analytics tracking code registered elsewhere on your page.
* Since <platinum-sw-offline-analytics>
is only useful if the page that is being tracked with
Google Analytics works offline, it’s best used in conjunction with the <platinum-sw-cache>
element, which takes care of caching your site’s resources and serving them while offline.
* A basic configuration is
* <platinum-sw-register auto-register>
* <platinum-sw-offline-analytics></platinum-sw-offline-analytics>
* <platinum-sw-cache></platinum-sw-cache>
* </platinum-sw-register>
*
*
*
*/
public class PlatinumSwOfflineAnalytics extends PolymerWidget {
/**
* Default Constructor.
*/
public PlatinumSwOfflineAnalytics() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public PlatinumSwOfflineAnalytics(String html) {
super(PlatinumSwOfflineAnalyticsElement.TAG, PlatinumSwOfflineAnalyticsElement.SRC, html);
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public PlatinumSwOfflineAnalyticsElement getPolymerElement() {
return (PlatinumSwOfflineAnalyticsElement) getElement();
}
}