/
Example Code Request for a Custom Visitor Target

Example Code Request for a Custom Visitor Target

This documents an example of a request that contains a custom visitor target. A common use case for this functionality would be for customers logged in versus customers not logged in and displaying custom pricing for the logged in customers.

Instructions

  1. Set the Hawksearch.context.custom property as follows

    Hawksearch.Context.Custom.add("custom", "LIN");

    (//LIN here just is a value I am using to represent logged in)

  2. Map the visitor target to the visitor target in the Hawksearch admin as shown below from the visitor targets section:

     

  3. Identify the Visitor Target Id in the admin screen (https://dev.hawksearch.net/settings/buckets/ )

     

  4. Use the Visitor target id in the layout to adjust the layout as  needed and show the correct  conditions based on the visitor target assigned.
          {{#visitortarget in="155"}}

              {{$custom.member_price}} 

              {{/visitortarget}}

    Where member_price is your custom price for that member

Related articles

Related content

Custom Visitor Targets
Custom Visitor Targets
More like this
Recommendation API
Recommendation API
Read with this
How to choose the correct Visitor target?
How to choose the correct Visitor target?
More like this
Merchandising Objects
Merchandising Objects
More like this
New Hawksearch Integrations
New Hawksearch Integrations
More like this
API - front end integration
API - front end integration
More like this