I am trying to customize an Push Notification template in ExactTarget by using AMPScript. Can you please let me know how can I retrieve "Contact key" value from Contact using AMPScript. I have tried with the below AMPscript: %%contactKey%% %%ContactKey%% %%[Contact Key]%%
You cannot access the
SubscriberKey in MobilePush.
The only way to have access to this value is to create a new custom attribute with this value for the MobilePush Demographics.
For whatever reason we can only query the
ContactID (which is system defined) from the
_PushAddress data view.
In fact, even in MobileConnect outbound SMS, the ability to actually use the
ContactKey of a Contact was added just two weeks ago with the June 2018 release.
EDIT (OCT 2018) - with latest October 2018 release there is now an option to use Journey Attributes in the MobilePush messages. This includes the ContactKey attribute.
I believe the Contact Key is just another name for the Subscriber Key due to your upgrade to Mobile Connect (http://help.exacttarget.com/es-US/documentation/mobileconnect/upgrading_contacts_for_mobileconnect/mobileconnect_upgrade_faq/)
Q. What happens to Subscriber Key when I upgrade?
A. Subscriber Key becomes Contact Key after the upgrade. This change will not affect existing queries and filters referencing Subscriber Key.
So based on this, you should be able to use the personalization string %%_subscriberkey%% to grab this.
I think I found a solution that will work for you in another question:
You will need to link your Data Extension to the Contact model using the Contact Builder application in the Marketing Cloud. Contact Builder allows you to specify an Attribute Group which you can tie to a ContactKey.
If you look toward the bottom of the Contacts documentation there is a section titled "How to Link Data Extensions" - This will explain in detail how to link these records.
Depending on whether or not you are using SubscriberKey, you may either link the ContactKey to SubscriberKey or to any other Attribute that you decide to use (such as email address)