Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide ability to conditionally append key-value pair in amp-analytics #1701

Closed
britice opened this issue Feb 1, 2016 · 5 comments
Closed

Comments

@britice
Copy link

britice commented Feb 1, 2016

In some analytics platforms, when a parameter is empty the expected behavior is to not include that parameter in the request. For example, if there was an optional user-defined authors variable and the user left the value undefined, the request would not contain an authors parameter.

@rudygalfi
Copy link
Contributor

Is this blocking for your integration?

@britice
Copy link
Author

britice commented Feb 5, 2016

Is this blocking for your integration?

No. We've tested our systems with empty query params and everything is working as expected. At this time, this issue is not a high priority from Chartbeat's perspective.

@jmadler
Copy link
Contributor

jmadler commented Feb 11, 2016

@cramforce @avimehta LMK if this works:

I intend to implement this as a new boolean config option, skipEmptyUrlParams, which, when true, will omit "vars" and "extraUrlParams" if the value is anything other than a non-empty string.

@avimehta
Copy link
Contributor

vars can't be omitted like that. For example, lets say this is my config:

{
  "requests": { "foo": "/foo?bar=${baz}" },
  "vars": { "baz" = "" }
}

In this case, regardless of the value of `baz`, the parameter `bar` will always be there. It's value will be empty if `baz` is empty but it will still be sent over wire. 

@rudygalfi
Copy link
Contributor

This hasn't been discussed in awhile. Closing since it's pretty low in priority but we can reopen if anyone has a specific need for this.

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

No branches or pull requests

6 participants