WordPress.org

Ready to get started?Download WordPress

Forums

MaxButtons: WordPress Button Generator
[resolved] Customized Button URL Code (6 posts)

  1. cwensink
    Member
    Posted 10 months ago #

    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/

  2. cwensink
    Member
    Posted 10 months ago #

    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

  3. johnbhartley
    Member
    Plugin Author

    Posted 10 months ago #

    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.

  4. johnbhartley
    Member
    Plugin Author

    Posted 9 months ago #

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

  5. marjoleintje
    Member
    Posted 5 months ago #

    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?

  6. johnbhartley
    Member
    Plugin Author

    Posted 5 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic