This guide will walk you through how to use targeted chat rules (or our Olark API) to engage visitors from a marketing campaign.

You can include a simple link in your marketing emails that will trigger a chat rule to proactively engage your site's visitors.

Using Targeted Chat

  1. Include a custom url in your email blast or tweet for your customer to click. Something like http://example.com/#who-wears-short-shorts
  2. Go to Olark's Targeted Chat and create a new rule
  3. Set up a condition to trigger the rule based on the url that you included in your email

targeted chat rule

This rule expands the chatbox if a visitor arrives on the url http://example.com/#who-wears-short-shorts and sends them the message "Hey! I hear you are interested in short shorts. Me too!"

Using the Javascript API

  1. Include a custom url in your email blast or tweet for your customer to click. Something like http://example.com/#who-wears-short-shorts
  2. Insert the following code below your existing Olark embed code:

    <script  type="text/javascript">
    if (location.hash === "#who-wears-short-shorts") {
        // expand olark chat box
        olark('api.box.expand');
        olark('api.chat.sendMessageToVisitor', {
          body: "Hey! I hear you are interested in short shorts. Me too!"
        });
    }
    </script>