How to track revenue from your e-commerce (not for Shopify) in Pathmo

Modified on Thu, 6 Nov at 10:15 AM


Tracking revenue lets Pathmonk measure the real value of every conversion and attribute it to the correct user journey. It also helps our AI understand the business impact of your conversions.


If your e-commerce runs on Shopify, the setup requires a few additional steps — please read this article: How to track revenue from Shopify in Pathmonk


If you’re not using Shopify, the process is much simpler.




Step 1: Create a Page Pixel


If you’re completing onboarding: in Step 4, select Page Pixel.



If you’ve already completed onboarding: go to Analytics (top menu) → Events → Overview → Create new event, and select Page Load Pixel.


Add a name for your conversion (for example, Sale) and leave the monetary value blank, Pathmonk will automatically pull the revenue data from each purchase.


Once you click on Next, the system will generate a tracking script similar to the example below:


<!-- Pathmonk Tracking Code -->

<script type="text/javascript">

    (function(d,key,id) {

        var js; js = d.createElement('script');js.src = 'https://pathmonk-lib.pathmonk.com/plugin/track.min.js?client_id='+key+"&pixel_id="+id+"&new=off";d.body.appendChild(js);

    }(document, "kXS9qKXu4fAO0vIZYT6cfxlZa", "02aee631-22ff-47b0-91f7-d527ef109c36"));

</script>


In this example:

  • kXS9qKXu4fAO0vIZYT6cfxlZa = Client key

  • 02aee631-22ff-47b0-91f7-d527ef109c36 = Pixel ID


Keep these values handy for the next step.




Step 2: Update the script



Using this script below as a template:

 <script>

function pathmonkConversionPixelPrice(price) {

    d = document;

    key = "CLIENT_KEY";

    id = "PIXEL_ID";

    var js; 

    js = d.createElement('script');

    js.src = 'https://pathmonk-lib.pathmonk.com/plugin/e-track.min.js?client_id=' + key + "&pixel_id=" + id + "&new=off&price=" + price;

    d.body.appendChild(js);

}; pathmonkConversionPixelPrice(ACTUAL_PRICE);

</script>


replace the placeholders of Client Key and Pixel ID with the values you got from the previous step.

You also need to call the function with the real purchase amount or variable that you're using to identify your revenue. To do so, replace ACTUAL_PRICE with:

  • The variable containing the real transaction price (e.g. order.totalPrice), or

  • A fixed number (e.g. 49.99) for testing.

You will find this variable on your Google Tag Manager or Data Layer used to retrieve revenue.

Make sure this function is called after payment confirmation, ensuring Pathmonk tracks the correct purchase value.




Example

Here’s what a working setup might look like:

<script>

function pathmonkConversionPixelPrice(price) {

    d = document;

    key = "abc123client";

    id = "pixel789xyz";

    var js; 

    js = d.createElement('script');

    js.src = 'https://pathmonk-lib.pathmonk.com/plugin/e-track.min.js?client_id=' + key + "&pixel_id=" + id + "&new=off&price=" + price;

    d.body.appendChild(js);

}; pathmonkConversionPixelPrice(order.price);

</script>


This will send a conversion event with the price in the variable order. price  to your Pathmonk account.




⚙️ Troubleshooting


  • The price doesn’t show up: Ensure you are calling the function after the purchase event, when the actual price value is available.

  • Nothing happens: Open your browser console (F12) and check for JavaScript errors.

Still not tracking? Contact support@pathmonk.com with your pixel’s ID and a link to the page.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article