Error related to target url


#1

so getting following error:
the error is: error: string "" is too short (length: 0, required minimum: 1)n level: "error"n schema: {"loadingURI":"#","pointer":"/properties/targetUrl"}n instance: {"pointer":"/targetUrl"}n domain: "validation"n keyword: "minLength"n value: ""n found: 0n minLength: 1n
i.e.: zero-length target URLs in a field that snowplow expects to have at least one character

is there a way to modifiy the target url if there is no value. like ive shown:
{“schema”:“iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0”,“data”:{“schema”:“iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1”,“data”:{“targetUrl”:"",“elementId”:“cms_head_mobile_login”,“elementClasses”:[“hidden-md”,“hidden-lg”,“mobile-login-link”,“loggedout-only”],“elementTarget”:"",“elementContent”:“Log In”}}}

Regards,
Wayne


#2

@waspesi,

Link tracking is enabled by initializing enableLinkClickTracking method. It comes with a bunch of options to have a greater control which links to track.

You might wish to opt out tracking the links with empty href property using blacklist or filter function. Alternatively, you can specify some bogus value at the source if feasable.


#3

Thanks for raising @waspesi

I’ve created a ticket:

But yes - in the short term you will need to go with one of @ihor’s very pragmatic workarounds.