Lucky Boost

Traffic & Conversions Boost

App Installs for Twitter Card with WordPress SEO plugin


App Installs for Twitter card is an extension that can be added to any Twitter card (Twitter card is an extension that can be added to a tweet – yes we are talking about an extension to an extension). App Installs will add a link to your mobile app, to any tweet coming from your site. I’m sorry but this code is not relevant as of WordPress SEO plugin version 1.5

WordPress SEO plugin has the option to add a “Summery Twitter Card” automatically to your site.
Following: how to add App Installs to Summery Cards, for the WordPress SEO plugin users.

The full name of the extension is “App Installs and Deep-Linking” which are actually 2 different options:

  1. App Installs – will add a link to your app on the App Store or Google Play.
  2. Deep-Linking – An option to link to the same piece of content in a mobile app.

“App Installs and Deep-Linking” functions will add a link at the bottom of each card. The link will only work to its full extent when Twitter detects you are coming from a mobile device and will add a link to the proper app based on your device, or to the same page in the app if already installed. Twitter supports the following devices: iPhone, iPad and any Android device. Otherwise the card will simply show a “view on web” link pointing to the page provided in twitter:url meta tag. In the WordPress SEO plugin it will be the link to the post that was tweeted.

Adding the App Installs option to WordPress SEO

Start with opening the social.php file located at wp-content/plugins/wordpress-seo/admin/pages/ after line #156 past the following block of code:

This will add all the proper fields under the social section in the plugin.

The next step is to add code that will add the Meta data to the page.

Go to class-twitter.php located at wp-content/plugins/wordpress-seo/frontend/ find row #144 after the closing “}” add this block of code

Go back up to row #50 and paste

All you got to do is refresh the social page and fill in the IDs and name of your apps.card-validator

Note: the ID for the app store is a number, were the ID for the Android Market (Google Play) is a string that looks like

Also, if you don’t have an app customized for iPad, insert the same information as your iPhone app.

After adding the Meta data to the header of each page we need to get approval from Twitter before they will start showing the App Installs in the Twitter cards from any domain. Go to card validator (you must be signed in with the account you are asking for the approval for). Choose the second tab “Validate URLs”, paste a URL from your site, if all is good all the bullet points will be green. At the bottom you will see a second bar “Mobile App Integration – optional” under that are the name and app IDs entered.

Go back up to the box you entered your URL in, and click the “Request Approval”. A pop up will open asking you to fill out some details and then hit “Register Domain”. Good luck with the approval!

Getting approval can take a few weeks.

Deep-Linking is a lot more complicated to implement, it requires adding to each post a link to the same post in your app (app also needs to support address – not all do) so for now App Installs will just have to do.

Besides the summery card Twitter has a few more card types, the common ones are photo and player (video) card, and the extension can be added to them as well. Unfortunately other card types do not exist in the WordPress SEO plugin (no need to go looking).

I’ll be happy to hear from you how the implementation worked out for you.

Leave a Reply

Required fields are marked *.