Skip to content

Conversation

djih
Copy link
Member

@djih djih commented Apr 21, 2016

Before when fetching UTM data, we would generate a dictionary of utm keys and their values, and then sent it as an identify call once per session at the beginning of the session.

The problem is in the case where there are no UTM values present, we still generate this dictionary, but all of the keys have null/empty values. When we try to send the empty values on the identify, the event properties validator generates a bunch of warnings:

[Amplitude] WARNING: Property key "initial_utm_source" with invalid value type undefined, ignoring [Amplitude] WARNING: Property key "initial_utm_medium" with invalid value type undefined, ignoring [Amplitude] WARNING: Property key "initial_utm_campaign" with invalid value type undefined, ignoring [Amplitude] WARNING: Property key "initial_utm_term" with invalid value type undefined, ignoring [Amplitude] WARNING: Property key "initial_utm_content" with invalid value type undefined, ignoring [Amplitude] WARNING: Property key "utm_source" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_medium" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_term" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_content" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_name" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_source" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_medium" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_term" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_content" with invalid value type null, ignoring [Amplitude] WARNING: Property key "utm_name" with invalid value type null, ignoring

The solution is to only add utm keys/values to the utm data dictionary if the value is not null/empty. The logic already skips empty dictionaries.

Not super urgent as nothing is broken, but this will generate a bunch of garbage warnings in console. Will push this as v2.12.1

@paladin8
Copy link
Contributor

lgtm

@djih djih merged commit b8a32bc into master Apr 21, 2016
@djih djih deleted the only_save_nonnull_utm_properties branch April 21, 2016 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants