
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@prokodo/n8n-nodes-ga4
Advanced tools
Google Analytics 4 via Service Account for n8n (runReport, realtime, metadata, timing helpers)
Query Google Analytics 4 with a Service Account — plus helpers for “best time to post”, landing pages & referrers — developed by prokodo.
/blog
)Internal node name: prokodoGa4
In the node picker: "prokodo (GA4)"
Using an older n8n (e.g. 1.88)? It may still work if you align n8n-core / n8n-workflow versions. For best results, upgrade n8n.
# choose your custom folder (default ~/.n8n)
export N8N_CUSTOM_EXTENSIONS=~/.n8n
# install the node into that folder
npm install --prefix "$N8N_CUSTOM_EXTENSIONS" @prokodo/n8n-nodes-ga4@latest
# start n8n
n8n start
FROM n8nio/n8n:latest
ENV N8N_CUSTOM_EXTENSIONS=/home/node/.n8n
ENV NODE_PATH=/home/node/.n8n/node_modules
USER node
RUN npm install --prefix /home/node/.n8n @prokodo/n8n-nodes-ga4@latest
After starting n8n, search in the node picker for “prokodo (PDF Toolkit)” Internal name: prokodoPdfToolkit
# in this repo
npm ci
npm run build
# make your package linkable
npm link
# link into your n8n custom extensions folder
npm link @prokodo/n8n-nodes-ga4 --prefix ~/.n8n
# start n8n with your custom folder
export N8N_CUSTOM_EXTENSIONS=~/.n8n
n8n start
Publish-ready tip: This package publishes compiled JS from dist/ to npm. You don’t need to commit dist/ to Git. To support installs straight from GitHub, add:
"scripts": {
"prepare": "npm run build"
}
…and commit src/ (not dist/).
Supply the raw GA4 RunReport body. Example: best hour×weekday by sessions
{
"dateRanges": [{ "startDate": "60daysAgo", "endDate": "today" }],
"dimensions": [{ "name": "hour" }, { "name": "dayOfWeek" }],
"metrics": [{ "name": "sessions" }]
}
Minimal body (add dimensions if you need them):
{ "metrics": [{ "name": "activeUsers" }] }
Returns property-scoped dimensions & metrics (handy for building requests dynamically).
All helpers compute (weekday × hour) “buckets” over a lookback window and then map them to the upcoming horizon.
Common options:
Metric for Timing: screenPageViews, sessions, or engagedSessions
Occurrence Mode:
Label Time Zone: IANA TZ (e.g., Europe/Berlin
) for human-readable labels
Lookback (days), Top K Buckets, Horizon (days ahead)
Blog Hours TopK
hostName
).candidates
(ISO datetimes in UTC)labels
(pretty, TZ-aware)buckets
with rank
, dow
, hour
, score
, share
Page Hours TopK
pathContains
(e.g., /
, /academy
, /product
) and optional Domain.Channel Hours TopK
screenPageViews
to sessions
if needed).Source Hours TopK
linkedin
, t.co
, instagram
) or sessionSourceMedium (toggle).Ensure N8N_CUSTOM_EXTENSIONS points to the folder where you installed the package. Restart n8n and search for “prokodo (GA4)”. Verify your n8n version (≥ 1.103 recommended).
today
vs yesterday
/ last 7 days
).Add your Service Account email as Viewer/Analyst at the Property level in GA.
Scope mismatch. Examples:
defaultChannelGroup
(session scoped) × screenPageViews
(event scoped) ❌ → use sessions
or engagedSessions
.sessionSource
/sessionSourceMedium
filters also require session-scoped metrics.The node converts buckets to upcoming dates using IANA TZ and DST-safe math. If labels look off, confirm your Label Time Zone.
PRs welcome!
npm ci
npm run build
Open a PR with what changed and how to test it.
This library is published under MIT.
© 2025 prokodo. Visit us at prokodo.com.
FAQs
Google Analytics 4 via Service Account for n8n (runReport, realtime, metadata, timing helpers)
We found that @prokodo/n8n-nodes-ga4 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.