How to address variables in trackEvent?

Hi,

I am trying to send a custom event, where price and module is a variable. I defined the price variable in the PIWIK backend under “Variables”.

Now when I send the event I tried:

<script>
_paq.push(['trackEvent', 'Software-Kauf', 'QualityCircle 360°Suite' {{Modul}}, {{Preis}}]);
</script>

It doesn’t seem to collect anything in debugger. Trigger is set and works in GTM (same setup there), so I would exclude the trigger being at fault. Most likely I have addressed the variables in a wrong way, although the setup window suggests to use curly brackets for those.

Thanks in advance for any help.

//Edit: This is how the variable looks like

Hi,

just add a comma between ‘QualityCircle 360°Suite’ and {{Modul}} :wink: Tip: try something like that in the console (with sample values for all variables) on a tagged site. In most cases you will either get a helpful error message or the event occurs in your Tracker-Debugger. Saves a lot of time when testing.

And: if there is a sale (like in this case), ecommerce events seem the more appropriate option for tracking(?)

best,
Markus

2 Likes

Hi Markus,

thank you very much. It had to be something like this. :smiley: Yes, one could use an e-commerce event for this indeed. In this case it was an order button that was tracked, but agree.

Thanks again,
Sebastian

1 Like