Help - Search - Members - Calendar
Full Version: Add tracking pixel to html button
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
I need the tracking pixel to fire with a button click. How do I insert this code into a button so it fires when clicked. I am using this on a wordpress site.

Please give an example of the code and as much detail as possible. Thanks

<script type="text/javascript" src=""></script>
You could use an <a> tag to place the 'href' in. Then you use CSS to style the <a> link as a button.


Use a <button> tag with an 'onclick' event to run a javascript function. In the function you would use 'window.location.href = ""'

A google search will show thousands of examples.
Too little information. I assume the script generates a pixel image and if so it probably won't work to just link to the script. Since you use a fake URL we can't read the script and can't find out exactly what it does. And what's the button for? What does it do, more than hopefully activate the counter thingie?

If what you want is to count clicks on the button, there are easier ways to do that.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.