Last active
September 20, 2022 03:57
-
-
Save chrisgalard/b54209cb02595d8b70c08b95c3bde238 to your computer and use it in GitHub Desktop.
Get clickfunnels data from localStorage into a global object named clickfunnelsData
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
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?