Page 1 of 1

How to display a sum of clicks/download.

Posted: Tue Nov 18, 2014 8:55 am
by d-force
Hello and thank you for this useful script that works properly.

I just ask if there is a possibility to show in the page the sum of clicks/download of 2 or more files.

For example, in my page, I have 3 file to download:

file1.txt
file1.pdf
file1.kml

Of course for each file, CCount generate a different ID.

file1.txt = ID 1
file1.pdf = ID 2
file1.kml = ID 3

Now, I would like to display in the page the sum of these 3 download as follow:

<script>ccount_display('1+2+3')</script>

Is it possible?

Thank you in advance for your support!

d-force

Re: How to display a sum of clicks/download.

Posted: Tue Nov 18, 2014 8:13 pm
by Klemen
You could try something like this in the place you wish to show the sum:

Code: Select all

<script type="text/javascript">
var sum = ccount[1]['c'] + ccount[2]['c'] + ccount[3]['c'];
document.write(sum.formatThousands('US'));
</script>
To sum unique clicks you would change 'c' to 'u'

Re: How to display a sum of clicks/download.

Posted: Tue Nov 18, 2014 8:36 pm
by d-force
Hello Klemen,
I will test again tomorrow, but it seems working.

Thank you so much! It has been very kind from you!

d-force