google analytics - How to fire a tag if certain element on the page? -


i'm trying fire tag if "id = success" element on page. possible? thank you.

i assume use new interface (since old interface phased out in case). assume "success" element there when page loaded (i.e. not created dynamically).

go variables, scroll down "user defined variables2 click "new", select "dom element". "selection method" preselected "id", can leave that. in "element id" enter the, well, id of element (i.e. "success" in case). variable hold text of "success" element.

go triggers. click "new", select "pageview". in "trigger type" dropdown select "dom ready" (you can read id after elements have rendered). pageview provides event necessary fire tag.

klick "fire tag on". in dropdown select custom variable previous paragraph. condition enter "contains" , 1 of words success element contains.

alternatively should able, when creating dom element, enter "id" in "attribute" field. if fill in attribute field variable hold value of attribute, if select "id" variable value will, in case, "success".


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -