Blog Post:Those of you who logged in to the Admin Console in SiteCatalyst since this past Thursday afternoon to generate new JavaScript code may have noticed that we released code version H.21. The primary purpose of this update was to add ClickMap support for the <button> element, so that you can see the number of clicks on form buttons using the ClickMap plug-in. If need to be able to report on button clicks immediately, you may want to consider upgrading to this new code version after testing it extensively in a development environment. Speaking of ClickMap support for the <button> element, we strongly recommend using the s_objectID variable in the onclick event handler of your <button> elements. In our experience, use of <button> almost always involves an onclick event handler which performs the button's practical function (e.g., submitting a form, launching a pop-up, etc.). They never involve an href (and never should). This leaves ClickMap needing to use the onclick function to identify the page element, and this gets messy—especially when you consider that IE and Firefox report them to ClickMap differently. Fortunately, there's an easy solution: put an s_objectID variable—with a value unique to each distinct button—in the onclick for the button. For example: <button type="submit" onclick="var s_objectID='abcd1234';myFormSubmitFunction();"> <button onclick="var s_objectID='some_unique_value';launchPopup();"> (Also, note that while the "type" attribute is not expressly required, when it is omitted—as in the second example above—IE will assume a type of "button," and other browsers will assume a type of "submit." This means that depending on which browser you are running ClickMap in to view the page, you will see a different number of clicks for the button, as it will only be reporting on the portion of the data which matches the implied type for the browser you are using. This limitation is also overcome by using s_objectID.) Author: Date Created:January 19, 2010 Date Published: Headline:Code version H.21 released Social Counts: Keywords: Publisher:Adobe Image:https://blogs.adobe.com/digitalmarketing/wp-content/uploads/no-image/no-image.jpg

Those of you who logged in to the Admin Console in SiteCatalyst since this past Thursday afternoon to generate new JavaScript code may have noticed that we released code version H.21. The primary purpose of this update was to add ClickMap support for the <button> element, so that you can see the number of clicks on form buttons using the ClickMap plug-in. If need to be able to report on button clicks immediately, you may want to consider upgrading to this new code version after testing it extensively in a development environment.

Speaking of ClickMap support for the <button> element, we strongly recommend using the s_objectID variable in the onclick event handler of your <button> elements. In our experience, use of <button> almost always involves an onclick event handler which performs the button’s practical function (e.g., submitting a form, launching a pop-up, etc.). They never involve an href (and never should). This leaves ClickMap needing to use the onclick function to identify the page element, and this gets messy—especially when you consider that IE and Firefox report them to ClickMap differently.

Fortunately, there’s an easy solution: put an s_objectID variable—with a value unique to each distinct button—in the onclick for the button. For example:

<button type="submit" onclick="var s_objectID='abcd1234';myFormSubmitFunction();">

<button onclick="var s_objectID='some_unique_value';launchPopup();">

(Also, note that while the “type” attribute is not expressly required, when it is omitted—as in the second example above—IE will assume a type of “button,” and other browsers will assume a type of “submit.” This means that depending on which browser you are running ClickMap in to view the page, you will see a different number of clicks for the button, as it will only be reporting on the portion of the data which matches the implied type for the browser you are using. This limitation is also overcome by using s_objectID.)