Jump to content

Featured Replies

  On 2/6/2025 at 7:18 PM, virap1 said:

I need it inside the <head> as that is where the auto ads javascript goes.

You can use the Google Analytics integration to insert Javascript includes into the <head>

  • Author

this has been mentioned before, but as I explained I need to show that only to guests and not show that in 2 forums. I don't think the google analytics solution can do that.

  On 2/6/2025 at 7:25 PM, virap1 said:

this has been mentioned before, but as I explained I need to show that only to guests and not show that in 2 forums. I don't think the google analytics solution can do that.

Currently, there is not anything else which will place this in the <head> and allow for customization like you need. You can place the Javascript in the body to get the results you want but not sure if Google will be against that.

  On 2/6/2025 at 7:30 PM, Jim M said:

Currently, there is not anything else which will place this in the <head> and allow for customization like you need. You can place the Javascript in the body to get the results you want but not sure if Google will be against that.

As many use Adsense or other ad providers to monetise their forums we do need a solution to place the JavaScript ad code into the head section and based upon weather user is logged in or not or has bought a subscription (nexus) to remove the ads.

the solution as it is in v4 where a custom location could be set for the ad script and including it in the globalTemplate head section was a good solution.

As this is missing in v5 we definitely need a valid alternative. Weather it’s a hook that ads the script to the head section or something else, we would need a solution.

  On 2/6/2025 at 7:37 PM, Sander Vancanneyt said:

As many use Adsense or other ad providers to monetise their forums we do need a solution to place the JavaScript ad code into the head section and based upon weather user is logged in or not or has bought a subscription (nexus) to remove the ads.

the solution as it is in v4 where a custom location could be set for the ad script and including it in the globalTemplate head section was a good solution.

As this is missing in v5 we definitely need a valid alternative. Weather it’s a hook that ads the script to the head section or something else, we would need a solution.

The advertisement module will still allow you to filter based on member group. However, <head> is not an option of where the advertisement code is injected. If you require this, I would suggest creating a Feedback topic for it.

There is a hook point available in the <head> tag, but there is a bug which is preventing it from being shown in some installations. That bug has been fixed and the fix will be available soon.

  • Author

Thanks. Can you share some details? what is the name/path of the hook? is it under the system? when will this be availlable?

  On 2/6/2025 at 8:16 PM, Esther E. said:

There is a hook point available in the <head> tag, but there is a bug which is preventing it from being shown in some installations. That bug has been fixed and the fix will be available soon.

Ok, so when using a hook, syntax to check user groups that should get ads would be (documentation lacks a bit what the member object contains):

{{if !in_array(member.id.primaryGroup.id,[4,9,17,282] }}
Ad code here
{{endif}}
  On 2/6/2025 at 4:59 PM, virap1 said:

2.png

What I am doing wrong?

It's usually obvious, btw.

(Sorry. I tried to hold back, but I couldn't help myself.)

  On 2/6/2025 at 8:26 PM, virap1 said:

Thanks. Can you share some details? what is the name/path of the hook? is it under the system? when will this be availlable?

System -> front/global/globalTemplate -> head

As to when it will be available, that would be a question for @Matt .

Recently Browsing 0

  • No registered users viewing this page.