Image pixel tracks every request as conversion with revenue

Hi there,

first time Matomo user here. Setup and everything went very smooth, which is why I am surprised about the behaviour I am seeing with the image tracking pixel.

The conversion goal I want to track does not happen on my website, so I placed an image pixel on the “Thank You” page of the merchant. This page also receives visits from customers I haven’t referred, BUT these visits are still tracked in my Matomo install and “conversions” with revenue attached to them.

I was under the impression that the image pixel would only track a visit, and conversion goal if a cookie was present and the visitor visited my site before.

I have conducted my own tests now, in a fresh private browser window with all cookies cleared, visited the url that is wrapped in the image tag, and it tracks new visits with conversions and revenue in my install.

To me, that is completely unlogical behaviour, why is this happening and how can I track conversions the way I describe above but accurately…?

PS: This is the image tracking url:

If I understand your problem correctly, then you seem to be running into the issue for a simple reason:

First, you need to understand that the image tracker will record any visit to the thankyou page, obviously including visits which are not triggered on order confirmation.
If your shop is a common software piece, you will probably have all kinds of hits to any available page (includng the thankyou page).
My guess woud be the “thankyou” page probably shows some kind of error message if it is accessed directly, without the session/cookie indicating that a successfull purchase has indeed happened.

Now, your problem is:
Your image tracking code is obviously included regardless of success, probably along with the error message, too.
Solution: try to spot the part of the thankyou page that handles success vs. error message display, and move the tracking pixel to the real success message.
Hope that helps :slight_smile:


thanks for your comment. Sadly that is not the problem.

I want to track affiliate conversions: (matomo) -> (thank you page)

When a conversion happens on the merchants side, the image pixel is included and I was under the impression that the image pixel only tracks a goal conversion if it finds the cookie matomo set on “” before?

Also on top of this not working, matomo creates a new visit for every hit to the image pixel, which doesn’t seem right imho?

As you have noticed, this is not the case, goal tracking happens regardless of cookie presence.
You may have to check for referrers on the merchants site before including the tracking pixel, otherwise it will track ANY conversions on the merchants site.

I cannot offer a solution to the “img tracking creates new visitor” issue, I’d assume the different domain origin of the tracking call might trigger that, but that is a guess.

Since you seem failry new to Matomo, let me add one more coment:
Image tracking is by far the least reliable tracking method offered by Matomo (think of AdBlock blocking the pixel), so I wouldn’t recommend doing any final affiliate accounting based on image tracking stats.
It is a nice way of keeping track of your overall conversions rate, but that’s about it.

Thanks that is very helpful!

What would you recommend how to track affiliate conversions?

The methods that are offered are:
include image pixel
server to server postback

The s2s postback works so that the merchant makes a GET/POST request to a url of your choice, including a unique visitor ID (that I can theoretically append to all my outgoing urls before visitor goes to merchant)

This is the preferred method of tracking and highly accurate, but I’m not sure how to implement this with Matomo.
To be able to make the server side conversion attribution work, I would need to retrieve the visitor ID matomo creates, and append this to my outgoing urls.

I have tried this, but the visitorID was very often undefined when retrieving with javascript.

var visitor_id;
_paq.push([ function () { visitor_id = this.getVisitorId(); }]);

Next thing I tried was with the PHP client Matomo offers, the problem there was/is, that the cookie via $piwik->getVisitorId() is only available on second page load.

I need to retrieve it in the same request when the visitor arrives on my page, because when they then click on the link leading to the merchants site they are gone already and I cannot append the visitor ID anymore.

Hope that makes sense?

Maybe you know how to solve this scenario?

I can think of multiple ways to solve this scenario,
but I’m not 100% sure I understand why you need to match the conversion to its prior navigation path.

If I understood correctly, you are expecting visitors who will view on page on your domain without logging in,
click on some linked banner
move on to the merchant & ideally purchase something there.
If that happens, you would like to trace the conversion, and would like to tie that to the initial one-page-visit.
The whole thing gets a little complicated because of the last mentioned tie-back, and I’m not sure that is really needed in your scenario.
As you already mentioned, you would be able to do the sort of tracking you want if the visitor visited at least two pages.
One solution might be to add a redirection page between the banner click and hitting the merchant store, which could then add the visitorID to the redirect target.
I’d strongly recommend to use the s2s callback, and to also log those callbacks in a separate DB outside of Matomo. I keep accounting and stats on different systems for multiple reasons, you really should consider that IMO.

Everything you say makes a lot of sense!
I see there are some things unclear I haven’t explained very well.

First off, the reason I want to use Matomo is to have my statistics in one place, I run paid marketing campaigns for the pages I am tracking with Matomo.

What I want to achieve is that I have statistics in Matomo for my paid campaigns that let me match conversions to campaign, keywords, custom dimensions etc.

I don’t necessarily need to match a conversion to the first page view, this is just the nature of affiliate campaigns.
Visitor arrives, and because as affiliate you only make money if the visitor takes action on the merchants site, you need to get the visitor off your page as fast as possible. So normally a visitor arrives on your domain, and then immediately clicks on a banner/link/button to go to the merchant.

So what I need is to match a conversion, to a visitor and therefore to the campaign the visitor arrived from.

But where it ends for me atm is, that I don’t know how I can get the visitorId reliably in javascript.