Are you testing this with a Data Extension and do you have a field in it named 'SubscriberKey'? If not, you will need to use '_SubscriberKey' to pull in the system defined SubscriberKey value, like noted here:
Additionally, it doesn't appear that for your use case you should be using URLEncode()URLEncode()
, and should be using Base64Encode().
Something similar to the following:
%%[ var @clientkey, @clientkeyencoded, @URLunsubscribe,@enc64 SET @clientkey = _SubscriberKey SET @clientkeyencoded = Base64Encode(@clientkey) SET @URLunsubscribe = Concat("http://example.com/unsubscribe/?sk=",@clientkeyencoded) ]%%
%%=v(@URLunsubscribe)=%%
%%[
var @clientkey, @clientkeyencoded, @URLunsubscribe,@enc64
SET @clientkey = _SubscriberKey
SET @clientkeyencoded = Base64Encode(@clientkey)
SET @URLunsubscribe = Concat("http://example.com/unsubscribe/?sk=",@clientkeyencoded)
]%%
%%=v(@URLunsubscribe)=%%