XF 2.2 Template variable for public/private page detection?

Cyberkef

New member
On our website we are currently experimenting with Google Adsense (in the "Container breadcrumb (top): Above" location) for guests and opted-in users (via a custom user field variable).

Everything works like a charm for guests, but for the opted-in members the ads do not load on pages that are not accessable for the Google Adsense Crawler (like our private crewfora, but also the pages for user account settings, private messages,...). This is completely as expected and not really a problem for those opted-in users that it shows a small empty space instead (we know the function to let the Google Adsense crawler login to index those pages exists, but that is not really necessary for our use case), but we recently got some e-mails about Google being slighly annoyed that they can't see what is on that page (again, completely as expected and we know this is nothing to panic about since we will not loose any money for this specific "problem", it is not a critical violation).

However, the perfectionist in me was wondering IF there exists a way (most likely via some form of template variable) to detect if the content of an Ad Location (or specific Page it is loaded on) is "public" or if a user needs to be logged in to see its content without building a huge list of exceptions (forum/node id's, pages, ...).

Probably a long shot or not even possible at all, but one can only try :D
 
Solution
XF doesn't have any concept of that as page viewing permissions can vary for individual members and user groups.

If the list of exceptions is large, then use conditional statements to only show ads on pages which are available to guests.

Brogan

XenForo moderator
Staff member
XF doesn't have any concept of that as page viewing permissions can vary for individual members and user groups.

If the list of exceptions is large, then use conditional statements to only show ads on pages which are available to guests.
 
Solution
Top