Jump to content


Photo

Trackclicks Snippet


  • Please log in to reply
4 replies to this topic

#1 vampke

vampke

    Likes Etomite Forums!

  • Member
  • PipPip
  • 174 posts

Posted 07 November 2012 - 10:36 AM

I have created a simple snippet that allows to track hyperlink clicks.
This can be used onsite or in newsletters. There is a database field for subscribers that I use on my site but is not used in the snippet as posted here.

To use it you will need to create
  • a database table *etomiteprefix*clicktrack
  • a snippet "trackclicks" snippet
  • a "showtrackclicks" snippet
  • an empty template containing only [*content*]
submit url variables cmp (campaign) and url (the url to be redirected to)
eg: in stead of using
<a href="http://www.google.com">google</a>

you can use
<a href="trackclick?cmp=googlecampaign&url=http://www.google.com">google</a>

every time a user clicks the above url the cmp and url will be stored together with the user IP in the db

use the snippet in a page with 'empty' template that contains ONLY [*content*] page needs to have cacheable set to OFF!
(in the example above the pages alias is trackclick and the site uses frienddly aliases

Hope it is useful for someone.

Attached Files


Edited by vampke, 07 November 2012 - 10:38 AM.


#2 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,786 posts

Posted 07 November 2012 - 10:55 AM

Please upload snippets to the Snippet Library - thanks!

#3 vampke

vampke

    Likes Etomite Forums!

  • Member
  • PipPip
  • 174 posts

Posted 07 November 2012 - 12:12 PM

Ok I just discovered the snippets in the download section, but apparently I "cannot upload a new file"

#4 Dean

Dean

    Loves Etomite Forums!

  • Admin
  • 4,786 posts

Posted 07 November 2012 - 03:29 PM

Choose your category first, then the button will appear ;)

#5 vampke

vampke

    Likes Etomite Forums!

  • Member
  • PipPip
  • 174 posts

Posted 08 November 2012 - 08:27 PM

I think the right terminology would be "derp!"




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users