Follow

AGF Tracking Code Options

The Installing AGF Tracking Code article explains the basics of placing AGF tracking code on your website. This article explains methods and advanced features of the AGF code.

By default, an agf.gif request is sent each time the page reloads. You can use a virtual pageview to track visitor activity that doesn't reload the page, like clicks on outbound links, button clicks, or form field selections.


Required Methods:

  • agf.pageview();

This is the only required method in order to start collecting Angelfish traffic data. You will see it in the default tracking code snippet:

<script type="text/javascript" src="/angelfish.js"></script>
<script type="text/javascript">
agf.pageview();
</script>


Options:

The method agf.pageview(); accepts 3 options, which can be used to create virtual pageviews or to call a custom function after a certain behavior occurs:

  1. Page: The page (stem & query) to track. Default value: current page
  2. Title: The page title to track. Default value: current page title
  3. Callback: The function to call after the page tracking request is sent. Default value: none

Syntax:

agf.pageview({page:'<page path>', title:'<page title>', callback:'<function>'})

Examples:

  • Virtual pageview for a click on a contact form button. Add the following code to the button's tag:
onClick="agf.pageview({page:'/vt/button/contact-form', title:'contact form button click'})"
  • Virtual pageview for a click on an outbound link. Add the following to the link's anchor tag:
onClick="agf.pageview({page:'/vt/outgoing/analyticsmarket.com', title:'outbound-analyticsmarket.com'})"

 

Other methods can be added to the tracking code to customize tracking behavior. Please use the Custom Tracking Code Generator to apply custom settings.

Was this article helpful?
0 out of 0 found this helpful

0 Comments

Article is closed for comments.