3

Since about a year it is possible to get from the Developer Console up to 500 promo codes per quarter that can be used to share a paid app for free during a defined promotion period. However, the question is how to bring theses codes efficiently to potential users and in which form.

In principle the most elegant way is to use a deep link that directly leads to the app-install in Google Play for one specific promotion code.

URL: https://play.google.com/redeem?code={CODE} where {CODE} is a generated promo code.

I would like to provide such a deep link on my website. In order not to reuse the same code multiple times, I was thinking of using several deep-links with different codes and refresh the corresponding codes manually from time to time. Of course that is not very elegant. I spent some hours googling but didn't find much useful on that topic. QUESTION: Does someone know a better solution to use the deep-linking?

Settembrini
  • 1,338
  • 1
  • 19
  • 32

1 Answers1

0

You can create a table into your data base and insert all your promo codes in this table, also you need an aditional table to control the click of your promo links so you can have something like this:

CREATE TABLE promoCodes (  
  code VARCHAR(23) NOT NULL,  
  is_clicked INT(1) NOT NULL,  
  PRIMARY KEY (code)  
) ENGINE = InNoDB;  
CREATE TABLE promoControl(  
  email VARCHAR(80) NOT NULL,  
  code VARCHAR(23) NOT NULL,  
  date DATETIME(3) NOT NULL,  
  PRIMARY KEY (email),  
  INDEX (code),  
  FOREIGN KEY (code) REFERENCES promoCodes(code) ON DELETE CASCADE ON UPDATE CASCADE  
) ENGINE = InNoDB;

So, when you want to gift a promo code, you requires the user email to control the gaves codes, when the user insert his email, you select a promo code tahts isn't clicked with a query like this:

SELECT code FROM promoCodes WHERE is_clicked=0 ORDER BY code DESC LIMIT 1

Then, you insert into promoControl table the email with the promo code to asociate it internaly.
Finally, you show the URL with the code to the user with a PHP script to construct the URL, something like this:

<?php echo "https://play.google.com/store/redeem?code=" . $code; ?>

Thats all, but remember that you really unknow whos redeem the code correctly so you can implements a server verification into your Android app to registry and verify the correct code activation using a little API and the Google Play API, with this method you can reactivate the promo codes thats not be redeemed. Also don't forget to update the promoCodes table to change the is_clicked value to 1.