From bbb146fb6e6fec3afbaec2b339e8644127fff7e8 Mon Sep 17 00:00:00 2001 From: bretg Date: Tue, 12 Jan 2021 18:08:26 -0500 Subject: [PATCH 1/3] added sampling option to enableAnalytics function --- dev-docs/publisher-api-reference.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dev-docs/publisher-api-reference.md b/dev-docs/publisher-api-reference.md index c3e11a92a2..48df7fdfec 100644 --- a/dev-docs/publisher-api-reference.md +++ b/dev-docs/publisher-api-reference.md @@ -1342,9 +1342,20 @@ Events example 4: Log errors and render fails to your own endpoint Enable sending analytics data to the analytics provider of your choice. -For usage, see [Integrate with the Prebid Analytics API]({{site.baseurl}}/dev-docs/integrate-with-the-prebid-analytics-api.html). +Each analytics adapter has their own invocation parameters. For usage, see [Integrate with the Prebid Analytics API](/dev-docs/integrate-with-the-prebid-analytics-api.html). -For a list of analytics adapters, see [Analytics for Prebid]({{site.baseurl}}/overview/analytics.html). +For a list of analytics adapters, see [Analytics for Prebid](/overview/analytics.html). + +Analytics adapters that are built in the standard way should support a `sampling` option. You'll need to check with your analytics provider to confirm +whether their system recommends the use of this parameter. They may have alternate methods of sampling. + +``` +pbjs.enableAnalytics({ + options: { + sampling: 0.25 // only call the analytics adapter this percent of the time + } +}); +```
From c1c231c6fe028e54a2f9f39bb9568903830c10c7 Mon Sep 17 00:00:00 2001 From: bretg Date: Tue, 12 Jan 2021 18:17:52 -0500 Subject: [PATCH 2/3] Update publisher-api-reference.md --- dev-docs/publisher-api-reference.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dev-docs/publisher-api-reference.md b/dev-docs/publisher-api-reference.md index 48df7fdfec..9de90a79d2 100644 --- a/dev-docs/publisher-api-reference.md +++ b/dev-docs/publisher-api-reference.md @@ -1340,23 +1340,24 @@ Events example 4: Log errors and render fails to your own endpoint ### pbjs.enableAnalytics(config) -Enable sending analytics data to the analytics provider of your choice. +Enables sending analytics data to the analytics provider of your choice. For a list of analytics adapters, see [Analytics for Prebid](/overview/analytics.html). -Each analytics adapter has their own invocation parameters. For usage, see [Integrate with the Prebid Analytics API](/dev-docs/integrate-with-the-prebid-analytics-api.html). - -For a list of analytics adapters, see [Analytics for Prebid](/overview/analytics.html). - -Analytics adapters that are built in the standard way should support a `sampling` option. You'll need to check with your analytics provider to confirm +Note that each analytics adapter has it's own invocation parameters. Analytics adapters that are built in the standard way should +support a `sampling` option. You'll need to check with your analytics provider to confirm whether their system recommends the use of this parameter. They may have alternate methods of sampling. ``` -pbjs.enableAnalytics({ +pbjs.enableAnalytics([{ + provider: "analyticsA", options: { - sampling: 0.25 // only call the analytics adapter this percent of the time + providerSpecificParams: ... + sampling: 0.25 // only call the analytics adapter this percent of the time } }); ``` +To learn how to build an analytics adapter, see [How to Add an Analytics Adapter](/dev-docs/integrate-with-the-prebid-analytics-api.html). +
From f7b26abf9b7ddf45cf1b4f1a5d59d0c68a987c76 Mon Sep 17 00:00:00 2001 From: bretg Date: Tue, 12 Jan 2021 18:18:33 -0500 Subject: [PATCH 3/3] Update publisher-api-reference.md --- dev-docs/publisher-api-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-docs/publisher-api-reference.md b/dev-docs/publisher-api-reference.md index 9de90a79d2..9f060f5885 100644 --- a/dev-docs/publisher-api-reference.md +++ b/dev-docs/publisher-api-reference.md @@ -1353,7 +1353,7 @@ pbjs.enableAnalytics([{ providerSpecificParams: ... sampling: 0.25 // only call the analytics adapter this percent of the time } -}); +}]); ``` To learn how to build an analytics adapter, see [How to Add an Analytics Adapter](/dev-docs/integrate-with-the-prebid-analytics-api.html).