Reputation: 2523
string:
?utm_campaign=My+Campaign+Name&utm_medium=email
I want to turn this into an object:
{
utm_campaign: "My Campaign Name",
utm_medium: "email"
}
I'm trying to find a way to accomplish this with the querystring
module but can't seem to do it. Thank you!
Upvotes: 0
Views: 126
Reputation: 5263
Your problem is the &
. It should be &
otherwise it is treated as a regular character and not the special character separating query parameters.
Upvotes: 1