If you use Google AdWords, Olark can help you do better conversion tracking. By using our Javascript API, you can track conversions when a chat begins, when an agent sends a response, and many other events!

Example: Track AdWords conversions when a customer starts a chat

  1. Let’s say you want to track a conversion only when a customer starts chatting with you. The first step is creating a helper that lets you track those AdWords conversions. Here’s a Javascript function to do that:

    function trackAdwordsConversion(id, label) {
        var image = new Image(1, 1);
        var base = "http://www.googleadservices.com/pagead/conversion";
        image.src = base + "/" + id + "/?label=" + label + "&script=0";
    }
    
  2. Next, you will want to listen to the api.chat.onBeginConversation event in Olark. Be sure to replace YOUR_Conversion_ID and YOUR_Conversion_Label with your own information from Google AdWords:

    olark("api.chat.onBeginConversation", function(){
        // Make sure to replace the ID and Label with your own ID and labels.
        trackAdwordsConversion("YOUR_Conversion_ID", "YOUR_Conversion_Label");
    });
    
  3. Now, you should be able to visit your website, start a chat, and see that conversion show up in your AdWords conversions. Neat!

Click here for Google’s guide on Google Adwords.

Was this article helpful?