Frage

I'm working on a Wordpress blog entry, with a particularly tricky feature incorporated into it.

Quite simply, the post is a social experiment to examine which of two links are more likely to be clicked.

Two links will be posted to Twitter.

One will be advertised as something like "JUSTIN BIEBER ANNOUNCES RETIREMENT! bit.ly/WHATEVER1"

The other will be advertised as "DO YOU WANT TO MAKE THE WORLD A BETTER PLACE? bit.ly/WHATEVER2".

Both of these links will redirect to the same page - the page of the blog entry - and this blog entry will have 2 counters, one recording the number of clicks for each link, and then a discussion comparing the interest in Celebrity gossip to the interest in humanitarian values.

The issue is found in trying to incorporate this. The requirements for this, as far as I can see, are that:

  • The counters must be compatible with a Wordpress post.
  • Two separate counters must be allowed in the code.
  • The counters must track the link clicks, not the page hits.
  • The links tracked must lead back to the same page.

I thought of several ways to achieve this, but all had some flaws.

1: Use two separate html frames in the post to two separate click recording sites. This means that the information must be publicly available, requiring no more than the tracking code. - blasze.tk allows public access to tracked data, BUT: One, it displays too much info (IP addresses). (e.g. http://blasze.tk/track/DBZ6MU/) - Google Analytics allows access, but as it turns out, it is incompatible with a frame without use of Javascript, and Javascript is (as I understand it) disallowed in Wordpress posts. (e.g. http://goo.gl/#analytics/goo.gl/Vmnf/all_time)

2: Use a Wordpress plugin that interacts with the GA API. - No plugins are available that track link clicks, only page hits (that I could find).

3: When the link is clicked, it goes to a custom page in my domain (outside of Wordpress), which runs a script increasing a ticker stored on the domain (in a txt file, I would guess), and then redirects to the blog page. The blog page then uses html to read from that text file and displays that value. - In all honesty, I suspect that this would probably work, but I just have absolutely no idea how to set up such a system, and I'm not wanting to invest hours or days into trying to work it out if any experts on here consider it undoable.

So the question then is, what is the best option? 1: Is there some way around this frame issue? (It could then be done by public Google Analytics.) 2: Is there a plugin I missed that could achieve this? 3: If all else fails, is this third option possible, and if so, how difficult would it be to implement?

Sorry for the long question, but context was kinda necessary. :P

Thanks!

War es hilfreich?

Lösung

Trigger a javascript event to google analytics for tracking. You should just be able to use the onclick event similar to this.

GA Event Tracking + onClick="document.location.href='

Googles documentation https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

Andere Tipps

There are a lot of wordpress plugins for A/B testing (which is pretty much what you are doing), here is an article with how to conduct an A/B test using Wordpress and Analytics: http://www.wpbeginner.com/wp-tutorials/how-to-ab-split-testing-in-wordpress-using-google-analytics/

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top