Skip to content

Commit

Permalink
fix GA scripts url formatting (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
flashdesignory committed Oct 5, 2023
1 parent 9713dd8 commit ef38c23
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@ export function formatData(data: Data, args: Inputs) {
: null,
// Pass any required query params with user values for relevant scripts
scripts: data.scripts
? data.scripts.map((script) => ({
...script,
url: formatUrl(script.url, script.params, scriptUrlParamInputs),
}))
? data.scripts.map((script) => {
return script.url
? {
...script,
url: formatUrl(script.url, script.params, scriptUrlParamInputs),
}
: script;
})
: null,
};
}

0 comments on commit ef38c23

Please sign in to comment.