diff --git a/tutorials/signals-agentic-accelerator/configure-signals.md b/tutorials/signals-agentic-accelerator/configure-signals.md index 2c7a254ec..d6f608e78 100644 --- a/tutorials/signals-agentic-accelerator/configure-signals.md +++ b/tutorials/signals-agentic-accelerator/configure-signals.md @@ -16,7 +16,7 @@ These attributes form a behavioral profile that the agent's `get_signals` tool f You need your Signals connection credentials. If you haven't set these up yet, see [connecting to Signals](/docs/signals/connection/). These are the same values you configured in the notebook's credentials cell: ```python -API_URL = 'example.signals.snowplowanalytics.com' +API_URL = 'https://YOUR_ID.signals.snowplowanalytics.com' API_KEY = '' API_KEY_ID = '' ORG_ID = '' diff --git a/tutorials/signals-agentic-accelerator/connect-demo-app.md b/tutorials/signals-agentic-accelerator/connect-demo-app.md index e62239d70..ac667ddc6 100644 --- a/tutorials/signals-agentic-accelerator/connect-demo-app.md +++ b/tutorials/signals-agentic-accelerator/connect-demo-app.md @@ -33,7 +33,7 @@ AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AGENTCORE_MEMORY_ID=your_memory_id -NEXT_PUBLIC_SNOWPLOW_SIGNALS_API_URL=https://example.signals.snowplowanalytics.com +NEXT_PUBLIC_SNOWPLOW_SIGNALS_API_URL=https://YOUR_ID.signals.snowplowanalytics.com SNOWPLOW_SIGNALS_API_KEY=your_api_key SNOWPLOW_SIGNALS_API_KEY_ID=your_api_key_id SNOWPLOW_SIGNALS_ORGANIZATION_ID=your_org_id diff --git a/tutorials/signals-ai-agent-context/setup.md b/tutorials/signals-ai-agent-context/setup.md index d75c2b604..e62388cad 100644 --- a/tutorials/signals-ai-agent-context/setup.md +++ b/tutorials/signals-ai-agent-context/setup.md @@ -68,7 +68,7 @@ AI_GATEWAY_API_KEY=your-vercel-ai-gateway-api-key NEXT_PUBLIC_SNOWPLOW_COLLECTOR_URL=https://your-collector-url.com # Snowplow Signals -SNOWPLOW_SIGNALS_BASE_URL=https://signals.snowplowanalytics.com +SNOWPLOW_SIGNALS_BASE_URL=https://YOUR_ID.signals.snowplowanalytics.com SNOWPLOW_SIGNALS_API_KEY=your-signals-api-key SNOWPLOW_SIGNALS_API_KEY_ID=your-signals-api-key-id SNOWPLOW_SIGNALS_ORG_ID=your-org-id diff --git a/tutorials/signals-google-adk-agent/project-setup.md b/tutorials/signals-google-adk-agent/project-setup.md index ef429249c..45f591c7a 100644 --- a/tutorials/signals-google-adk-agent/project-setup.md +++ b/tutorials/signals-google-adk-agent/project-setup.md @@ -63,7 +63,7 @@ AGENT_URL=http://localhost:8000 NEXT_PUBLIC_SNOWPLOW_COLLECTOR_URL=https://your-collector-url.com # Snowplow Signals (consumed server-side by the Python agent) -SNOWPLOW_SIGNALS_BASE_URL=https://signals.snowplowanalytics.com +SNOWPLOW_SIGNALS_BASE_URL=https://YOUR_ID.signals.snowplowanalytics.com SNOWPLOW_SIGNALS_API_KEY=your-signals-api-key SNOWPLOW_SIGNALS_API_KEY_ID=your-signals-api-key-id SNOWPLOW_SIGNALS_ORG_ID=your-org-id diff --git a/tutorials/signals-interventions/define-attributes-python.md b/tutorials/signals-interventions/define-attributes-python.md index 6170a659c..8ceb7863d 100644 --- a/tutorials/signals-interventions/define-attributes-python.md +++ b/tutorials/signals-interventions/define-attributes-python.md @@ -6,11 +6,6 @@ description: "Use the Signals Python SDK to programmatically define real-time ec keywords: ["signals python sdk", "ecommerce attributes"] --- -```mdx-code-block -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; -``` - In this section, you'll define [attributes](/docs/signals/concepts/#attribute-groups) that calculate real-time user behavior metrics from ecommerce events. These attributes will track product views, cart additions, and cart value. You'll create three attributes to track user shopping behavior: @@ -196,8 +191,8 @@ Once published, Signals begins calculating these attributes in real time as even You can retrieve attribute values for a specific user by calling: ```python -stream_service.get_attributes( - signals=sp_signals, +sp_signals.get_service_attributes( + name="ecom_attributes", attribute_key="domain_userid", identifier="your-domain-userid-here", # the value will be a UUID ) diff --git a/tutorials/signals-interventions/images/sandbox.png b/tutorials/signals-interventions/images/sandbox.png deleted file mode 100644 index 48c424709..000000000 Binary files a/tutorials/signals-interventions/images/sandbox.png and /dev/null differ diff --git a/tutorials/signals-ml-prospect-scoring/define-prospect-attributes.md b/tutorials/signals-ml-prospect-scoring/define-prospect-attributes.md index bf416dc4c..e32aa1fb9 100644 --- a/tutorials/signals-ml-prospect-scoring/define-prospect-attributes.md +++ b/tutorials/signals-ml-prospect-scoring/define-prospect-attributes.md @@ -16,17 +16,13 @@ Let's imagine that for this use case our data science team came up with the foll | `num_pricing_views` | Number of `page_view` events of the `/pricing` page | int | `counter` | | `num_customers_views` | Number of `page_view` events of the `*customers*` pages | int | `counter` | -## Install Signals Python SDK - -Run `%pip install snowplow-signals`. - ## Define attributes Next, define the attributes to calculate. ```python # Imports -from snowplow_signals import Attribute, Criteria, Criterion, AtomicProperty, EntityProperty +from snowplow_signals import Attribute, Criteria, Criterion, AtomicProperty, Event # Define an event sp_page_view = Event( @@ -111,7 +107,7 @@ If you're using Signals in the Console, you can test the attribute outputs on a ```python sp_signals_test = sp_signals.test( - attribute_group=user_attribute_group, + attribute_group=user_attributes_group, app_ids=["website"] ) sp_signals_test @@ -127,7 +123,7 @@ The result should look similar to this: Apply the attribute group and service configurations to Signals. ```python -applied = sp_signals.publish([user_attribute_group, prospect_scoring_tutorial_service]) +applied = sp_signals.publish([user_attributes_group, prospect_scoring_tutorial_service]) # This should print "2 objects applied" print(f"{len(applied)} objects applied") diff --git a/tutorials/signals-ml-prospect-scoring/setup.md b/tutorials/signals-ml-prospect-scoring/setup.md index 7db0224f6..e1dd92daf 100644 --- a/tutorials/signals-ml-prospect-scoring/setup.md +++ b/tutorials/signals-ml-prospect-scoring/setup.md @@ -26,4 +26,21 @@ SP_API_KEY_ID = userdata.get('SP_API_KEY_ID') # Signals API key ID SP_ORG_ID = userdata.get('SP_ORG_ID') # Snowplow org ID ``` -Once you've added the secrets, start working through the tutorial. If you prefer to run the cells in one go with Run all, update your details in the required places first - they're marked with `UPDATE THIS`. +## Connect to Signals + +Install the Signals Python SDK by running `%pip install snowplow-signals` in a notebook cell. + +Next, create the Signals client using your credentials. The rest of the tutorial uses this `sp_signals` object to test and publish configuration, and to retrieve calculated attributes. + +```python +from snowplow_signals import Signals + +sp_signals = Signals( + api_url=SP_API_URL, + api_key=SP_API_KEY, + api_key_id=SP_API_KEY_ID, + org_id=SP_ORG_ID, +) +``` + +Once you've added the secrets and connected to Signals, start working through the tutorial. If you prefer to run the cells in one go with Run all, update your details in the required places first - they're marked with `UPDATE THIS`. diff --git a/tutorials/signals-personalize-travel/defining-attributes.md b/tutorials/signals-personalize-travel/defining-attributes.md index f5f00b170..d6118a5c3 100644 --- a/tutorials/signals-personalize-travel/defining-attributes.md +++ b/tutorials/signals-personalize-travel/defining-attributes.md @@ -20,7 +20,7 @@ You'll use the Snowplow Signals Python SDK in a Jupyter notebook to define your You'll need the same connection credentials you used in the previous step: ```python -API_URL = 'example.signals.snowplowanalytics.com' +API_URL = 'https://YOUR_ID.signals.snowplowanalytics.com' API_KEY = 'YOUR_API_KEY' API_KEY_ID = 'YOUR_API_KEY_ID' ORG_ID = 'YOUR_ORG_ID' @@ -43,15 +43,15 @@ culinary_tourist_tags = ["food", "street food", "multicultural", "traditional", The notebook defines these `counter` attributes: * `page_view_count` -* `dest_page_view_count` +* `destination_page_view_count` * `family_destination_count` * `cultural_explorer` * `modern_urbanite` * `tranquil_seeker` * `family_fun` * `culinary_tourist` -* `budget_conscious` -* `luxury_inclined` +* `budget_conscious_count` +* `luxury_inclined_count` And these attributes with the `last` aggregation: diff --git a/tutorials/signals-personalize-travel/interventions.md b/tutorials/signals-personalize-travel/interventions.md index 994ed38be..dc3093b9e 100644 --- a/tutorials/signals-personalize-travel/interventions.md +++ b/tutorials/signals-personalize-travel/interventions.md @@ -15,13 +15,13 @@ Instead of waiting for users to click the chat icon, you can automatically trigg ## How it works -You'll create an intervention in Signals that triggers the agent to appear when a user has viewed more than three destination pages in a single session. This demonstrates how you can use interventions to control when an agent appears based on user behavior. +You'll create an intervention in Signals that triggers the agent to appear when a user has viewed three or more destination pages in a single session. This demonstrates how you can use interventions to control when an agent appears based on user behavior. -When the user views their fourth destination page, the agent will automatically appear and offer assistance. +When the user views their third destination page, the agent will automatically appear and offer assistance. ## Create the intervention -Open your Jupyter notebook and run the final cell. This creates an intervention based on the `dest_page_view_count` attribute. +Open your Jupyter notebook and run the final cell. This creates an intervention based on the `destination_page_view_count` attribute. ```python from snowplow_signals import RuleIntervention, InterventionCriterion, LinkAttributeKey @@ -49,7 +49,7 @@ The travel site automatically subscribes to interventions for the current user a Once you've created the intervention, test it by: 1. Navigating to the travel site -2. Viewing more than three destination pages -3. When you view the fourth page, the agent should automatically expand, rather than requiring a click, and offer assistance +2. Viewing three or more destination pages +3. When you view the third page, the agent should automatically expand, rather than requiring a click, and offer assistance This proactive approach can significantly improve user experience by providing help at the right moment based on behavioral signals. diff --git a/tutorials/signals-personalize-travel/setting-up.md b/tutorials/signals-personalize-travel/setting-up.md index eec7eb8aa..5c2e181a4 100644 --- a/tutorials/signals-personalize-travel/setting-up.md +++ b/tutorials/signals-personalize-travel/setting-up.md @@ -36,7 +36,7 @@ cp .env.example .env Edit the `.env` file with your Signals connection credentials: ```bash -NEXT_PUBLIC_SNOWPLOW_SIGNALS_API_URL=signals.snowplow.com +NEXT_PUBLIC_SNOWPLOW_SIGNALS_API_URL=https://YOUR_ID.signals.snowplowanalytics.com SNOWPLOW_SIGNALS_API_KEY= SNOWPLOW_SIGNALS_API_KEY_ID= SNOWPLOW_SIGNALS_ORGANIZATION_ID= diff --git a/tutorials/signals-personalize-travel/testing-attributes.md b/tutorials/signals-personalize-travel/testing-attributes.md index 545e303c7..0093a57da 100644 --- a/tutorials/signals-personalize-travel/testing-attributes.md +++ b/tutorials/signals-personalize-travel/testing-attributes.md @@ -27,7 +27,7 @@ Open your browser's developer console (Ctrl+Shift+I or equivalent) and navigate ![Snowplow Inspector browser extension open in Chrome DevTools showing the Events tab with 15 events on the /destinations page, including multiple Page Ping events and an SD Event for filter_tag_applied, with the detail panel showing event type, application ID (travel_bug), and timestamps](images/inspector.jpg) 1. In the **Events** tab, verify you can see page view events being sent to your collector endpoint -2. In the **Attributes** tab, check that the `page_view_count` and `dest_page_view_count` attributes have non-zero values +2. In the **Attributes** tab, check that the `page_view_count` and `destination_page_view_count` attributes have non-zero values If you're not using the Chrome extension, you can check the developer console logs instead. Note that the logs are output when the page is refreshed, so they may lag behind the values shown in the Inspector.