Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Add in support for queueing and retrying failed Google Analytics pings. #47

Merged
merged 1 commit into from
Dec 21, 2014

Conversation

jeffposnick
Copy link
Contributor

R: @ebidel @devnook

This adds in logic to queue and retry failed Google Analytics requests, similar to what's implemented in the public sample.

It also updates the shed library to the latest version. (See #46, which tracks getting the library added as a real dependency that could be pulled in and updated automatically.)

Additionally, I added a wrapper library for IndexedDB, written by a Googler, Joshua Bell, and published in a gist. I need to reach out to him to figure out what his plansare with the library, and ideally we'd pull this in as an official dependency as well.

Longer term, I think I will refactor everything in shed-offline-analytics.js to be a standalone "plugin" library for shed that we could then pull in as another dependency, but I want to speak to @wibblymat about that first, and figured getting the basic functionality reviewed and integrated into this project first made sense.

@jeffposnick
Copy link
Contributor Author

(This closes #29)

shed.router.get('https://www.google-analytics.com/collect?:ignored', handleAnalyticsCollectionRequest);
shed.router.get('https://ssl.google-analytics.com/collect?:ignored', handleAnalyticsCollectionRequest);

shed.router.get('http://www.google-analytics.com/analytics.js', shed.networkFirst);
Copy link
Contributor

Choose a reason for hiding this comment

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

You have two of these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One's HTTP and one's HTTPS. As far as I could tell, I couldn't just register a domain independent of the protocol.

I'll sync up with Mat about that. It's similar to wibblymat/shed#17

Copy link
Contributor

Choose a reason for hiding this comment

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

SG

@ebidel
Copy link
Contributor

ebidel commented Dec 21, 2014

Reviewed

@jeffposnick
Copy link
Contributor Author

I copied over shed.js from the latest version of https://github.com/wibblymat/shed/blob/master/dist/shed.js, so the feedback for that file would need to go there.

(#46 tracks the fact that copying over this library manually isn't a good idea moving forward.)

@ebidel
Copy link
Contributor

ebidel commented Dec 21, 2014

Ack on #46. LGTM.

ebidel added a commit that referenced this pull request Dec 21, 2014
Add in support for queueing and retrying failed Google Analytics pings.
@ebidel ebidel merged commit 0a7eb0e into google:master Dec 21, 2014
@ebidel ebidel deleted the offline-analytics branch December 21, 2014 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants