我在使用onOptionsItemSelectedAndroid Studio的默认"设置活动"(使用extends AppCompatPreferenceActivity)时遇到问题.活动的重要部分是:
public class SettingsActivity extends AppCompatPreferenceActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupActionBar();
}
private void setupActionBar() {
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
public static class GeneralPreferenceFragment extends PreferenceFragment {
// [...]
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home) {
startActivity(new Intent(getActivity(), SettingsActivity.class));
return true;
}
return super.onOptionsItemSelected(item);
} …Run Code Online (Sandbox Code Playgroud) 我的网站上运行 ga4 谷歌分析,实时报告很棒
我想要一份使用“内容组”将网站页面 (+3000) 分组为 20 或 30 个基本主题的新报告
我尝试关注https://support.google.com/analytics/answer/11523339?hl=en 并添加
gtag('set', 'content_group', 'ZZZ');
Run Code Online (Sandbox Code Playgroud)
在我的 GA4 脚本中
gtag('config', 'G-nnnnn' );
Run Code Online (Sandbox Code Playgroud)
ZZZ 根据每个网页而变化。ZZZ 可以取大约 30 个不同的值
48 小时后,虽然在 chrome 控制台中没有看到任何错误,但如果我转到 google Analytics ->“页面和屏幕:页面标题和屏幕类别”报告并按“内容组”过滤第一列,我只会得到一个空行,不是 ZZZ 值
我缺少什么?谢谢