PathmonkHelp
Help/Conversion goals & tracking/Conversion goals/Opening a conversion goal from any link or button

Opening a conversion goal from any link or button

CategoryConversion goals & tracking › Conversion goals
CreatedNov 27, 2026
UpdatedNov 27, 2026

Any button, link, image or text on your website can open your Pathmonk conversion goal when a visitor clicks it. Use it to make your own "Book a demo" or "Get a quote" button open the same goal as your micro-experiences. There are two ways: add a CSS class to the element, or call a JavaScript function. Both need the Pathmonk snippet on the page.

Option 1: add a CSS class

Add one of these classes to the element. Pathmonk reacts to the click on desktop and to the tap on mobile.

CSS classWhat it opens
pathmonkGoalButtonYour main conversion goal
pathmonkSecondGoalButtonYour second goal
pathmonkQualificationButtonYour qualification flow

Example:

<button class="pathmonkGoalButton">Book a demo</button>

If the element already has classes, add the Pathmonk class to them:

<a class="btn btn-primary pathmonkGoalButton" href="javascript:void(0)">Book a demo</a>

Some builders, such as WordPress, do not let you save a button without a link. Use one of these so the page does not reload or jump:

  • javascript:void(0)
  • # followed by a name, for example #stopscroll, so the page does not scroll to the top

Option 2: call a JavaScript function

JavaScriptWhat it opens
Pathmonk.openGoal();Your main conversion goal
Pathmonk.openSecondGoal();Your second goal
Pathmonk.openQualification();Your qualification flow

Call it from your own code:

<button onclick="Pathmonk.openGoal()">Book a demo</button>

Or put it in the link field of a button or a text link:

<a href="javascript:Pathmonk.openGoal()">Book a demo</a>

If your code can run before Pathmonk has loaded, check that it is there first:

<script>
  if (window.Pathmonk) { Pathmonk.openGoal(); }
</script>

Other actions

The same two methods open other parts of Pathmonk:

CSS classJavaScriptWhat it opens
pathmonkFAQButtonPathmonk.openFAQ();The FAQ
pathmonkAssistantButtonPathmonk.openAssistant();The assistant
pathmonkContactButtonPathmonk.openContact();The contact form
pathmonkAwarenessButtonPathmonk.openAwareness();The conversion goal for the awareness stage
pathmonkConsiderationButtonPathmonk.openConsideration();The conversion goal for the consideration stage
pathmonkDecisionButtonPathmonk.openDecision();The conversion goal for the decision stage

Check that it works

  1. Publish the change on your website.
  2. Open the page and click the button.
  3. Your goal opens: the form, the booking tool, the qualification flow or the page you set as the goal.

If nothing happens, check that the Pathmonk snippet is on that page and that the class or function is spelled exactly as above, capital letters included. See Is Pathmonk not connecting to your website?.