Strip anchors
Function: Strip anchors
This action helps you clean up web addresses (URLs) by removing the "anchor" part. An anchor is the section of a URL that starts with a hash symbol (#) and is often used to link to a specific part of a webpage, like a heading. For example, in https://www.example.com/page#section2, #section2 is the anchor.
By stripping anchors, you get a cleaner, base URL, which can be useful for tracking, sharing, or processing URLs without specific internal page references.
Input
- Url: The complete web address from which you want to remove the anchor.
- Type: URL
- Required: Yes
- Result Variable Name: The name of the variable where the cleaned URL (without the anchor) will be stored.
- Type: VARIABLE
- Default Value:
RESULT
Output
The action will store the processed URL (without the anchor) into the variable you specified in "Result Variable Name".
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Strip anchors" action:
Example 1: Cleaning a URL for analytics
Imagine you're collecting URLs from user activity and want to analyze traffic to specific pages, regardless of which section of the page users visited.
- Inputs:
- Url:
https://www.yourwebsite.com/products/item123#reviews - Result Variable Name:
CleanedProductURL
- Url:
- Result: The variable
CleanedProductURLwill containhttps://www.yourwebsite.com/products/item123.
Example 2: Preparing a URL for external sharing
You want to share a link to a document, but you don't want the recipient to jump to a specific section; you want them to see the beginning of the document.
- Inputs:
- Url:
https://docs.company.com/guide/setup#installation-steps - Result Variable Name: (Left blank, so it defaults to
RESULT)
- Url:
- Result: The variable
RESULTwill containhttps://docs.company.com/guide/setup.
Example 3: Processing a URL that might or might not have an anchor
You have a list of URLs, some with anchors and some without, and you need a consistent base URL for all of them.
- Inputs:
- Url:
https://blog.example.com/latest-news(no anchor) - Result Variable Name:
BaseLink
- Url:
- Result: The variable
BaseLinkwill containhttps://blog.example.com/latest-news(the URL remains unchanged as there was no anchor to strip).