Opening a conversion goal from any link or button
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 class | What it opens |
|---|---|
pathmonkGoalButton | Your main conversion goal |
pathmonkSecondGoalButton | Your second goal |
pathmonkQualificationButton | Your 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>
If your website builder asks for a link
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
| JavaScript | What 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 class | JavaScript | What it opens |
|---|---|---|
pathmonkFAQButton | Pathmonk.openFAQ(); | The FAQ |
pathmonkAssistantButton | Pathmonk.openAssistant(); | The assistant |
pathmonkContactButton | Pathmonk.openContact(); | The contact form |
pathmonkAwarenessButton | Pathmonk.openAwareness(); | The conversion goal for the awareness stage |
pathmonkConsiderationButton | Pathmonk.openConsideration(); | The conversion goal for the consideration stage |
pathmonkDecisionButton | Pathmonk.openDecision(); | The conversion goal for the decision stage |
Check that it works
- Publish the change on your website.
- Open the page and click the button.
- 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?.
