Skip to content

Instantly share code, notes, and snippets.

@chrisgalard
Last active September 20, 2022 03:57
Show Gist options
  • Save chrisgalard/b54209cb02595d8b70c08b95c3bde238 to your computer and use it in GitHub Desktop.
Save chrisgalard/b54209cb02595d8b70c08b95c3bde238 to your computer and use it in GitHub Desktop.
Get clickfunnels data from localStorage into a global object named clickfunnelsData
function getClickfunnelsData() {
var clickfunnelsData = {};
var dataPoint = null;
var allKeys = Object.keys(localStorage);
var clickfunnelsKeys = allKeys.filter(function(key) {
// Return only keys that match the format garlic:hostname*>input.data
return key.match(/garlic:.+\*>input\.(.+)/) !== null;
});
clickfunnelsKeys.forEach(function(key) {
dataPoint = key.match(/garlic:.+\*>input\.(.+)/)[1];
clickfunnelsData[dataPoint] = localStorage.getItem(key);
});
return clickfunnelsData;
}
@jlaurie87
Copy link

Hi, I am looking to use localstorage with clickfunnels to take Name and email field from funnel and on submit, prefill a form.

The form is a gravity form and I can prefilled through url parameters. Is it possible use this code to generate a redirect url by chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment