Skip to main content
All CollectionsPlayer DataCollect Player Data
Pre-filling a registration field with encrypted data
Pre-filling a registration field with encrypted data

Send user information to your campaign's registration form in the URL

Niklas Cuthbert Mehlsen avatar
Written by Niklas Cuthbert Mehlsen
Updated over 8 months ago

To pre-fill a registration form with data from the URL, you need to first encrypt the data.

When you select the registration addon, you will see a tab marked Decryption. Here, you can activate OpenSSL encryption and enter a Cipher. We suggest the use of AES-256-CBC - but another alternative exists as well: AES-128-CBC.

You will then set a Key and IV. The encrypted value has to be base64 encoded. An example of an encryption that works (in PHP):

<?php
$email = 'test@playable.com';

$key = '727AD2941DE192C6';
$iv = '0DE42A46774D10DA';

After choosing the cipher and inserting the key and IV, will enable encryption on the form fields that should be filled by the decrypted values.

You do this by modifying the field and selecting ‘Activate decryption’. After selecting this option, you will see how the data should be formatted.

In the example below, the email field should be sent as a query parameter to the campaign:

?email=encrypted_value_here

In this example, your URL structure would look like this:

$encrypted_email = openssl_encrypt($email, 'AES-256-CBC', $key, 0, $iv);

$query_string = '?email=' . urlencode($encrypted_email);

Things you need to be aware of when setting up the encryption are that:

  1. Playable does not support salt

  2. The string would need to be URL encoded so that when the web server decodes the parameter, it gets the right value.

Example:

Raw: 7HZasofjh0YCS+PQ/qp6qoA24fowiVXBJpyrr1aseFs=
Encoded: 7HZasofjh0YCS%2BPQ%2Fqp6qoA24fowiVXBJpyrr1aseFs%3D

Did this answer your question?