Follow

User-Defined Variable

The User-Defined Variable (UDV) is a visit-level custom variable in Angelfish.  The UDV can be defined in JavaScript code on your website (AGF tracking method only), or it can be assigned with an Advanced filter during processing (all tracking methods).

 

agf.setUserDefined({'udv':'value'})


 You can assign the UDV  with the agf.setUserDefined() method - simply call the method from a specific page and replace the 'value' with a static value or a variable. The agf.setUserDefined() method can be called from any JavaScript event, e.g. onClick. The UDV only stores one value per visit, and retains the last value seen.

The agf.setUserDefined() method ONLY assigns a value to the UDV. In order for the UDV to be associated with a visit, the agf.pageview() method must be called after the UDV has been assigned.

Example 1 - Lead Form:

To assign a UDV value of "lead" to visits that fill out a form on your website, add the agf.setUserDefined() method to the tracking code on the form's thank you page:

<script type="text/javascript" src="/angelfish.js"></script>
<script type="text/javascript">
agf.setUserDefined({'udv':'lead'});
    agf.pageview();
</script> 

 

Example 2 - Ad Click:

To assign a UDV value of "ad-click" to visits that click an advertisement (e.g. banner or text link), add the agf.setUserDefined() method to the ad's anchor tag with an onClick:

onclick="agf.setUserDefined({'udv':'ad-click'});"
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.