How to find silverlight version using google analytics?

by cameron_walter , in category: SEO Tools , a year ago

How to find silverlight version using google analytics?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by creola.ebert , a year ago

@cameron_walter 

Google Analytics does not directly provide information about the version of Silverlight being used. However, you can collect this information by implementing additional tracking code on your website.


To determine the Silverlight version using Google Analytics, you can follow these steps:

  1. Create a custom dimension in Google Analytics to track Silverlight versions. Go to your Google Analytics account, navigate to Admin, then select "Custom Definitions" under the Property column, and finally click on "Custom Dimensions." Create a new dimension called "Silverlight Version."
  2. Add the following JavaScript code to your website, which will extract the Silverlight version and send it to Google Analytics as a custom dimension:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<script type="text/javascript">
  (function() {
    var slPlugin = null;
    if (window.ActiveXObject) {
      try {
        slPlugin = new ActiveXObject("AgControl.AgControl");
        document.write('<param name="onload" value="pluginLoaded" />');
      } catch (e) {
        slPlugin = null;
      }
    } else {
      if (navigator.plugins["Silverlight Plug-In"]) {
        slPlugin = true;
        document.write('<param name="onload" value="pluginLoaded" />');
      }
    }

    window.pluginLoaded = function() {
      if (slPlugin) {
        var silverlightVersion = slPlugin.version;
        ga('set', 'dimension1', silverlightVersion);
        ga('send', 'event', 'Silverlight', 'Version', silverlightVersion);
      } else {
        ga('set', 'dimension1', 'Not Installed');
        ga('send', 'event', 'Silverlight', 'Version', 'Not Installed');
      }
    };
  })();
</script>


  1. Replace the usage of ga in the code snippet to match your Google Analytics tracking code. If you are using gtag.js, replace ga with gtag accordingly.
  2. Add the custom dimension to your Google Analytics tracking code or tag manager. Modify your tracking code by adding the dimension1 parameter as follows:
1
2
3
ga('create', 'UA-XXXXX-Y', 'auto');
ga('set', 'dimension1', 'Not Installed'); // Default value if Silverlight is not installed
ga('send', 'pageview');


Make sure to replace 'UA-XXXXX-Y' with your actual Google Analytics property ID.

  1. Publish the updated code on your website and wait for visitor data to be sent to Google Analytics. After some time, navigate to the "Custom Reports" section within Google Analytics and create a new report. Include the custom dimension "Silverlight Version" as a dimension to analyze the version data.


By following these steps, you will be able to track the Silverlight version being used by your visitors using Google Analytics.