Jump to content


Photo

[Snippet] Trackclicks Snippet


  • Please log in to reply
No replies to this topic

#1 vampke

vampke

    Likes Etomite Forums!

  • Member
  • PipPip
  • 174 posts

Posted 09 November 2012 - 10:50 AM

File Name: Trackclicks Snippet
File Submitter: vampke
File Submitted: 08 Nov 2012
File Category: Miscellaneous

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!

Click here to download this file




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users