Only for client side implementation!This base tag should only be included when using the client side (javascript) implementation of the Tweakwise Event Tag.
This base tag should be included on every page of your website. It will generate a custom profile key in the background and store it in a cookie. This profile key is used in various requests
<script>
(function(w, d, l, i, u) {
w['_twa'] = l;
w[l] = w[l] || [];
w[l].push({ 'twa.start': new Date().getTime(), event: 'twa.js' });
w[l].push({ 'twa.instance': i, event: 'twa.init' });
var f = d.getElementsByTagName('script')[0],
j = d.createElement('script');
j.async = true;
j.src = u;
f.parentNode.insertBefore(j, f);
})(window, document, 'tweakwiseLayer', '{INSTANCEKEY}', "//navigator-analytics.tweakwise.com/bundles/scout.js");
</script>Replace {INSTANCEKEY} with your Tweakwise instance key.
The profile key
Customer identification is done through a profile key. This is our way to identify your customers using a unique identifier.
Using custom profile key
In some cases, you might want to determine the profile key yourself. For example, if you want to support cross-device personalization, it is recommended to use the currently authenticated user. Use this extended version of the base tag to pass your own custom profile key to the tag.
<script>
var profileKey = '{PROFILEKEY}';
(function(w, d, l, i, p, u) {
w['_twa'] = l;
w[l] = w[l] || [];
w[l].push({ 'twa.start': new Date().getTime(), event: 'twa.js' });
w[l].push({ 'twa.instance': i, event: 'twa.init' });
p && w[l].push({ 'twa.profile': p, event: 'twa.profile' });
if(p){ w[l].getProfileKey = function(){ return p; } }
var f = d.getElementsByTagName('script')[0],
j = d.createElement('script');
j.async = true;
j.src = u;
f.parentNode.insertBefore(j, f);
})(window, document, 'tweakwiseLayer', '{instancekey}', profileKey, "//navigator-analytics.tweakwise.com/bundles/scout.js");
</script>Replace {INSTANCEKEY} with your Tweakwise instance key.
Replace {PROFILEKEY} with your custom profile key.
You can determine the profile key yourself. Generally account id's are used for logged-in users and visitor-id's for anonymous users.
Format of a custom profile key
The profile key should be a string with a maximum length of 100 characters.
Accepted characters:
- A-Z or a-z
- 0-9
- Dash (-)
Profile keys with other characters will not be processed correctly.
If no profile key is supplied, our Tweakwise Analytics JS will generate a unique identifier for the current user.
WarningThe use of personal information such as email addresses, phone numbers, or other personal information as profile keys is not permitted in order to comply with GDPR guidelines.
Only use anonymized data such as ID numbers or hashed values. By following the GDPR guidelines, you meet the requirements for the protection of users and data.