Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthew Law 2 posts 82 karma points
    Aug 09, 2021 @ 10:14
    Matthew Law
    0

    Is it possible to access page view data via the C# API? I wish to access the top 10 viewed pages.

  • Daniël Knippers 153 posts 1116 karma points MVP 2x c-trib
    Aug 10, 2021 @ 06:50
    Daniël Knippers
    100

    Hi Matthew,

    There is no C# API (yet) to retrieve the top X most visited pages. You can query the tables directly though. Something like this should work:

    SELECT TOP 10 p.protocol, p.domain, p.path, COUNT(p.id) pageviews
    FROM [uMarketingSuiteAnalyticsPageview] pv
    JOIN uMarketingSuiteAnalyticsPage p 
    ON pv.pageId = p.id
    GROUP BY p.id, p.protocol, p.domain, p.path
    ORDER BY COUNT(p.id) DESC
    

    If you also want Umbraco node ids you can get those by joining the uMarketingSuiteAnalyticsUmbracoPageVariant table (on pageview.umbracoPageVariantId).

    If this does not work for you, let me know!

    Regards, Daniël

Please Sign in or register to post replies

Write your reply to:

Draft