× Exclamation Point Icon Important: As we continue to evolve and improve our offerings, we have decided to retire the SharpSpring Ads (formerly Perfect Audience) platform on August 15, 2024. Click here to learn more.

Event Conversions

Use the "event" conversion method to trigger a conversion goal when visitors perform an action triggering a specific javascript event on your site. This method requires knowledge of javascript and the ability to write some custom code for your website.

Here's a few examples of why you might want to use an Event Conversion:

  • Fire conversion on a button click
  • Fire conversion on a page load
  • Fire conversion when visitor has been on your site for X seconds

To create an Event Conversion, first head to Manage-> Create Conversion.

Give the conversion goal a name and select the Event method.

In the box, enter a unique tracking name for this conversion. In this example, we've used 'conversion' but this can be whatever you'd like. 

Revenue Value: Enter the revenue amount for this conversion goal. We'll use this number to calculate a variety of stats for your campaign. Tracking revenue is the best way to determine your ROI with SharpSpring Ads, so use a number that is appropriate for your business. If you're looking to pass through revenue values dynamically from your site's sales, leave this box blank and see below.

Count By:  This will allow you to choose how you want to count your conversions.

  • Count every conversion that occurs
  • Count one conversion per unique Order ID you send us (see below)
  • Count one conversion per unique visitor

Save the conversion goal when you're done.

Next, you'll need to add some code to your website. In addition to our normal tracking tag you've already installed on your site, you'll want this code to run when you want the conversion to fire (on page load, button click, etc.):

<script type="text/javascript">
window._pq = window._pq || [];
_pq.push(['track', 'conversion', {orderId: "OrderNumber", revenue: Revenue}]);

Note that 'conversion' needs to match whichever tracking name you gave the conversion goal in your Dashboard.

If you want to pass us an orderId or revenue value, simply replace OrderNumber and Revenue in the above example with the variables your site uses for that data (orderId needs to be a string, revenue a number).

That's it! When the code runs, the conversion goal will trigger.

Note: We're happy to provide some examples here, and while we provide extensive support over e-mail for all aspects of SharpSpring Ads, we cannot debug or write JavaScript for you outside of the examples provided.