I'm at home so I don't have anything to test this with, but I think you're missing the ^replace_keywords modifier (this tells it to replace what's in the '{}'). So you'd need something like:
%asset_metadata_USER.facebook^replace_keywords:notempty:<li><a href="{asset_metadata_USER.facebook}">Facebook</a></li>%
Matrix keywords don't have a very elegant if/else logic system, at least not in-page, so you end up doing some whacky stuff to get it to do what you want. What option to take depends a lot on the context.
Another Option:
Sometimes you can use the tagif:<tagname> modifier. This wraps the value in a tag only if there is a value. Useful if you can get away with, for example, a plain list item, but you're doing something more complex. Useful sometimes.
Another Option:
You could also do something like:
<li class="%asset_metadata_USER.facebook^charcount^eq:0:hidden: ^trim%">
<a href="%asset_metadata_USER.facebook%">Facebook</a>
</li>
And just make sure you have a hidden class (or similar) that will hide this item (e.g. .hidden { display: none !important; } ).
P.S. the space on the end is required, otherwise system will print a '0' (in other words a 'false') for cases where there is a value. You then add the ^trim on the end to remove the space again. I always do 'cause I'm a neat freak.
Another Option:
CSS-only solution.
HTML:
<a href="%asset_metadata_USER.facebook%">Facebook</a>
CSS:
a[href=""] { display: none; }
You'd probably want to control it a little more with ancestor classes so it only targets a very specific part of your page, and you wouldn't be able to hide the parent li item, so probably not so useful in your case.
Another Option:
Combine HTML comments with the keywords (this is my least favourite approach, but have at times been forced to use it).
<!-- %asset_metadata_USER.facebook^notempty: --> %
<li><a href="%asset_metadata_USER.facebook%">Facebook</a></li>
%asset_metadata_USER.facebook^notempty: <!-- % -->
I don't even want to explain that one - it's late. Basically, the 'outer' comments always print. If there is a value, the 'inner' comments also print, and essentially cancel out the outer comments. If the value is empty, on the other hand, the inner comments do not print, so the entire thing gets rendered as just one comment. Like below:
Rendered HTML if empty (all commented):
<!-- <li><a href="">Facebook</a></li> -->
Rendered HTML if has value (comments cancel each other):
<!-- --> <li><a href=“your-value”>Facebook</a></li> <!-- -->
This approach is useful to show/hide larger chunks of page that might have a lot of other keywords in them, and where a Paint Layout is just too heavy or not an option.
Hope that all makes sense!!