Track goals while Matomo is installed


I installed Piwik PRO on a site that already has Matomo installed. The owner of the site wants to keep Matomo for the moment, while testing Piwik PRO.

I’m used to this and always choose the first method described here: Can I use Piwik PRO and Matomo at the same time? | Piwik PRO help center.

I’m tracking events correctly with this kind of code:

    _ppas.push(["trackEvent", "Clics dans le menu", {{ element.textContent }}, {{ Click Url }}]);

However, my goal tracking tags are not working. For example, I have a goal that should be tracked when the visitor clicks on a specific external link. While I can see clicks on this link in the external links reports, the objective has 0 conversion.

I’m using this code for this objective:

    _ppas.push(["trackGoal", d293dfad-ab73-45a3-8493-597d82d4a4dc, {"dimension1": {{ element.textContent }}}]);

I have 2 hypotheses at the moment:

  1. My custom code tag is wrong
  2. Any chance it has something to do with this: & stg.capturingClick not capturing the same element?

The debug shows that the tag is triggered, so no problem with the trigger.

Thank you!

Hi @Thomas_Anode_FR,

Try using this instead:

    _ppas.push(["trackGoal", "d293dfad-ab73-45a3-8493-597d82d4a4dc", 0, {"dimension1": {{ element.textContent }}}]);

Thank you Anthony, it worked fine!

Maybe the documentation should be updated here as the goalID is not in quotes and the conversion value is described as optional:

I don’t know which (if not both) of these fixes solved my problem. However, maybe there is at least one change that could be made to the documentation.

Thank you again! :slight_smile:

I think the purpose here was to show that a variable could be assigned to goalID (so either a string or a number) but I’ll see if this can be explained a bit better.

In order to add the dimension object you also have to add the optional revenue (so the arguments match). So your example needed both the goal UUID fix and the default revenue.

1 Like