Calculated Values
Contents
Overview
Calculated Values execute an arbitrary expression to generate a custom value for inclusion in CSV exports, CRM integrations and search filters and results.
Expressions are written in Common Expression Language. CEL expressions can be tricky to write so don't hesitate to ask for help.
Note: Calculated Values are only available on the Enterprise plan.
Creating a Calculated Value
To create a Calculated Value, go to the Calculated Value page and click the Add New Calculated Value button. You'll need to provide the follow fields to define the Calculated Value and then click the Save button:
- Name: The name of the calculated value.
- Search Filter: Enable the checkbox to use the Calculated Value as a filter within Store Leads search.
- Expression: The expression that is evaluated against every domain. See some example expressions below.
Since expressions can be tricky to write, it helps to test the expression against a sample domain. To do so, simply click the Test Expression button.
Calculated Values in Search Results
To include Calculated Values in search results, click on the Calculated Values tab in the search result column picker. Then open the Calculated Values section and select the columns to include in search results.
Calculated Values as Search Filters
If the Search Filter option is enabled, the Calculated Value can be used as a filter for search results. Search filters are calculated nightly so you may have to wait up to 24 hours for the filter to become available. Depending on the expression, the filter may be available in Basic Search, Advanced Search or both.
Note: Using calculated values as a search filter is only available on the Enterprise plan.
Calculated Values in CSV Exports
To include Calculated Values in CSV exports, click on the Calculated Values tab in the Export dialog. Click the Add New Column button to add a one-time expression to the CSV export. Otherwise, you can address an expression in a saved Calculated Value.
Calculated Values in CRM Integrations
Calculated Values can also be used to write custom values to CRM Integrations. For more details, refer to our documentation for your CRM:
Example Expressions
Count the number of installed technologies:
has(_domain.technologies) ? _domain.technologies.size() : 0
Count the number of installed apps:
has(_domain.apps) ? _domain.apps.size() : 0
Count the number of technologies installed in the last 14 days:
has(_domain.technology_details) ? _domain.technology_details.filter(k, now - _domain.technology_details[k].installed_at < duration("336h") ).size() : 0
Count the number of apps installed in the last 14 days:
has(_domain.app_details) ? _domain.app_details.filter(k, now - _domain.app_details[k].installed_at < duration("336h") ).size() : 0
Determine whether a specific technology is installed:
has(_domain.technologies) ? _domain.technologies.contains('Affirm') : false
Filter list of technologies to only include specific technologies of interest (output as a comma-separated string):
has(_domain.technologies) ? _domain.technologies.filter(s, s in ['Collabstr', 'CreatorIQ'] ).join(',') : ''
Generate a list of unique apps and technologies installed on the domain.
Update: can now use the new app_and_tech_details attribute (see below).
( (has(_domain.technologies) ? _domain.technologies : []) + (has(_domain.app_details) ? _domain.app_details.map(k, has(_domain.app_details[k].technology) ? _domain.app_details[k].technology : _domain.app_details[k].name ) : []) ).unique().sort().join(',')
Generate a list of unique apps and technologies installed on the domain along with their install date.
(has(_domain.app_and_tech_details) ? _domain.app_and_tech_details.map(k, has(_domain.app_and_tech_details[k].installed_at) ? _domain.app_and_tech_details[k].name + "," + _domain.app_and_tech_details[k].installed_at.format("2006/01/02") : _domain.app_and_tech_details[k].name + ",unknown" ) : [] ).join(',')
Retrieving the name of the most-recently installed app or technology.
has(_domain.app_and_tech_details) && _domain.app_and_tech_details.size() > 0 ? _domain.app_and_tech_details.sort_by_installed_at("desc")[0].name : ''
Available Attributes
The following attributes are available for use within expressions. Please get in touch if you need access to additional attributes within expressions.
{ "_domain": { "about_us_page_url": "https://goodasgoldshop.com/about", "administrative_area_level_1": "Wellington", "aliases": [ "www.goodasgoldshop.com" ], "alternates": null, "app_and_tech_details": { "Afterpay": { "installed_at": "2022-01-13T05:52:09Z", "installed_at_sfdc": "2022-01-13T05:52:09+00:00", "name": "Afterpay" }, "Campaign Monitor": { "installed_at": "2023-01-19T06:36:07Z", "installed_at_sfdc": "2023-01-19T06:36:07+00:00", "name": "Campaign Monitor" }, "Cloudflare": { "installed_at": "2023-11-01T11:49:45Z", "installed_at_sfdc": "2023-11-01T11:49:45+00:00", "name": "Cloudflare" }, "Cloudflare CDN": { "installed_at": "2021-06-08T15:41:32Z", "installed_at_sfdc": "2021-06-08T15:41:32+00:00", "name": "Cloudflare CDN" }, "Craft CMS": { "installed_at": "2021-06-02T15:50:10Z", "installed_at_sfdc": "2021-06-02T15:50:10+00:00", "name": "Craft CMS" }, "Facebook Pixel": { "installed_at": "2022-09-06T10:15:05Z", "installed_at_sfdc": "2022-09-06T10:15:05+00:00", "name": "Facebook Pixel" }, "Google Analytics": { "installed_at": "2021-06-02T15:50:10Z", "installed_at_sfdc": "2021-06-02T15:50:10+00:00", "name": "Google Analytics" }, "Klaviyo": { "installed_at": "2023-01-12T16:42:49Z", "installed_at_sfdc": "2023-01-12T16:42:49+00:00", "name": "Klaviyo" }, "Trustpilot": { "installed_at": "2021-12-09T23:22:36Z", "installed_at_sfdc": "2021-12-09T23:22:36+00:00", "name": "Trustpilot" }, "Vimeo": { "name": "Vimeo", "uninstalled_at": "2023-11-01T11:49:45Z", "uninstalled_at_sfdc": "2023-11-01T11:49:45+00:00" } }, "avg_price": 0, "avg_price_usd": 0, "avg_weight": 0, "brand_advocate_page_url": "", "brands_page_url": "https://goodasgoldshop.com/brands", "categories": [ "/Apparel/Footwear" ], "city": "Wellington", "combined_followers": 2000, "contact_page_url": "https://goodasgoldshop.com/contact", "country_code": "NZ", "currency_code": "", "estimated_page_views": 0, "estimated_sales": 0, "estimated_visits": 0, "faq_page_url": "", "features": [ "Brands Page", "International Shipping", "Contact Page", "Tracking or Returns", "Tracking Page", "Has Blog", "Has CMS" ], "financing_page_url": "", "klaviyo_features": [], "language_code": "en", "localization_count": 0, "localizations": null, "max_price": 0, "merchant_name": "Good as Gold", "min_price": 0, "name": "goodasgoldshop.com", "pinterest_followers": 2000, "plan": "", "platform": "custom", "platform_rank": 23067, "postal_code": "", "product_count": 2798, "rank": 120574, "retailer_page_url": "", "returns_page_url": "", "shopify_app_names": [], "shopify_app_tokens": [], "state": "Active", "store_locator_page_url": "", "technologies": [ "Afterpay", "Campaign Monitor", "Cloudflare", "Cloudflare CDN", "Craft CMS", "Facebook Pixel", "Google Analytics", "Klaviyo", "Trustpilot" ], "technology_details": { "Afterpay": { "installed_at": "2022-01-13T05:52:09Z", "installed_at_sfdc": "2022-01-13T05:52:09+00:00", "name": "Afterpay" }, "Campaign Monitor": { "installed_at": "2023-01-19T06:36:07Z", "installed_at_sfdc": "2023-01-19T06:36:07+00:00", "name": "Campaign Monitor" }, "Cloudflare": { "installed_at": "2023-11-01T11:49:45Z", "installed_at_sfdc": "2023-11-01T11:49:45+00:00", "name": "Cloudflare" }, "Cloudflare CDN": { "installed_at": "2021-06-08T15:41:32Z", "installed_at_sfdc": "2021-06-08T15:41:32+00:00", "name": "Cloudflare CDN" }, "Craft CMS": { "installed_at": "2021-06-02T15:50:10Z", "installed_at_sfdc": "2021-06-02T15:50:10+00:00", "name": "Craft CMS" }, "Facebook Pixel": { "installed_at": "2022-09-06T10:15:05Z", "installed_at_sfdc": "2022-09-06T10:15:05+00:00", "name": "Facebook Pixel" }, "Google Analytics": { "installed_at": "2021-06-02T15:50:10Z", "installed_at_sfdc": "2021-06-02T15:50:10+00:00", "name": "Google Analytics" }, "Klaviyo": { "installed_at": "2023-01-12T16:42:49Z", "installed_at_sfdc": "2023-01-12T16:42:49+00:00", "name": "Klaviyo" }, "Trustpilot": { "installed_at": "2021-12-09T23:22:36Z", "installed_at_sfdc": "2021-12-09T23:22:36+00:00", "name": "Trustpilot" }, "Vimeo": { "name": "Vimeo", "uninstalled_at": "2023-11-01T11:49:45Z", "uninstalled_at_sfdc": "2023-11-01T11:49:45+00:00" } }, "tiktok_followers": 0, "tracking_page_url": "https://goodasgoldshop.com/shipping", "twitter_followers": 0, "warranty_page_url": "", "youtube_followers": 0 }, "now": "2024-05-03T01:27:18.599795819Z" }
CRM Attributes
If a CRM integration is enabled, attributes from the CRM can be referenced within calculated values.
With the Salesforce integration, Account fields are accessible under the _salesforce key. For instance:
With the HubSpot integration, Company properties are accessible under the _hubspot key. For instance:
As an example, the following expression returns true for Salesforce Accounts that have a Parent record.
has(_salesforce.ParentId)
Note: To use CRM attributes, the attributes need to be synchronized from the CRM into the Store Leads database. This process can take a few hours. As a result, it is not possible to interactively test expressions referencing CRM attributes if the CRM attribute has not yet been referenced in another expression (since the attribute has not yet been synchronized to the Store Leads database).