WordPress.org

Support

Support » Plugins and Hacks » WordPress Button Plugin MaxButtons » [Resolved] Customized Button URL Code

[Resolved] Customized Button URL Code

  • I’m starting to use commission junction for affiliate links, and the tracking URL’s that are set up require a 1 pixel image to be included with a standard html link.

    I also would like to add Google Event Tracking Code to each link to track the success of various buttons so I would have something like this:
    Before:

    after:

    How would I set up these customized link structures in the html of a button?

    http://wordpress.org/plugins/maxbuttons/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Looks like the link structure didn’t work for the examples, let me try again:

    before:  <a href="http://product-page.com">Product</a>
    
    after: <aonclick="_gaq.push(['_trackEvent', 'Affiliate', 'Vendor', 'product-reference']);" href="http://product-page.com">Product</a>

    Product Page: HP Probook 4440s Sample Product Page

    Plugin Author johnbhartley

    @johnbhartley

    The MaxButtons output should look something like this:

    <a class="maxbutton-1" href="http://product-page.com">Product</a>
    // not using any container or center aligning

    So you have two ways to get it the way you want.

    1) use View CSS and create the button yourself. Create your link with the tracking code and add your class of maxbutton-1 or whatever number it is. Go to the bottom of your button edit page and “View CSS.” Grab that CSS and plop it into your style.css file. Now you’ll be able to use it for your self-created .

    or

    2) Use jQuery
    1 is definitely the more favorable approach, so give it a shot and if you can’t get it let me know and we’ll go from there.

    Plugin Author johnbhartley

    @johnbhartley

    Did that work for you? Marking as resolved, but can re-open if you still have questions.

    Hi,

    I would also like to track the clicks on my maxbuttons. I already have my google analytics event tracking code, but I don’t understand step one.

    Where am I supposed to add my code?

    Plugin Author johnbhartley

    @johnbhartley

    You’ll need to add the code in either your Post or Page via the Text Editor or you’ll need to add it directly to your template file.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Customized Button URL Code’ is closed to new replies.
Skip to toolbar