[SalesForce] How to fetch the Subscriber Key/ Contact Key using the AMPScript

I am trying to create a personalized push notification and I need the Subscriber Key to do this.

So my Solution has an 'interaction' type push message, a  journey that is triggered by a data extension and the push message added to this journey. The push Message has an AMPScript to fetch the parameters.

Sample :

%%[

  VAR @something
  SET @something = [DeviceID] 

]%%
The device id is '%%=v(@something)=%%'

a) I was not able to fetch the parameters from the data extension used in the journey, and eventually learnt that the fields are from Mobile Demographics

b) Can't see a field called 'Contact Key' on mobile demographics but according to the documentation this field corresponds to the subscriber key. However, tried sending both the parameters (ContactID – which is visible on the DataExtension AND ContactKey) in my push message and both were blank in the delivered push message.

c) The Remaining fields of the Mobile push demographics like – DeviceID, SourceObjectId etc gets sent dynamically without any issues

c) Found another post that talks about fetching the DeviceLanguage from a dataExtension – PushAddressExtension and this worked – any clue as to what this data extension is ? Still no luck on getting the subscriber ID from here either.

%%[

VAR @something
SET @something = Lookup("_PushAddressExtension", "DeviceLanguage", "ContactId", DeviceID) 

]%%
The subscriber key is '%%=v(@something)=%%'

d) If I click Manage under the MobilePush Tab , I can see that the Contact Key is populated with the subscriber Id.

Any Help in getting this resolved will be greatly appreciated.

Best Answer

This answer has been removed until further analysis.

Related Topic