Cardinal Path’s response to COVID-19 Cardinal Path is sharing all we know to help marketers during COVID-19.  Learn more.

Usually you won’t get a lot of traffic from Images Search – close to nothing in fact – but for certain web sites with a high volume of organic traffic, around 85%, and good quantity of search engine optimized images it can be close to 13% of the total visits.

This added traffic sure will help you get some extra conversions and who doesn’t want that?

Optimizing images is not that difficult, but it is a task you have to do every time you upload a picture. And unfortunately there is no easy way to know the yield of this work.

Web analytics tools are not going to tell you (at least not right out the box) the quantity of Image Search traffic, the keywords user searched at Google Images, the exact image that is appearing on the search engine results pages, nor the exact page in your site where the image is allocated.

PHP script to the rescue

It would be fantastic to have all these details to help your image optimization work and here is where I come in, with a piece of PHP code.

This script is doing three basic tasks:

  • Getting the referrer
  • Guess which of the major search engines is, Google, Yahoo or Bing
  • Analyze the query string and extract as many relevant details as possible

<?php

              // Get referral’s URL

              $referral_url = $_SERVER[“HTTP_REFERER”]

              // Parse referral

              $url = parse_url($referral_url);

              $url_decoded = urldecode($url[query]);

              $params = array();

              parse_str($url_decoded,$params);

              // Show details according to referral

              switch ($url[path]) {

                  case “/imgres”:

                            // Google Images

                            echo “<b>Search Engine:</b> $url[host]<br/>”;

                            echo “<b>Image url:</b> $params[imgurl]<br/>”;

                            echo “<b>Page of image:</b> $params[imgrefurl]<br/>”;

                            $prev_values = array();

                            parse_str($params[prev],$prev_values);

                            echo “<b>Keywords:</b> “.$prev_values[“/images?q”].”<br/>”;

                            break;

                  case “/images/view”:

                            // Yahoo Images

                            echo “<b>Search Engine:</b> $url[host]<br/>”;

                            echo “<b>Image url:</b> http://$params[imgurl]<br/>”;

                            echo “<b>Page of image:</b> $params[rurl]<br/>”;

                            echo “<b>Keywords:</b> $params[p]<br/>”;

                            break;

                  case “/images/search”:

                            // Bing Images

                            echo “<b>Search Engine:</b> $url[host]<br/>”;

                            echo “<b>Keywords:</b> $params[q]<br/>”;

                            break;

                  default:

                     echo “Non major Search Engine”;

              }

?>

What kind of data can be collected

Google Images is the one who is going to send most of this traffic, Yahoo Images send very little or nothing and the day I see Bing Images sending any visit is yet to come, but who knows?

Both Google and Yahoo are passing: keywords, Image URL and URL of the page in your site, as well as the search engine with the specific country code, so we can grab them all.

Bing is only going to tell the keywords the user searched, not surprisingly.

What else?

Feel free to modify the way you want the script to insert it in your site and collect all this data.

If your site is not using PHP as a server side script language you still can take the idea and replicate it in your favorite language.

My recommendation is to have a table in the database gathering the details with a time stamp, giving you some basic stats of when the visits from images are coming and the number of them.

More than just the insights you can get, this represents the possibility to delve into behavioral targeting according to what brought the visit to the site, just add your imagination.

 

Sharing is caring!

Popular

COVID-19 Crisis Navigator​

In partnership with Dentsu, Cardinal Path helps you distill the overwhelming news and information into a bi-weekly report highlighting emerging trends and insights during the pandemic.

EXPLORE THE REPORT

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Success!
Your message was received.

Thank you.

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Thank you.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Click here to download access the tool.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Thank you for submitting the form.

Thank you for submitting the form.

Cardinal Path hosted a live session to connect with you and answer all your questions on Google Analytics.
Get all the expertise and none of the consultancy fees in this not-to-be-missed, rapid-fire virtual event.

Thank you for registering.

Cardinal Path is continuing with its series of free training. Next we are conducting training on Google Data Studio. Check it out here.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for your submission.

Message Sent

Thank you for registering.

You will receive a unique link to view the webinar via email.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Success! Thank you
for reaching out.