If you want to create a tag in Mouseflow for a specific URL parameter, you can do this by passing in some information using our JS API. By modifying the code below you can pass in Key/Value pairs into a tag.

The URLSearchParams interface defines utility methods to work with the query string of a URL. Using the Web API we can pass in data to Mouseflow.

Tagging a URL Parameter Value

Example URL: www.mouseflow.com/?example=querystring

Using the URL above, we can get the parameter value of "example".

const param = new URLSearchParams(window.location.search)
param.get('example') //parameter key

Passing in "example" will return the value for of the parameter key.

var tagName = param.get('example') //returns value
'querystring' //value

After modifying the code above to match your URL query string parameters, you can create the tag to push to Mouseflow. For more information on tags, you can refer here.

window._mfq = window._mfq || []; 
window._mfq.push(["tag", tagName])

Did this answer your question?