I want to convert URL References to JSON and vice versa
(include:(and:List((or:(urn:li:adTargetingFacet:locations:List(urn:li:geo:102221843))
),(or:(urn:li:adTargetingFacet:skills:List(urn:li:skill:17))))))
Are there any js tools available?
Its hard to build and decode the output.
Refererences: https://learn.microsoft.com/en-us/linkedin/shared/references/v2/ads/targeting-criteria?context=linkedin%2Fmarketing%2Fcontext
Here is a surely optimizable regex replace chain who does the trick.
Given a targeting object adhering to this type:
This function takes it as input and converts it to the formatted targeting string
This json
outputs to