This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Sends the submitted payload of a Google Form to Segment. | |
Steps to install: | |
1. modify the script below to include your base64 encoded write key (with a colon at the end!) per the Segment docs | |
2. set the event name you want | |
3. add as a script to your Google Form (More > Script Editor) | |
4. add "https://www.googleapis.com/auth/script.external_request" & "https://www.googleapis.com/auth/forms" to your oauthScopes key in appscript.json | |
5. set your script trigger to onFormSubmit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CALL_API } from 'redux-api-middleware' | |
export function fetchLocations() { | |
return { | |
[CALL_API]: { | |
endpoint: 'http://api.somesite.com/api/locations', | |
method: 'GET', | |
// Don't have to manually add the Authorization header to every request. | |
headers: { 'Content-Type': 'application/json' }, | |
types: ['REQUEST', 'SUCCESS', 'FAILURE'] |