In order to shift this traffic medium from referral to organic, all you need to add is add this additional code which is highlighted in bold.
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
pageTracker._addOrganic("google", "prev");
pageTracker._trackPageview();
} catch(err) {}
</script>
After the code has been modified, the next thing you need to do is go to your Google Analytics account and do the following.
Click on Filter Manager and fill these details under Create New filter.
Filter Name: Put a name that is easily identifiable or associating to the tracking. E.g.: Google Images
Filter Type: Select "Custom Filter" & Click on "Advanced"
Field A -> Extract A: Select Campaign Term and punch in the following values in the next column "/images?(.*)(q|p)=([^&]*)"
Field B -> Leave this field empty
Output To -> Constructor: Select "Campaign Term" and type image search $A3 in the next column.
Field A Required - Yes
Field B Required - No
Override Output Field - Yes
Case Sensitive - No
Select the website profile on which you would like this filter to be applied and click on "Save Changes".
That’s it. You will now be able to track visits received through images in organic and the keyword information associated with the visitor’s image search.
I hope this information has helped you guys. Cheers!