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]%%

2 Answers 2


You cannot access the ContactKey / 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)

  • Thanks for the response.I have tried %%_SubscriberKey%% and %%_subscriberKey%% in my Push template. However, it did not pull up the contact Key. Am I doing anything wrong? Commented Mar 26, 2016 at 1:55
  • Is it stored in a data extension? If so you can do a LOOKUP on it and fill it via an ampscript variable Commented Mar 26, 2016 at 16:42
  • Thanks. I am trying to personalize each template for each user. The contact key is used to identify the customer in the Contact. However the other information related to the customer is stored in Data extension with the same customer key. Now, in my use case, we need to retrieve the customer key from contact with which we can look up the data extension to get other information. Hope I am able to clarify you! Commented Mar 26, 2016 at 17:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .