You can now add your own custom tags to recordings!
For adding tags, you will use the CE2.addTag('<tag_name>')
. You will need to identify the condition for which the tag is to be added through your own website's methods. Once you have done this, calling CE2.addTag and passing the string value will add the tag to the recording if a current session is being recorded.
You can add multiple tags at the same time, as well. CE2.addTag(['Signed Up', 'Pro Plan'])
. This will add two separate tags, one called Signed Up
, and one called Pro Plan
.
When using this, you would add this inside the CE_API
function.
window.CE_API
As soon as Crazy Egg is initialized, it calls the Javascript function CE_API if it has been defined. Like the above examples, you should define a function named CE_API and put your custom Crazy Egg code inside. This ensures that your code does not try to use the CE2 object before it has been defined, which would cause errors that would prevent your custom tags from being added.
(window.CE_API || (window.CE_API = [])).push(function(){
CE2.addTag('<tag_name>')
});