Phone and Email tracking with Google Analytics and jQuery

Update: Handle tag manager’s dataLayer and new Analytics gtag into script Correctly print out log As explained in email tracking and phone call tracking articles before, it’s possible to track phone and email click using Google Analytics event. Now what if we want to track both of them? We can simply copy and paste from both articles and it will work fine. Alternatively, we can consolidate the two scripts into one and save some spaces. The requirement for this script

Continue Reading

Email tracking with Google Analytics and jQuery

Email Tracking With Google Analytics and jQuery

Similar to setting up phone call tracking, now let’s set up an email tracking using Google Analytics and jQuery. We will make use Google Analytics event tracking to help us achieve this. The requirement for this script to run successfully is to have the email wrapped in <a> tag with mailto: href. Let’s say your email tag looks like below: [crayon-5a61807d05c53052591837/] Now you can put the following script after you load Google Analytics and jQuery. [crayon-5a61807d05c5c581066108/] What does the above script do? The

Continue Reading

Solving Laravel Homestead Sync Issue with VirtualBox in Windows 10

Solving Laravel Homestead Sync Issue with VirtualBox in Windows 10

I was very frustrated with setting up Laravel Homestead to sync with my windows 10. So hopefully this tutorial can help you who are facing the same issue with me. Prequisites Before we start, let me tell you that I have tested with the following app versions: VirtualBox 5.1.14 & 5.1.18 Vagrant 1.9.1 & 1.9.2 If you are not sure, just download: VirtualBox 5.1.18 Vagrant 1.9.2 You can use the below step if you have followed the Laravel documentation https://laravel.com/docs/5.2/homestead.

Continue Reading

Setting up phone call tracking with Google Analytics and jQuery

Setting up phone call tracking using Google Analytics can be confusing and devastating because it doesn’t go to a certain page, so we cannot use pageviews to easily track the conversion. The only available option is to use Google Analytics event tracking. In this post I will show you an easy way to track any phone number using Google Analytics and jQuery. The requirement for this script to run successfully is to have the phone call wrapped in <a> tag

Continue Reading

Automatically Create Directory When Uploading With CodeIgniter

Automatically Create Directory When Uploading with CodeIgniter

CodeIgniter does not automatically create a directory when uploading a file to a non-existent directory. There are some work around by handling it in controller when uploading the file, but the easiest way is to extend CI_Upload library. Harrison Emmanuel (Eharry.me) came up with a library to extend CI_Upload. Be sure to check his github gist. How To Use To use this library, you can create MY_Upload.php under your application/libraries folder and use the following code. libraries/MY_Upload.php [crayon-5a61807d067e5852144389/] And it’s done. You

Continue Reading

Making Silverstripe Editor – TinyMCE Smaller

Silverstripe uses TinyMCE for its HTMLEditorField. By default, the editor is rendered relatively tall. But how do we change the height to make it smaller without having to alter Silverstripe core file? Silverstripe provides setRows() function to modify HTMLEditorField height. So you can make it smaller or bigger (if you think the default is not big enough). As usual, you can chain the function after ::create() like below: [crayon-5a61807d06b84373024870/]  

Modifying Silverstripe 3 Member Lock Out

By default, Silverstripe gives 10 attempts for user to sign in. The easiest way to modify the lock out delay and number of attempt in Silverstripe 3 is through config.yml Go to mysite/_config/config.yml and add the following code: [crayon-5a61807d06eb9470193490/] And voila, your silverstripe lock out system is updated without the need to update the Silverstripe’s core. If you ever need to access Member’s attribute regarding to lock out, you can use the following: (assuming $member is an instance of Member class) $member->LockedOutUntil

Continue Reading

Adding Description in Silverstripe CMS Fields

When building forms, there are times when we want to display helpful information regarding the field. There are a couple of ways to do this: by using LiteralField or using setDescription() in the field object. Silverstripe provides setDescription() function in a field object to help generating text underneath a field. This field can be chained with other function. So you can set the description on creation like below: [crayon-5a61807d0720a585987857/] Or when you adding a field to a tab: [crayon-5a61807d07212394556338/]  

Continue Reading

Free Stock Photo Images Websites

Photography plays a lot of roles in web design. Good design with bad images is a no go situation. As a web developer, there are times when I need to use great photos to make my mockup looks alive or when building web templates. Thankfully, there are a good number of websites with fascinating stock photo popping up all over the web. And they’re free. About Licensing Many of these photographs are free from copyright restrictions or licensed under creative commons public

Continue Reading