Track Link Clicks Per Workspace Using Dynamic URLS in Posts

The dynamic URL tool is a flexible way to add additional tracking to your social media program or to integrate with microsite/agent-site systems. This feature will allow you to create URL patterns that will populate based on the Workspace publishing them, leveraging custom data you have previously uploaded to Workspace Metadata.

When the Workspace user loads the Workspace Suggested Content Library, each piece of Suggested Content passes through a filter that determines whether the Workspace is configured with the fields that are in the link template. If it is, it will render a variable-replaced version of the URL template.

When the Workspace user publishes this content, an extra step occurs before saving the content that attempts to fetch the variable-replaced version of the URL template from the internet. If that is successful, the link is replaced with the variable-replaced version of the URL template.

For the example above, if the Workspace is configured with metadata that includes {"financial_times_region": "europe"}, the template will render as "http://www.ft.com/home/europe" and be passed to the publisher. When that content is published, the server will attempt to fetch "http://www.ft.com/home/europe" and as long as it receives an HTTP 200 (OK) message from the server, "http://www.ft.com" will be replaced by "http://www.ft.com/home/europe" and the content will publish with that as the value for the link.

Frequently Asked Questions

Q: Can a link template be provided without adding a normal link?

A: No. In order to utilize the link templating feature, a Workspace-independent link (what would normally be the only summarized link) must be provided. 

Q: What is the format of a valid link template?

A: A link template should look mostly like a regular link, except that in certain places there can be link template variables. There must be one or more valid link template variables for the link template to be valid.

Q: What is the format of a valid link template variable?

A link template variable consists of an open curly brace, zero or more spaces, one or more alphanumeric or underscore characters, zero or more spaces, and then a close curly brace. This is the rough translation of the regular expression that is used to determine a valid link template variable (\{\s*(\w+)\s*\}).

Examples include:

  • { internal_region_identifer }
  • {internal_region_identifier}
  • {internalRegionIdentifer}

Please note that the value inside the curly braces should be a key that is stored with the Workspace metadata.

Q: Are there any default template variable values?

A: Yes. The Dynamic URL system provides:

  • group_id - This represents the Social Workspace identifier. It is an integer value that is a unique identifier for the Workspace in the Social application.
  • reference_id - This value is set by an organization per Workspace. This will be available if it has been provided to the Social application.

These values will override metadata keys named "group_id" or "reference_id."

Q: What happens if an invalid link template is provided?

A: The Workspace Content Publisher has several layers of validation on it to ensure that only valid URL templates can be provided. If the link template is invalid, it will warn before the "Suggest" button is pressed, and an error will be returned to the dialog from the server side as well.

Q: What happens if the Workspace does not have the metadata key set?

If the link template has template variables in it that are missing from the Workspace, the link template will not be used when publishing the content for the Workspace. Instead, the Workspace-independent link will be used.

Q: What happens if the rendered link template does not resolve to a valid URL?

A: If any HTTP or DNS failure occurs during the attempt to fetch the rendered link template URL, the Workspace-independent link will be used.

Q: Can the Workspace user modify the link summary data?

A: No.

Was this article helpful?
0 out of 0 found this helpful

We're sorry to hear that.

Articles in this section

See more