Answer the question
In order to leave comments, you need to log in
Is it possible to pass a variable to the metric target like this?
I make counters by utm tags
I get the label of the current page like this
let utmObject = Object.fromEntries(window.location.search.slice(1).split('&').filter(item => item.indexOf('utm') !== -1).map(item => item.split('=')));
ym(52810492,'reachGoal',utmObject.utm_source.toString())
Answer the question
In order to leave comments, you need to log in
You can check if the goal worked.
Add a get variable to the address bar, like this:
example.com/?_ym_debug=1
And after the target fires, you will see the response in the browser console.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question