From e2fa562ac6d612bbcc42b53a50da92be5724213f Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Sat, 13 Jun 2026 08:36:23 +0100 Subject: [PATCH 1/2] Add UTM parameters to 51degrees.com links Apply the standard vocabulary so the Content Team can trace traffic to its exact source: utm_source (github|code|nuget|npm|maven|packagist), utm_medium (readme|docs|example|comment|package), utm_campaign = repo name, utm_content = file path slug, utm_term = location within the file (nearest heading, enclosing member, or resource key). Normalise http, www and protocol-relative variants to https://51degrees.com in the process. --- README.md | 8 ++++---- .../examples/console/GettingStartedOnPrem.java | 10 +++++----- .../examples/console/MetadataOnPrem.java | 4 ++-- .../examples/console/OfflineProcessing.java | 6 +++--- .../examples/console/PerformanceBenchmark.java | 2 +- .../examples/console/UpdateDataFile.java | 10 +++++----- console/src/main/resources/tacCloud.xml | 4 ++-- pom.xml | 2 +- .../ipintelligence/examples/shared/DataFileHelper.java | 2 +- .../ipintelligence/examples/shared/KeyHelper.java | 8 ++++---- .../ipintelligence/examples/shared/PropertyHelper.java | 4 ++-- .../ipintelligence/examples/shared/settings.xml | 4 ++-- .../examples/web/GettingStartedWebOnPrem.java | 4 ++-- .../ipintelligence/examples/web/HtmlContentHelper.java | 2 +- 14 files changed, 35 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 9e2c4e8..5360139 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # 51Degrees IP Intelligence Engines - Examples -![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=repository&utm_content=readme_main&utm_campaign=java-open-source "Data rewards the curious") **Java IP Intelligence** +![51Degrees](https://51degrees.com/img/logo.png?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=51degrees-ip-intelligence-engines-examples "Data rewards the curious") **Java IP Intelligence** -[Developer Documentation](https://51degrees.com/ip-intelligence-java/index.html?utm_source=github&utm_medium=repository&utm_content=documentation&utm_campaign=java-open-source "developer documentation") +[Developer Documentation](https://51degrees.com/ip-intelligence-java/index.html?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=51degrees-ip-intelligence-engines-examples "developer documentation") ## Introduction @@ -68,9 +68,9 @@ documentation now reflect what is free and what needs a paid subscription. and AccuracyRadiusMin. A free resource key selecting the free tier properties can be created at -https://configure.51degrees.com/Wkqxf3Bs. A resource key that also includes +https://configure.51degrees.com/Wkqxf3Bs?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=cloud-coming-soon. A resource key that also includes the paid properties used by the examples can be created at -https://configure.51degrees.com/hYzn3TV3. See https://51degrees.com/pricing +https://configure.51degrees.com/hYzn3TV3?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=cloud-coming-soon. See https://51degrees.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=ip-intelligence-java-examples&utm_content=readme.md&utm_term=cloud-coming-soon to get a paid subscription with more properties. ### On-Premise diff --git a/console/src/main/java/fiftyone/ipintelligence/examples/console/GettingStartedOnPrem.java b/console/src/main/java/fiftyone/ipintelligence/examples/console/GettingStartedOnPrem.java index 1902dc1..a4b1336 100644 --- a/console/src/main/java/fiftyone/ipintelligence/examples/console/GettingStartedOnPrem.java +++ b/console/src/main/java/fiftyone/ipintelligence/examples/console/GettingStartedOnPrem.java @@ -34,7 +34,7 @@ * This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/GettingStartedOnPrem.java). * * This example requires an enterprise IP Intelligence data file (.ipi). - * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us). + * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=header). * * Required Maven Dependencies: * - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence) @@ -96,7 +96,7 @@ public class GettingStartedOnPrem { For production use, you will eventually need to use a Distributor service and license key to keep your data file updated. - To obtain access to enterprise data files for hosting, please contact us: https://51degrees.com/contact-us */ + To obtain access to enterprise data files for hosting, please contact us: https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=main */ public static void main(String[] args) throws Exception { configureLogback(getFilePath("logback.xml")); @@ -130,7 +130,7 @@ public static void run(String dataFile, "Please provide a valid path to an IP Intelligence data file (.ipi). " + "An explicit path can be supplied via the {} environment variable. " + "For testing, you can obtain an enterprise data file by contacting us at " + - "https://51degrees.com/contact-us", + "https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=data-file-not-found", dataFile, DataFileHelper.IPI_PATH_ENV_VAR); throw e; } @@ -139,7 +139,7 @@ public static void run(String dataFile, options contained in the file "gettingStartedOnPrem.xml". For more information about pipelines in general see the documentation at - http://51degrees.com/documentation/_concepts__configuration__builders__index.html + https://51degrees.com/documentation/_concepts__configuration__builders__index.html?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=run Note that we wrap the creation of a pipeline in a try/resources to control its lifecycle */ // the configuration file is in the resources directory @@ -207,7 +207,7 @@ private static void analyzeEvidence(Map evidence, IPIntelligenceData ipData = data.get(IPIntelligenceData.class); /* Display the results of the detection, which are called IP Intelligence properties. See the - property dictionary at https://51degrees.com/developers/property-dictionary for + property dictionary at https://51degrees.com/developers/property-dictionary?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-gettingstartedonprem.java&utm_term=analyzeevidence for details of all available properties. */ // Output all the properties using shared PropertyHelper methods diff --git a/console/src/main/java/fiftyone/ipintelligence/examples/console/MetadataOnPrem.java b/console/src/main/java/fiftyone/ipintelligence/examples/console/MetadataOnPrem.java index 7222659..ea492e5 100644 --- a/console/src/main/java/fiftyone/ipintelligence/examples/console/MetadataOnPrem.java +++ b/console/src/main/java/fiftyone/ipintelligence/examples/console/MetadataOnPrem.java @@ -55,7 +55,7 @@ * - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence) * * This example requires an enterprise IP Intelligence data file (.ipi). - * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us). + * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-metadataonprem.java&utm_term=header). */ public class MetadataOnPrem { private static final Logger logger = LoggerFactory.getLogger(GettingStartedOnPrem.class); @@ -63,7 +63,7 @@ public class MetadataOnPrem { /* In this example, by default, the 51degrees IP Intelligence data file needs to be somewhere in the project space, or you may specify another file as a command line parameter. - For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us */ + For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-metadataonprem.java&utm_term=main */ public static void main(String[] args) throws Exception { configureLogback(getFilePath("logback.xml")); diff --git a/console/src/main/java/fiftyone/ipintelligence/examples/console/OfflineProcessing.java b/console/src/main/java/fiftyone/ipintelligence/examples/console/OfflineProcessing.java index 5632919..197107e 100644 --- a/console/src/main/java/fiftyone/ipintelligence/examples/console/OfflineProcessing.java +++ b/console/src/main/java/fiftyone/ipintelligence/examples/console/OfflineProcessing.java @@ -38,7 +38,7 @@ * This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/OfflineProcessing.java). * * This example requires an enterprise IP Intelligence data file (.ipi). - * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us). + * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-offlineprocessing.java&utm_term=header). * * Required Maven Dependencies: * - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence) @@ -95,7 +95,7 @@ public class OfflineProcessing { // This 51degrees IP Intelligence data file (distributed with the source) needs to // be somewhere in the project space // - // For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us + // For testing, contact us to obtain an enterprise data file: https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-offlineprocessing.java&utm_term=datadir private static final String dataDir = "ip-intelligence-data"; // This 51degrees file of 20,000 examples (distributed with the source) // needs to be somewhere in the project space. Additional evidence files @@ -242,7 +242,7 @@ public static void run(String dataFile, InputStream is, OutputStream os) throws "limited properties and is of limited accuracy"); logger.info("The example requires an Enterprise data file " + "to work fully. Find out about the Enterprise " + - "data file here: https://51degrees.com/pricing"); + "data file here: https://51degrees.com/pricing?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-offlineprocessing.java&utm_term=enterprise-data-file"); } } } diff --git a/console/src/main/java/fiftyone/ipintelligence/examples/console/PerformanceBenchmark.java b/console/src/main/java/fiftyone/ipintelligence/examples/console/PerformanceBenchmark.java index 96ccee6..7067412 100644 --- a/console/src/main/java/fiftyone/ipintelligence/examples/console/PerformanceBenchmark.java +++ b/console/src/main/java/fiftyone/ipintelligence/examples/console/PerformanceBenchmark.java @@ -35,7 +35,7 @@ * This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/main/console/src/main/java/fiftyone/ipintelligence/examples/console/PerformanceBenchmark.java). * * This example requires an enterprise IP Intelligence data file (.ipi). - * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us). + * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-performancebenchmark.java&utm_term=header). * * Required Maven Dependencies: * - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence) diff --git a/console/src/main/java/fiftyone/ipintelligence/examples/console/UpdateDataFile.java b/console/src/main/java/fiftyone/ipintelligence/examples/console/UpdateDataFile.java index 02dbde9..6de05da 100644 --- a/console/src/main/java/fiftyone/ipintelligence/examples/console/UpdateDataFile.java +++ b/console/src/main/java/fiftyone/ipintelligence/examples/console/UpdateDataFile.java @@ -70,7 +70,7 @@ * to keep your data file updated. However, for now this example requires a custom URL where * an updated data file will be hosted. * - * To obtain access to enterprise data files, please [contact us](https://51degrees.com/contact-us). + * To obtain access to enterprise data files, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=header). * * ## Configuration * - the pipeline must be configured to use a temp file @@ -161,7 +161,7 @@ * For production use, you will eventually need to use a Distributor service and license key * to keep your data file updated. * - * To obtain access to enterprise data files for hosting, please [contact us](https://51degrees.com/contact-us). + * To obtain access to enterprise data files for hosting, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=header-2). * */ @@ -181,7 +181,7 @@ * to keep your data file updated. However, for now this example requires a custom URL where * an updated data file will be hosted. * - * To obtain access to enterprise data files, please contact us. + * To obtain access to enterprise data files, please contact us. * This license key must be supplied as a command line argument or by setting * an environment variable or system property called {@link UpdateDataFile#UPDATE_EXAMPLE_LICENSE_KEY_NAME} */ @@ -225,7 +225,7 @@ static void run(String dataFilename, String licenseKey, boolean interactive) thr logger.error("For production use, you will eventually need to use a Distributor service and " + "license key to keep your data file updated. However, for now this example requires " + "a custom URL where an updated data file will be hosted. To obtain access to enterprise " + - "data files, please contact us at https://51degrees.com/contact-us. You must supply the " + + "data files, please contact us at https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=license-key-required. You must supply the " + "license key as an argument to this program, or as an environment or system variable " + "named '{}'", UPDATE_EXAMPLE_LICENSE_KEY_NAME); throw new IllegalArgumentException("No license key available"); @@ -308,7 +308,7 @@ static void run(String dataFilename, String licenseKey, boolean interactive) thr // For production use, you will eventually need to use a Distributor service and // license key to keep your data file updated. However, for now this example // requires a custom URL where an updated data file will be hosted. - // To obtain access to enterprise data files, please contact us at https://51degrees.com/contact-us + // To obtain access to enterprise data files, please contact us at https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=console-src-main-java-fiftyone-ipintelligence-examples-console-updatedatafile.java&utm_term=run .setDataUpdateLicenseKey(licenseKey) // Enable update on startup, the auto update system // will be used to check for an update before the diff --git a/console/src/main/resources/tacCloud.xml b/console/src/main/resources/tacCloud.xml index 6fd5465..54c2b15 100644 --- a/console/src/main/resources/tacCloud.xml +++ b/console/src/main/resources/tacCloud.xml @@ -26,10 +26,10 @@ + created at https://configure.51degrees.com/hYzn3TV3?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=shared-src-main-java-fiftyone-ipintelligence-examples-shared-settings.xml&utm_term=properties. --> diff --git a/web/getting-started.onprem/src/main/java/fiftyone/ipintelligence/examples/web/GettingStartedWebOnPrem.java b/web/getting-started.onprem/src/main/java/fiftyone/ipintelligence/examples/web/GettingStartedWebOnPrem.java index 2f5f74c..5a9f0a2 100644 --- a/web/getting-started.onprem/src/main/java/fiftyone/ipintelligence/examples/web/GettingStartedWebOnPrem.java +++ b/web/getting-started.onprem/src/main/java/fiftyone/ipintelligence/examples/web/GettingStartedWebOnPrem.java @@ -34,7 +34,7 @@ * This example is available in full on [GitHub](https://github.com/51Degrees/ip-intelligence-java-examples/blob/master/web/getting-started.onprem/src/main/java/fiftyone/ipintelligence/examples/web/GettingStartedWebOnPrem.java). * * This example requires an enterprise IP Intelligence data file (.ipi). - * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us). + * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=web-getting-started.onprem-src-main-java-fiftyone-ipintelligence-examples-web-gettingstartedwebonprem.java&utm_term=header). * * Required Maven Dependencies: * - [com.51degrees:ip-intelligence](https://central.sonatype.com/artifact/com.51degrees/ip-intelligence) @@ -102,7 +102,7 @@ * The configuration file for the pipeline is at src/main/webapp/WEB-INF/51Degrees-OnPrem.xml * * This example requires an enterprise IP Intelligence data file (.ipi). - * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us). + * To obtain an enterprise data file for testing, please [contact us](https://51degrees.com/contact-us?utm_source=code&utm_medium=example&utm_campaign=ip-intelligence-java-examples&utm_content=web-getting-started.onprem-src-main-java-fiftyone-ipintelligence-examples-web-gettingstartedwebonprem.java&utm_term=gettingstartedwebonprem). */ public class GettingStartedWebOnPrem extends HttpServlet { private static final long serialVersionUID = 1734154705981153540L; diff --git a/web/shared/src/main/java/fiftyone/ipintelligence/examples/web/HtmlContentHelper.java b/web/shared/src/main/java/fiftyone/ipintelligence/examples/web/HtmlContentHelper.java index ab1c312..8b124ad 100644 --- a/web/shared/src/main/java/fiftyone/ipintelligence/examples/web/HtmlContentHelper.java +++ b/web/shared/src/main/java/fiftyone/ipintelligence/examples/web/HtmlContentHelper.java @@ -216,7 +216,7 @@ public static void doLiteRubric(PrintWriter out, FlowData flowData) { "you are using a Lite data file included with this source distribution.\n" + "

The example requires an Enterprise data file to work fully. " + "You can get the Enterprise data file " + - "here\n"); + "here\n"); } public static void doHtmlPostamble(PrintWriter out) { From 38a8a03fd6dc6a54bee549921501237716c1494c Mon Sep 17 00:00:00 2001 From: James Rosewell Date: Sat, 13 Jun 2026 08:36:31 +0100 Subject: [PATCH 2/2] Add UTM link lint workflow Run the shared utm-lint script from common-ci on pull requests and pushes to main, enforcing the UTM tagging convention on every 51degrees.com link (five parameters in order, closed vocabulary, campaign equal to the repository name, https on the bare domain, and no parameters on functional hosts). --- .github/workflows/utm-link-lint.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/utm-link-lint.yml diff --git a/.github/workflows/utm-link-lint.yml b/.github/workflows/utm-link-lint.yml new file mode 100644 index 0000000..2edc672 --- /dev/null +++ b/.github/workflows/utm-link-lint.yml @@ -0,0 +1,25 @@ +name: UTM link lint + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + utm-link-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Checkout common-ci + uses: actions/checkout@v4 + with: + repository: 51Degrees/common-ci + path: utm-lint-common-ci + + - name: Lint 51degrees.com links + shell: pwsh + run: ./utm-lint-common-ci/scripts/utm-lint.ps1 -RepoRoot .