Web Developer Needs Some Advice

Lacubrious

Newbie
Joined
Jul 11, 2016
Messages
6
Reaction score
2
Hi guys,

I've recently created a few landing pages for Free Wi-FI. On these pages, we have a mix of content, some of it lives on the website and the rest comes from third-party providers such as CNN, etc. The client wants to be able to measure how users interact with the website. I know there is a way to set up some events in Google Analytics to track user activity within the website, but I'm not sure how this can be achieved with the third party content. I.e. what can I do to provide some sort of stats of what articles they click from the other content providers or even some sort of tracking to be automatically added to the third party links so that I can build profiles of the users logging into the Free Wi-Fi network?
 
Well, I'm not completely sure what you're looking for so forgive me if I'm missing something.
But if you want to see what links on your page people clicked for example, you could use Javascript to track it..
something like below would give you an array of whether they clicked specific links or not.
You could then store it in a database or something depending on your setup, there are many ways to do this some better than others.
Elaborate on the issue if this doesn't help.


HTML:
<script>
    var links = [false, false, false];
    function clickedLink(index){
        links[index] = true;
    }
</script>


<a href="#" onclick="clickedLink(0)">
Link 0</a>

<a href="#" onclick="clickedLink(1)">
Link 1</a>

<a href="#" onclick="clickedLink(2)">
Link 2</a>
 
It is done via iframe yes. What I'm looking for is let's say you look at the content inside the iframe which comes from CNN. If you click on any of the links inside the iframe, it will take you to the CNN page, my question is whether it is possible to attach a script inside that iframe so that when a user clicks on any of the links inside the iframe, some tracking code to be added immediately to their browser so I can track what they've been reading on the CNN website.
 
Back
Top