Y
Y
Yaroslav TheRock2016-11-03 01:31:11
PHP
Yaroslav TheRock, 2016-11-03 01:31:11

Every time you visit the site, the background image changes. Is it possible to do? How to set goals in the metric?

(1.Question)Is it possible to make sure that visitors who go to the site are equally shown different background images. Let's say that the first user who goes to the site is shown the first picture, the second user - the second picture, the third - the third picture. There are 4 pictures in total. And it's so cyclical.
(2 Question). Is it possible to somehow set goals in the metric so that it is counted when the user downloads the file, or when the modal window is displayed?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
Combat7, 2016-11-03
@Combat7

2 question. Yes, select the target "event"
And through javascript hang an event on a click on a file, or on a click on a modal window)

A
Alexey Aleksin, 2016-11-03
@leroyleroy

On the first question - we store the path to the image in a variable, then on the main page we stupidly increase i++ each time the page is opened and give the path to the image for the background. If we don’t want the page to change the background every time for the same user, then first we check his session or cookies before the counter, and after them we give out the path, increase the counter, enter data into the session, cookies.

K
Karl Meinhoff, 2016-11-19
@KarleKremen

We take several pictures, number them, then for each newcomer we generate a random number and write it in cookies. Then we get the number from the cookies, and if we got it, then we display the picture with this number. Well, if not, then the user is a newcomer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question