Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tutorials/signals-agentic-accelerator/configure-signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion tutorials/signals-agentic-accelerator/connect-demo-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tutorials/signals-ai-agent-context/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tutorials/signals-google-adk-agent/project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions tutorials/signals-interventions/define-attributes-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
)
Expand Down
Binary file removed tutorials/signals-interventions/images/sandbox.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand All @@ -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")
Expand Down
19 changes: 18 additions & 1 deletion tutorials/signals-ml-prospect-scoring/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
8 changes: 4 additions & 4 deletions tutorials/signals-personalize-travel/defining-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:

Expand Down
10 changes: 5 additions & 5 deletions tutorials/signals-personalize-travel/interventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion tutorials/signals-personalize-travel/setting-up.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion tutorials/signals-personalize-travel/testing-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading