Add ability to specify extraUrlParams at trigger level
extraUrlParams behaves a lot like vars but can only appear at the top-level of a config. This means that every request in that config includes extra params. It may be desirable to not have extra URL params on certain requests, which could be done by doing the definition at the trigger level.
Open issue: How should precedence work? If you have the extraUrlParams defined at both the trigger and top-level, do you:
(a) ignore the top-level definition entirely
(b) naively combine the two configs, meaning allow duplicate definitions for a param to appear
(c) smartly combine the two configs, meaning don't allow a duplication definition for a param (and prefer the trigger-level definition)
/cc @avimehta @jmadler
cc @cory-work
FWIW, I would expect it to work like the vars, meaning option (c). For example, if I so something like
{
"requests": {
"test": "example.com?a=${a}&b=${b}&c=${c}"
},
"vars": {
"a": "outer",
"c": "outer"
},
"triggers": {
"trackButton1Click": {
"on": "click",
"selector": "#button1",
"request": "test",
"vars": {
"a": "inner",
"b": "inner"
}
}
}
}
- The generated URL is https://example.com?a=inner&b=inner&c=outer . The trigger-level is favored, but if not specified it falls back to the top-level.
@Tonsil That makes sense. I think that is the way we'll go.