Display the Copy License Key button
The order confirmation page can be configured to display a button that a customer can click to copy the license key. This makes activating software simpler for customers, reducing the number of contacts with technical support.
Here's an example of a copy license key button:
In the Cleverbridge platform, both in Commerce Assistant (CA) and in our web admin tool, there is the Delivery section for configuring the presentation of the license key and associated text for the customer. To use the copy license key button, two fields must be edited:
- Key Template
- Email Key Template
There are two steps required for implementing this feature, with an optional third step:
Step 1: Edit the key template
- Open the product of your choice and refer to the Delivery section.
- Under Key Template, enter the following script:
<script>
Document.UseCopyButton('yes', '<ProductId>', {
shadowLabel: 'Copy to clipboard',
shadowTitle: 'Click to copy the license code to your clipboard'
});
</script>
License Code: <span id="CopyData<ProductId>">
<Key>
</span>
<div id="CopyArea<ProductId>" class="CBNoJSFold CBJSFold">
<span class="fulfilmentContentLink">
<a class="fulfilmentContentLink" href="javascript:;" id="CopyButton<ProductId>" title="Click to select the license code and press Ctrl+C to copy it your clipboard">Select license
code</a>
</span>
</div>
<div id="CopyInfo<ProductId>" class="CBJSFold">
Select the license code and press Ctrl+C to copy it to your clipboard.
</div>
Key template requirements
You can change the markup of the key template, for example, to rearrange the data, rename the button, or re-write the text, but you must keep the following elements with the following IDs to ensure correct functionality:
CopyButton<ProductId>
CopyArea<ProductId>
CopyData<ProductId>
The key template script contains the linecondition': '<x-flashcopybutton>'
that requires the use of the x-parameter. To always use the copy license key button, remove this line from the script.
To display the key without the additional text information, remove the div with the CopyInfo<ProductId>
ID.
Removing this element results in no additional text information displaying for users with JavaScript disabled.
If you localize your shopping cart pages, you are responsible for translating the text in the key template; it will not be localized into other languages by Cleverbridge.
Step 2: Edit the email key template
If you enable the copy license key button in the key template, you must also specify a different email template. This is required because the key template contains JavaScript that should not be used in an email.
After you edit the key template, under Email Key Template, enter License key: <Key>
.
Step 3: Copy license key parameter (optional)
Optionally, you can insert an x-parameter into the checkout process URL to use the copy license key button. This is an additional step to the template edits described above. The x-parameter is useful for scenarios when you want to test the efficacy of the button using an MVT campaign. For example, one candidate uses the x-parameter and the other does not.
Pass the x-parameter x-flashcopybutton
with the value yes
into the checkout process URL. In CA, this can be done using the Saved Links tool, the MVT Campaign tool, or the Link Generator tool. In our web admin tool, you can do this using Link Generator (Configure > Tools > Link Generator).
The copy license key button displays only if the x-parameter specified in the Key Template field matches the one passed and it has the value yes
. You can rename the x-parameter, but the value must be yes
. If you rename the x-parameter, adapt the key template accordingly.
JavaScript enabled behavior
There are two possible behaviors when JavaScript is enabled:
- If Flash is enabled, the customer sees the Copy License Key button with the tooltip displaying “Click to copy the license key to your clipboard.” When the customer clicks the button, the license key is copied to the clipboard.
- If Flash is disabled, the customer sees the Select License Key button with the tooltip displaying “Click to select the license key and press CTRL+C to copy it to your clipboard.”
If JavaScript is enabled and the x-parameter is not passed, but required by the key template, the customer sees the license key with additional text:
JavaScript disabled behavior
If JavaScript is disabled, the license key displays as if the x-parameter was not passed:
Examples of Copy License Key outputs
A confirmation page without the Copy License Key button:
A confirmation page with the Copy License Key button:
If a product has more than one license key, the customer can simply select a radio button for the key required and then use the Copy License Key button:
For more information about the Copy License Key button, contact Client Experience.