Cannot set custom dimension on event

For the life of me, I can’t get this to track my custom dimension value (and yes, they and the goals are set up):

<button onclick="javascript:_paq.push(['trackEvent', 'Button', 'click', {dimension1: 'TEST'}]);">Click Me</button>

or this:

<button onclick="javascript:_paq.push(['trackGoal', 1 {dimension1: 'TEST'}]);">Click Me</button>

or this:

<button onclick="javascript:_paq.push(['setCustomDimension', customDimensionId = 1, customDimensionValue = 'TEST2']);">Click Me</button>

However, I can get this to work if I put it my footer:

_paq.push(['setCustomDimension', customDimensionId = 1, customDimensionValue = 'TEST2

Have I found a bug or am I missing something?

piwik version 2.16.0.

Anyone have any suggestions on this?

Why is this forum such a ghost town?

have you put your Piwik JS code in the <HEAD>?

Why is this forum such a ghost town?

It’s not ghost town. You’re complaining after 3 days because you didn’t get free support from our community. :slight_smile:

Hey, thanks for the reply. I realize it’s free and hope i didn’t offend! It’s just that I have seen other community products with a lot more community involvement and considering this is such a cool one, I’m surprised there’s not more action on these boards from other members. I’ll try to reply to some posts on here -where possible - just to help out. :wink:

to answer your question: no, it’s in my footer. Should it be in my ?

Also, did my event tracking look correct?

Actualy, i’m having a lot of trouble with this and hope someone can help.

I have a form that visitors can fill out on the site. I want to do two things with this form:

  1. get the user’s name from the form and set it as a custom dimension
  2. upon form submission, track it as a completed goal

I would like to then see the goals completed filtered by that dimension (which I know how to do).

What I can’t figure out is how to set the custom dimension AND the goal upon form submission. I’ve tried all of the above but I can’t seem to get it.