Redirect Google Image

Hello,
I’m testing a Wordpress plugin that redirect Google Image visitor directly to my site. But Piwik does not count them as coming from Google Image but as direct visitor. I don’t know if there is a solution to this.

The code used


function google_images_redirect() {
    
     echo '<script type="text/javascript">var isInIFrame = (window.location != window.top.location) ? true : false; if (isInIFrame) window.top.location = window.location;</script>';

If the script redirects users with this JS code, then the referrer header will be lost, so piwik can’t track it: Troubleshooting - Analytics Platform - Matomo

OK, thank you for answer.It will help me to choose a solution.