How to create metrics of specific events in Google Analytics or Data Studio?

On my site, I am firing an event when the user lands on a specific URL. I’m firing another event when the user clicks on a button on that specific page.

When I go to Analytics, I can see the Total Events + Unique events for each dimension (specific page view, button click on specific page).

How is it possible to create a new metric (I assume a calculated metric) to display the Unique Events as metrics for any dimension I’d like to use in a Table?

Here is an example of what I have now:

Event Label Total Events Unique Events
specific_page_views 100 50
specific_page_clicks 20 10

…and what I’d like to achieve:

Source Specific Unique Page Views Specific Unique Page Clicks Specific Page CTR %
(direct) 30 8 26.67
google 15 2 13.34
bing 5 0 0

I have been searching for an answer for many days now and can’t seem to find the answer to this simple question. I will want to create multiple of these Metrics, not just 2.

Is this actually possible with Google Analytics or Google Data Studio? (I’m planning to use Google Data studio)

Spam from specific user agent

I’ve been getting thousands of requests each day from a specific user agent, Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0. They’re all from different ip addresses (the ones I’ve looked up have been Google LLC and Cloudflare), and they all use that exact same user agent. nginx logs So far I’ve seen 90 unique ip addresses

ip count

I’ve started giving 403 statuses back to them, since it seems like something is wrong here, but I can’t trace them back to any one specific point. They all seem to be legitimate requests, but they’re just so suspicious with the amount of servers they’re coming from. Am I missing something here?

Lock out all WordPress Administrators except two specific users

I used the snippet below to lock out all administrators and editors except myself

if ( is_user_logged_in() ){     $  current_user = wp_get_current_user() ;     if ( in_array( 'administrator', (array) $  current_user->roles ) || in_array( 'editor', (array) $  current_user->roles )) {         if ($  current_user->user_login != 'sheila' ){             wp_logout();             return new WP_Error( 'login_again_please', 'Please log in again' );         }     } } 

When I try to add a second user in the second if statement we are both locked out:

if ( is_user_logged_in() ){     $  current_user = wp_get_current_user() ;     if ( in_array( 'administrator', (array) $  current_user->roles ) || in_array( 'editor', (array) $  current_user->roles )) {         if (($  current_user->user_login != 'john' ) || ($  current_user->user_login != 'sheila' ){             wp_logout();             return new WP_Error( 'login_again_please', 'Please log in again' );         }     } } 

How do I fix the above snippet to allow two administrators/editors with specific usernames to login or can I have an alternative with the same outcome?

Question regarding Pact magic with multiclassing and a class specific bonus

I play a 6 bard/ 4 warlock multiclass. My character recently obtained a rhythm makers drum +3, giving a +3 bonus to my bard spells’ DC and rolls.

I am curious if I were to cast a spell I had taken on my warlock list (hold person) with a bard spell slot, would the bonus increase the DC? DnDB added the bonus to all my characters spells (I know that isn’t right) but thought it may be applicable if a spell is on both lists.

Thank you in advance.

Doing add_rewrite_rule only for specific post type

so I have these two rules for projects CPT.

function addMyRules(){      // variables     add_rewrite_tag('%eventid%','([^&]+)');     add_rewrite_tag('%version%','([^&]+)');      // release-template rewrite     add_rewrite_rule('^projects/([^/]*)/([^/]*)/?$  ','index.php?projects=$  matches[1]&version=$  matches[2]','top');     add_rewrite_rule('^projects/([^/]*)/releases/?$  ','index.php?projects=$  matches[1]&version=releases','top');      flush_rewrite_rules(); }  add_action( 'init', 'addMyRules' ); 

But I have to get rid of that /projects/ prefix for some reason. However if I remove it, we end up having a problem that any page that has .com/something/else format would trigger rewrite.

Any way I could loop thru that custom post type and allow rewrite to run only if first var is one of post slugs?

Thanks!

How to get my specific Item index on inventory when pickup?

So I want to make some inventory system for my game, and I found some issue when collecting the item, what I want here matching the index Inventory_UI system exactly the same as currentIndex on the collected item, then display it on Inventory_UI system, let say I pickUp some item with the currentIndex = 1 so on Inventory_UI system index=1 too and so on. this happening when inventory description to so the id is same as itemIndex picked up.

so here the the script:

  • ItemManager( this for information of item ):
[System.Serializable] public class theItems {     public string Name;     public GameObject[] allCurrentPrefabs;     public int numberOfIndex;     public AudioClip[] allSound;     public string[] terjemahannya;     public string[] latinnya; }  public class _ItemManager : MonoBehaviour {     public static _ItemManager instance;      private void Awake()     {         instance = this;     }      public List<theItems> items;      [Header("SurahApa")]     public int Surah;      [Header("SoundStuff")]     public AudioSource aSource;       // Start is called before the first frame update     void Start()     {      }      // Update is called once per frame     void Update()     {      }      public void PlaySurah(int surahnya, int ayatnya)     {         aSource.clip = items[surahnya].allSurahSound[ayatnya];         aSource.Play();     } } 
  • CollectibleItem ( this attach to each item )
 public static _CollectibleAyat instance;      private void Awake()     {         instance = this;     }      public enum InteractionType     {         none, pickUp, Examine     }      public InteractionType interactType;      public int currentIndex;      public string terjemahannya;     public string latinnya;     public GameObject allCurrentPrefabs;      public UnityEvent customevent;      public void Reset()     {         GetComponent<Collider2D>().isTrigger = true;     }      public void interact()     {         switch (interactType)         {             //case InteractionType.none:             //    Debug.Log("None");             //    break;             case InteractionType.Examine:                  _InteractSystem.instance.Examine(this);                  Debug.Log("Examine");                  break;             case InteractionType.pickUp:                 // Add the object to the pickUpItems List                 // Delete the Object                  _InventorySystem.instance.PickUpItem(gameObject);                 gameObject.SetActive(false);                  Debug.Log("PickingUp");                 break;             default:                  Debug.Log("Null Item");                 break;         }          //Invoke (Call) the custom Event(s)         customevent.Invoke();     } 
  • This InventorySystem( when item pickup)
public static _InventorySystem instance;      private void Awake()     {         instance = this;     }      [Header("GeneralFields")]     public List<GameObject> items = new List<GameObject>();     public bool isOpen;     public int ayah;      [Header("UI Items Section")]     public GameObject UI_InventoryWindow;     public Image[] item_Images;      // Start is called before the first frame update     void Start()     {      }      // Update is called once per frame     void Update()     {         if (Input.GetKeyDown(KeyCode.I))         {             ToggleInventory();         }     }      public void ToggleInventory()     {         isOpen = !isOpen;         UI_InventoryWindow.SetActive(isOpen);     }      public void PickUpItem(GameObject item)     {         items.Add(item);         Update_UI();     }      public void Update_UI()     {         HideAll();          for (int i = 0; i < items.Count; i++)         {             item_Images[i].sprite = items[i].GetComponent<SpriteRenderer>().sprite;             item_Images[i].gameObject.SetActive(true);          }      }      public void HideAll()     {         foreach (var i in item_Images)         {             i.gameObject.SetActive(false);         }     }      //SampeSini     public void ShowDescription(int id)     {       }      public void HideDescription()     {      } 

note: on the ShowDescription(int id) i want to show item information what same as i picked up i have mentioned it above.

For the specific campaign of “Odyssey of the Dragon Lords”, can a javelin be considered a “ranged Weapon” for the purpose of using DEX to hit/dam?

In core 5e RAW rules, Javelins are simple melee weapons (STR based). However in this particular players guide they talk about Ranged weapons, which Javelins are mentioned.

On Page 20 of the "Odyssey of the Dragon lord" players manual:

Thylean Weapons Warriors in Thylea typically use spears, shields, and swords. There are exceptions, of course, but the armies of Mytros and Aresia train thousands of soldiers in the use of these simple armaments. Heavier weapons, such as halberds and greataxes, are thought to be barbaric.

Ranged weapons are typically limited to javelins, slings, longbows, and shortbows, although there are some who have adopted the use of complex recent inventions, such as crossbows. These weapons are engineered in small quantities by the Academy and are not widely available. Thylea boasts a handful of unique cultural weapons, which can be found at just about any blacksmith or adventuring shop. With the exception of the chakram, they function identically to their normal counterparts (unless they are magical).

There are other places where they change/add new descriptors to existing core weapons. For example page 49 of the same players guide:

Vagrant Soldier Despite your roguish demeanor, you have all the training of a common soldier. When you choose this archetype at 3rd level, you gain proficiency with shields. Additionally, spears and tridents count as finesse weapons for you.

If anyone has played this campaign and can prove a definitive ruling on this question – using RAW or other items from the publishers, that would be great.

As usually, it is up to the DMs discretion for a final ruling – this is a known and doesn’t need further mentioning as part of an answer.

Thank you.