Smart Links: Add ITM parameters to planted Smart Links#3211
Smart Links: Add ITM parameters to planted Smart Links#3211vaurdan merged 10 commits intoadd/traffic-boostfrom
Conversation
…dd/smart-links-itm-params # Conflicts: # build/content-helper/editor-sidebar.asset.php # build/content-helper/editor-sidebar.js # src/Utils/class-utils.php
📝 WalkthroughWalkthroughThis pull request refactors smart link handling across PHP and TypeScript files. In the models, it replaces legacy URL-to-post ID logic with a direct call to a utility method and simplifies the handling of link attributes. The smart link class now uses a structured Changes
Sequence Diagram(s)sequenceDiagram
participant Panel as EditorSidebar
participant Provider as SmartLinkingProvider
participant SmartLink as Smart_Link Object
participant Utils as Utils
Panel->>Provider: Request smart links processing
Provider->>SmartLink: Retrieve smart link data
SmartLink->>Utils: Invoke get_link_href(skip_utm_params)
Utils-->>SmartLink: Return URL with appended ITM parameters
SmartLink-->>Provider: Return href object { raw, itm }
Provider-->>Panel: Provide processed smart links
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🔭 Outside diff range comments (2)
src/content-helper/editor-sidebar/smart-linking/component.tsx (2)
377-383: 🛠️ Refactor suggestionUpdate console warning to match the new href structure.
The condition now correctly uses
link.href.rawto check for self-referencing links, which aligns with the new SmartLink structure. However, the console warning message on line 379 still uses${ link.href }directly, which might now output[object Object]instead of the actual URL.if ( link.href.raw.includes( strippedPermalink ) ) { // eslint-disable-next-line no-console - console.warn( `PCH Smart Linking: Skipping self-reference link: ${ link.href }` ); + console.warn( `PCH Smart Linking: Skipping self-reference link: ${ link.href.raw }` ); return false; }
386-405:⚠️ Potential issueUpdate href equality check to use the new structure.
The code needs to be updated to use the new href structure when checking for duplicate links on line 388. Currently, it's attempting to directly compare
sl.href === link.href, but since href is now an object, this will always result in a false comparison.links = links.filter( ( link ) => { return ! smartLinks.some( ( sl ) => { - if ( sl.href === link.href ) { + if ( sl.href.raw === link.href.raw ) { // eslint-disable-next-line no-console - console.warn( `PCH Smart Linking: Skipping duplicate link: ${ link.href }` ); + console.warn( `PCH Smart Linking: Skipping duplicate link: ${ link.href.raw }` ); return true; } if ( sl.text === link.text ) { // If the offset is the same, we want to keep the link, so it can replace the old smart link. if ( sl.offset === link.offset ) { // TODO: Flag smart link as updated. return false; } // eslint-disable-next-line no-console console.warn( `PCH Smart Linking: Skipping duplicate link text: ${ link.text }` ); return true; } return false; } ); } );
🧹 Nitpick comments (1)
src/rest-api/stats/class-endpoint-posts.php (1)
218-234: Well-implemented URL validation function.The new
validate_urlsmethod properly validates that each element in the array is a valid URL using PHP'sfilter_varfunction with theFILTER_VALIDATE_URLfilter. It returns appropriate error messages when validation fails, following WordPress coding standards.Consider adding a check for empty strings as well, as
filter_varmight validate them as valid URLs in some circumstances.public function validate_urls( array $urls ) { foreach ( $urls as $url ) { - if ( false === filter_var( $url, FILTER_VALIDATE_URL ) ) { + if ( empty( $url ) || false === filter_var( $url, FILTER_VALIDATE_URL ) ) { return new WP_Error( 'invalid_param', __( 'The parameter must be a list of URLs.', 'wp-parsely' ) ); } } return true; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
build/blocks/recommendations/edit.asset.phpis excluded by!build/**build/blocks/recommendations/edit.jsis excluded by!build/**build/blocks/recommendations/view.asset.phpis excluded by!build/**build/blocks/recommendations/view.jsis excluded by!build/**build/content-helper/editor-sidebar.asset.phpis excluded by!build/**build/content-helper/editor-sidebar.jsis excluded by!build/**
📒 Files selected for processing (14)
src/Models/class-inbound-smart-link.php(5 hunks)src/Models/class-smart-link.php(3 hunks)src/Utils/class-utils.php(2 hunks)src/blocks/recommendations/components/parsely-recommendations-list.tsx(1 hunks)src/content-helper/common/utils/functions.ts(1 hunks)src/content-helper/editor-sidebar/smart-linking/component.tsx(1 hunks)src/content-helper/editor-sidebar/smart-linking/provider.ts(5 hunks)src/content-helper/editor-sidebar/smart-linking/review-modal/component-modal.tsx(6 hunks)src/content-helper/editor-sidebar/smart-linking/review-modal/component-suggestion.tsx(4 hunks)src/content-helper/editor-sidebar/smart-linking/store.ts(1 hunks)src/content-helper/editor-sidebar/smart-linking/utils.ts(5 hunks)src/rest-api/content-helper/class-endpoint-smart-linking.php(2 hunks)src/rest-api/stats/class-endpoint-posts.php(2 hunks)tests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.php(4 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.{js,ts,tsx,jsx}`: "Perform a detailed review of the provided code with following key aspects in mind: - Review the code to ensure it is well-structured and adheres to best ...
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/editor-sidebar/smart-linking/store.tssrc/content-helper/editor-sidebar/smart-linking/component.tsxsrc/blocks/recommendations/components/parsely-recommendations-list.tsxsrc/content-helper/common/utils/functions.tssrc/content-helper/editor-sidebar/smart-linking/review-modal/component-suggestion.tsxsrc/content-helper/editor-sidebar/smart-linking/review-modal/component-modal.tsxsrc/content-helper/editor-sidebar/smart-linking/utils.tssrc/content-helper/editor-sidebar/smart-linking/provider.ts
`**/*.{html,php}`: "Perform a detailed review of the provided code with following key aspects in mind: - Review the HTML and PHP code to ensure it is well-structured and adheres ...
**/*.{html,php}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the HTML and PHP code to ensure it is well-structured and adheres to best practices.
- Ensure the code follows WordPress coding standards and is well-documented.
- Confirm the code is secure and free from vulnerabilities.
- Optimize the code for performance, removing any unnecessary elements.
- Validate comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Verify code compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/rest-api/stats/class-endpoint-posts.phptests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.phpsrc/rest-api/content-helper/class-endpoint-smart-linking.phpsrc/Utils/class-utils.phpsrc/Models/class-inbound-smart-link.phpsrc/Models/class-smart-link.php
🧬 Code Definitions (5)
src/Models/class-inbound-smart-link.php (2)
src/Utils/class-utils.php (2) (2)
Utils(34-498)get_post_id_by_url(428-468)src/Models/class-smart-link.php (2) (2)
set_source_post_id(561-586)get_link_href(445-458)
src/content-helper/editor-sidebar/smart-linking/review-modal/component-suggestion.tsx (1)
src/content-helper/editor-sidebar/smart-linking/provider.ts (1) (1)
SmartLink(25-45)
src/content-helper/editor-sidebar/smart-linking/review-modal/component-modal.tsx (1)
src/content-helper/editor-sidebar/smart-linking/provider.ts (1) (1)
SmartLink(25-45)
src/content-helper/editor-sidebar/smart-linking/utils.ts (1)
src/content-helper/common/utils/functions.ts (2) (2)
removeITMParamsFromURL(103-111)addITMParamsToURL(69-92)
src/Models/class-smart-link.php (1)
src/Utils/class-utils.php (2) (2)
Utils(34-498)append_itm_params(479-497)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: E2E against WordPress latest
🔇 Additional comments (49)
src/content-helper/editor-sidebar/smart-linking/store.ts (1)
11-11: Import reorganization looks good.The import statement for
DEFAULT_MAX_LINKShas been correctly reorganized in this file.src/blocks/recommendations/components/parsely-recommendations-list.tsx (1)
21-25: Enhanced key uniqueness for React list items.The addition of the index parameter to the map function and including it in the key prop enhances the uniqueness of each list item key. This follows React best practices for efficiently rendering lists and prevents potential key duplication issues.
src/rest-api/stats/class-endpoint-posts.php (1)
181-181: Good addition of URL validation.Adding the validate_callback for the URLs parameter enhances input validation and security.
src/rest-api/content-helper/class-endpoint-smart-linking.php (5)
517-519: Good improvement in retrieving post type information.This change enhances the code by retrieving the singular name of the post type using
get_post_type_objectinstead of just returning the post type slug. This provides a more user-friendly representation in the response.
524-524: Good addition of post title to response data.Adding the post title to the response provides valuable context for the post, making the API more useful for consumers.
526-526: Good use of post type singular name.Using the post type's singular name rather than the raw post type makes the response more user-friendly and consistent with WordPress conventions.
571-577: Proper validation for the new href structure.The validation has been correctly updated to check for the new href format where it's an array with a 'raw' property. This aligns with the PR objective of supporting ITM parameters for Smart Links.
583-583: Updated href assignment to use the new structure.The code correctly uses
params['href']['raw']when updating an existing smart link, maintaining consistency with the new href structure.tests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.php (4)
268-270: Test data updated to match new href structure.The test data has been properly updated to reflect the new href structure that includes a 'raw' property, ensuring the tests align with the implementation.
310-316: Good test assertions for ITM parameters.The added assertions properly verify that the response includes both 'raw' and 'itm' properties in the href, and checks that the ITM parameters contain the expected values. This validates the core functionality introduced in this PR.
378-389: Test data updated consistently across multiple test cases.The test data for multiple smart links has been consistently updated to use the new href structure, ensuring all test cases validate the same behavior.
442-448: Comprehensive validation of ITM parameter structure.The assertions validate both the structure of the href object and the specific ITM parameters added to each smart link. This ensures the implementation is working as expected across multiple links.
src/content-helper/common/utils/functions.ts (2)
54-92: Well-implemented function for adding ITM parameters.The
addITMParamsToURLfunction is well-structured and properly documented with JSDoc comments. It correctly handles the addition of ITM parameters to a URL, with appropriate conditional checks for optional parameters.The implementation uses the URL object for proper URL manipulation, which is more robust than string concatenation.
94-111: Good implementation of ITM parameter removal.The
removeITMParamsFromURLfunction provides a clean way to remove ITM parameters from URLs. This is useful for maintaining the original URL separately from the tracking parameters, enhancing the flexibility of the Smart Links system.The function is well-documented with proper JSDoc comments including the
@sincetag.src/Utils/class-utils.php (3)
26-32: Good type definition for ITM parameters.The PHPStan type definition for
ItmParamsis well-structured and clearly defines the required and optional parameters, which helps with type safety and documentation.
442-467: Enhanced post ID retrieval from URL.The enhanced
get_post_id_by_urlmethod now attempts to derive the post ID from the URL slug when standard methods fail, making it more robust. This improvement will help in cases where the standardurl_to_postidfunction doesn't work due to custom permalink structures or other edge cases.
470-497: Well-implemented function for appending ITM parameters.The
append_itm_paramsmethod provides a clean way to append ITM parameters to URLs in PHP, complementing the TypeScript implementation. The function correctly maps the input parameters to the ITM query parameters and uses WordPress'sadd_query_argfunction for proper URL manipulation.The method is well-documented with proper PHPDoc comments including parameter types and return value.
src/Models/class-inbound-smart-link.php (5)
15-15: Added Utils namespace import for better code organization.This import is used to access the
get_post_id_by_urlmethod, which centralizes URL-to-post resolution logic.
488-492: Improved code reusability with Utils::get_post_id_by_url.This change simplifies the URL-to-post ID resolution by leveraging the centralized utility method, improving maintainability and ensuring consistent behavior across the codebase.
574-575: Enhanced link validation with ITM parameter support.The link validation now correctly checks if the link's href contains the Smart Link's href with ITM parameters by using the
get_link_href()method, ensuring consistent link matching.
728-729: Standardized href handling using get_link_href method.Replaced direct href assignment with the
get_link_href()method, ensuring consistent ITM parameter application across the codebase.
744-745: Consistent href formatting with get_link_href method.Using
get_link_href()method for the smart link anchor element ensures ITM parameters are consistently applied when creating new links.src/Models/class-smart-link.php (5)
428-435: Reintroduced update_uid method for managing smart link identifiers.The update_uid method provides a clean way to regenerate the UID for a smart link, ensuring proper identification when link properties change.
437-458: Added get_link_href method for standardized ITM parameter handling.This new method provides a centralized way to generate smart link URLs with or without ITM parameters:
- It returns the raw href when ITM parameters should be skipped
- Otherwise, it appends standard ITM parameters (campaign, source, and term) using Utils::append_itm_params
- Properly documented with since tag
This implementation ensures consistent tracking parameter application across all smart links.
684-691: Enhanced href structure in to_array method for improved tracking.The href is now returned as a structured object with:
- 'raw' property for the original URL
- 'itm' property containing the URL with ITM parameters
This change provides both the clean URL and the tracking-enabled URL to clients, offering more flexibility in how the links are used.
728-729: Updated deserialize method to support the new href structure.The method now correctly handles the structured href object by accessing the 'raw' property, maintaining backward compatibility with the updated data structure.
736-737: Updated href setting in deserialize method for consistency.Ensures that when deserializing a smart link, the 'raw' property of the href object is used consistently when updating an existing smart link.
src/content-helper/editor-sidebar/smart-linking/provider.ts (5)
23-23: Updated JSDoc to document new SmartLink properties.The comment now correctly indicates the addition of wp_post_meta and post_stats properties in version 3.18.0.
25-45: Enhanced SmartLink type with structured href and additional metadata.The SmartLink type has been improved with:
- A structured href object containing both raw and ITM-enhanced URLs
- Optional WordPress post metadata for better content display
- Optional post statistics for performance insights
These changes provide richer data for UI components and enable smarter link presentation.
167-246: Added fetchSmartLinksExtraData method for enhanced link enrichment.This method improves code organization by:
- Extracting the data enrichment logic into a dedicated function
- Fetching both post metadata and performance statistics for each link
- Correctly handling the new href structure when making API requests
- Providing proper error handling and fallbacks
The implementation properly structures the extra data into the standardized format expected by consumers.
248-277: Refactored generateSmartLinks to leverage the new data enrichment method.The method now:
- Fetches basic smart link data from the API
- Passes the results to fetchSmartLinksExtraData for enrichment
- Returns the fully enriched data
This separation of concerns improves maintainability and keeps the code DRY.
374-387: Enhanced getSmartLinks method to return enriched outbound links.The method now processes outbound links through fetchSmartLinksExtraData to provide consistent data enrichment across all API methods, ensuring a uniform data structure for consumers.
src/content-helper/editor-sidebar/smart-linking/utils.ts (6)
12-12: Updated imports to include ITM parameter utility functions.Added imports for addITMParamsToURL and removeITMParamsFromURL from the common utils, enabling consistent ITM parameter handling across the codebase.
436-439: Implemented structured href object with raw and ITM-enhanced URLs.The href is now stored as an object with two properties:
- 'raw': The URL with ITM parameters removed
- 'itm': The URL with Smart Link ITM parameters added
This provides flexibility for clients to use either version based on their requirements.
598-601: Updated link matching to handle the new href structure.Modified the link detection logic to check if the link's href includes the raw URL rather than requiring an exact match, making the validation more robust when handling URLs with different query parameters.
613-613: Updated href attribute to use ITM-enhanced URL.When restoring a missing smart link, the code now correctly sets the href attribute to the ITM-enhanced URL, ensuring proper tracking parameters are included.
749-751: Updated getAllSmartLinksURLs to use raw URLs.Modified the function to return the raw URLs without ITM parameters, providing clean URLs for API requests and comparisons.
753-769: Added addSmartLinkITMParamsToURL for consistent parameter application.This new utility function encapsulates the logic for adding standard ITM parameters to a Smart Link URL:
- Sets campaign to "parsely-pch"
- Sets source to "smart-link"
- Uses the smart link UID as the term parameter
Having this in a dedicated function ensures consistent parameter application across the codebase.
src/content-helper/editor-sidebar/smart-linking/review-modal/component-modal.tsx (6)
16-16: Good refactoring of the import statementThe import now only includes
SmartLinkfrom the provider, which aligns with the consolidated type structure. This is a cleaner approach.
86-86: Type simplification for selectedLink is appropriateThe state initialization now uses just
SmartLinktype instead of a union type, matching the consolidated link type structure in the provider.
112-112: Smart Link href structure updated correctlyThe code now correctly uses
linkSuggestion.href.itmfor the anchor href, which includes the ITM parameters as specified in the PR objectives. This allows for better tracking of smart link clicks.
296-297: Telemetry tracking properly updated to use raw URLGood adjustment of the telemetry tracking to use
selectedLink.href.rawinstead of the decorated URL with ITM parameters. This ensures analytics collect the actual destination URL.
344-345: Telemetry tracking properly updated to use raw URLGood adjustment of the telemetry tracking to use
selectedLink.href.rawinstead of the decorated URL with ITM parameters. This ensures analytics collect the actual destination URL.
372-373: Telemetry tracking properly updated to use raw URLGood adjustment of the telemetry tracking to use
selectedLink.href.rawinstead of the decorated URL with ITM parameters. This ensures analytics collect the actual destination URL.src/content-helper/editor-sidebar/smart-linking/review-modal/component-suggestion.tsx (5)
37-37: Import statement updated appropriatelyAdded
InboundSmartLinkto the imports which is needed for type checking later in the file while maintaining theSmartLinkimport for the updated component props.
109-112: JSDoc updated correctly with version informationThe JSDoc comment has been appropriately updated to indicate the addition of the post type to the link details with the correct
@sincetag, following WordPress coding standards.
113-122: Improved error handling with optional chainingGood use of optional chaining (
?.) to safely access potentially undefined properties on the link object. This prevents runtime errors and improves code robustness.The function now correctly accepts the consolidated
SmartLinktype rather than the more specificOutboundSmartLinktype.
160-178: Enhanced conditional rendering for post statsThe component now properly checks if
link.post_statsexists before attempting to render the stats section. Each individual stat is also conditionally rendered, improving the robustness of the component.
190-190: Props type updated for consistencyThe
ReviewSuggestionPropstype now correctly uses the consolidatedSmartLinktype instead of the specificOutboundSmartLinktype, maintaining consistency with the rest of the codebase.
acicovic
left a comment
There was a problem hiding this comment.
Thanks for this.
I've left some nitpicking comments, but the PR is good to merge.
tests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.php
Outdated
Show resolved
Hide resolved
tests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Alex Cicovic <23142906+acicovic@users.noreply.github.com>
# Conflicts: # build/content-helper/editor-sidebar.asset.php # build/content-helper/editor-sidebar.js
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/content-helper/common/utils/functions.ts (2)
54-93: Well-structured function with good parameter handling.The
addITMParamsToURLfunction is well-implemented with proper JSDoc documentation, including the required @SInCE tag. The function correctly handles both required and optional parameters with appropriate type definitions. The code structure follows WordPress coding standards with proper spacing and indentation.Consider adding basic URL validation and error handling to make the function more robust against invalid inputs, which could throw exceptions when creating the URL object.
export function addITMParamsToURL( url: string, itmParams: { campaign: string; source?: string; medium?: string; content?: string; term?: string; } ): string { + try { const urlObj = new URL( url ); urlObj.searchParams.set( 'itm_campaign', itmParams.campaign ); if ( itmParams.source ) { urlObj.searchParams.set( 'itm_source', itmParams.source ); } if ( itmParams.medium ) { urlObj.searchParams.set( 'itm_medium', itmParams.medium ); } if ( itmParams.content ) { urlObj.searchParams.set( 'itm_content', itmParams.content ); } if ( itmParams.term ) { urlObj.searchParams.set( 'itm_term', itmParams.term ); } return urlObj.toString(); + } catch ( error ) { + console.error( 'Invalid URL provided to addITMParamsToURL:', url ); + return url; // Return the original URL if it's invalid + } }
95-113: Well-structured function for removing ITM parameters.The
removeITMParamsFromURLfunction has proper JSDoc documentation with the required @SInCE tag and follows WordPress coding standards. Similar to theaddITMParamsToURLfunction, consider adding error handling for invalid URLs.export function removeITMParamsFromURL( url: string ): string { + try { const urlObj = new URL( url ); urlObj.searchParams.delete( 'itm_campaign' ); urlObj.searchParams.delete( 'itm_source' ); urlObj.searchParams.delete( 'itm_medium' ); urlObj.searchParams.delete( 'itm_content' ); urlObj.searchParams.delete( 'itm_term' ); return urlObj.toString(); + } catch ( error ) { + console.error( 'Invalid URL provided to removeITMParamsFromURL:', url ); + return url; // Return the original URL if it's invalid + } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/content-helper/common/utils/functions.ts(1 hunks)src/content-helper/editor-sidebar/smart-linking/provider.ts(4 hunks)src/rest-api/stats/class-endpoint-posts.php(2 hunks)tests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.php(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- src/rest-api/stats/class-endpoint-posts.php
- tests/Integration/RestAPI/ContentHelper/EndpointSmartLinkingTest.php
- src/content-helper/editor-sidebar/smart-linking/provider.ts
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,jsx}`: "Perform a detailed review of the provided code with following key aspects in mind: - Review the code to ensure it is well-structured and adheres to best ...
**/*.{js,ts,tsx,jsx}: "Perform a detailed review of the provided code with following key aspects in mind:
- Review the code to ensure it is well-structured and adheres to best practices.
- Verify compliance with WordPress coding standards.
- Ensure the code is well-documented.
- Check for security vulnerabilities and confirm the code is secure.
- Optimize the code for performance, removing any unnecessary elements.
- Validate JSDoc comments for accuracy, currency, and adherence to WordPress coding standards.
- Ensure each line comment concludes with a period.
- Confirm every JSDoc comment includes a @SInCE tag indicating the next version of the plugin to include the code.
- Guarantee compatibility with the latest version of WordPress, avoiding deprecated functions or features."
src/content-helper/common/utils/functions.ts
🔇 Additional comments (2)
src/content-helper/common/utils/functions.ts (2)
92-92: Properly implemented empty line before return statement.The empty line before the return statement improves readability, as suggested in a previous review.
112-112: Properly implemented empty line before return statement.The empty line before the return statement improves readability, as suggested in a previous review.
…ms Smart Links: Add ITM parameters to planted Smart Links" (199141e)
Description
This PR adds ITM parameters to any planted smart link, either through Smart Linking or Traffic Boost. This adds a ITM parameter with the
parsely-pchcampaign,smart-linksource, and with the Smart Link UID as the term.ITM parameter was used instead of UTM parameters, as per the Parse.ly documentation, ITM are more suited for internal traffic than UTM parameters.
Motivation and context
Track Smart Links clicks in order to calculate and assert their effectiveness.
How has this been tested?
Tested locally, and validated that existing tests, after some minor changes, are passing.
Summary by CodeRabbit
New Features
Bug Fixes