Tracking customer information via cookies

You can capture information about your customers using first-party cookies. First-party cookies are stored in their browsers. Use this method when the information you want to track is stored and updated on the customer's cookie.

To capture customer data using first-party cookies:

  1. Create a custom attribute to store the data.
  2. Tell the system how to assign a value to the attribute based on the cookie's name or value.
  3. Publish these rules so that real-time tracking can begin.

Example use case

  • Assume you want to track your customers' registration status. It is contained in a Reg cookie.
  • The possible values of the Reg cookie are:
    • Not Registered
    • For newsletter only
    • With full login

To track customer information from a first-party cookie:

  1. From the main menu, select Custom Attributes.
  2. Select the custom attribute you want to use for tracking. If the custom attribute you need to use for tracking is not in the list, you need to create it:
    1. Add a custom attribute.
    2. Give the attribute a name, such as Registration.
    3. Select the Preset attribute type.
    4. Enter the following values: Not_reg, Newsletter, Login.
    5. Save the new attribute.
  3. From the Rules column, select Add.
  4. On the Properties tab, select Cookie from the drop-down list.
  5. Using the blue links to add rules, define rules to auto-generate the needed code:
    1. If cookie Reg contains newsletter then set attribute to Newsletter
    2. If cookie Reg contains login then set attribute to Login
    3. Else set attribute to Not_reg

  6. Save this configuration.
  7. Click the URL tab to add the pages where this attribute can be captured.
  8. Enter at least one URL and save it.
  9. From the main menu, select Publish Center.
  10. In the publish center, find the Registration attribute in the list of objects that are being edited (with Editing filter).
  11. Select the attribute and mark it ready for publish. Registration now appears in the Publish Queue.
  12. Publish the script so that it goes live and begins tracking.

Note: Custom attribute scripts are executed after any site-level scripts.

Using any value from a cookie as a custom attribute value

To grab any value from a cookie and use it as a custom attribute value:

  1. From the main menu select Custom Attributes.
  2. If the custom attribute you need to use for tracking is not in the list, you need to create it:
    1. Add a custom attribute.
    2. Give the attribute a name, such as Registration.
    3. Select the Freetext attribute type.
    4. Save the new attribute with its preset values.
  3. Select Add from the Rules column.
  4. From the drop-down menu in the Properties tab, select Cookie.
  5. Define the rules that will auto-generate the right code (using the blue links and adding rules):
  6. Using the blue links to add rules, define rules to auto-generate the needed code:
    1. If cookie Reg does not exist then set attribute to N/A
    2. Else set attribute to "Use cookie value" (from tick box)

  7. Save this configuration.
  8. Select the URL tab to add the pages where this attribute can be captured.
  9. Enter at least one URL and save it.
  10. From the main menu, select Publish Center.
  11. In the publish center, find the Registration attribute in the list of objects that are being edited (with Editing filter).
  12. Select the attribute and mark it ready for publish. Registration now appears in the Publish Queue.
  13. Publish the script so that it goes live and begins tracking.

Note: Custom attribute scripts are executed after any site-level scripts.

cookie, custom attribute, grab cookie value, FPC