1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Track a specific event (javascript) with analytics

Discussion in 'Google Analytics' started by slavipz, Dec 30, 2016.

  1. #1
    Hello All,
    I'm showing an ad for a client of mine, by using a java script which is inserted in the footer section of my wordpress site. What the script do is showing an overlay with the site of my client (you can check it out here: informiran.net). The script itself is as follows:

    <!-- advertising someIDhere=-->
    <script data-cfasync="false" type="text/javascript">
    (function (document, window) {
    var c = document.createElement("script");
    c.type = "text/javascript";
    c.async = !0;
    c.src = "//linktojavasript.js?=" + Math.floor((new Date).getTime());
    var a = !1;
    try {
    a = parent.document.getElementsByTagName("script")[0] || document.getElementsByTagName("script")[0];
    } catch (e) {
    a = !1;
    a || ( a = document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]);
    a.parentNode.insertBefore(c, a);
    })(document, window);
    <!-- end advertising -->

    I have analytics up and running and I track all other aspects of the user befaviour. So my question is, how can I make google analytics to track how many times the script has shown the popup target webpage.
    Thanks in advance.
    slavipz, Dec 30, 2016 IP