The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Add tracking pixel to html button
texas
post Feb 5 2018, 09:35 AM
Post #1





Group: Members
Posts: 1
Joined: 5-February 18
Member No.: 26,583



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="https://thesite.net/e?adv=10444&ca=0&acc=375&tag=U6916"></script>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Feb 5 2018, 08:06 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,549
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



You could use an <a> tag to place the 'href' in. Then you use CSS to style the <a> link as a button.

OR

Use a <button> tag with an 'onclick' event to run a javascript function. In the function you would use 'window.location.href = "https://thesite.net/e?adv=10444&ca=0&acc=375&tag=U6916"'

A google search will show thousands of examples.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 6 2018, 12:30 AM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,054
Joined: 9-August 06
Member No.: 6



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 17th November 2018 - 02:16 PM