feat: Add flexible item ID formatting options#5
Open
eclat-shubh wants to merge 4 commits into
Open
Conversation
This commit introduces a new feature to the Universal Conversions Variable, allowing users to select the format for product IDs sent to various platforms. Previously, the template only used the value from the 'Product ID/SKU' field. This update adds a "Product ID Format" dropdown menu with four options: - Default (uses the original 'Product ID/SKU' field) - Variant ID (uses the new 'Item Variant ID Key' field) - SKU (uses the new 'Item SKU Key' field) - Custom Shopify (builds 'shopify_MARKET_prod_var') To support this, the following new template fields were added: - `idFormatType` (the dropdown) - `keyVariantId` - `keySku` - `marketCode` A new helper function, `getFormattedId(item)`, has been created to contain this new logic. All internal functions (getItems, getContents, getContentIds, etc.) have been updated to use this helper function instead of directly accessing the original `keyId` value.
This commit introduces a new feature to the Universal Conversions Variable, allowing users to select the format for product IDs sent to various platforms. Previously, the template only used the value from the 'Product ID/SKU' field. This update adds a "Product ID Format" dropdown menu with four options: - Default (uses the original 'Product ID/SKU' field) - Variant ID (uses the new 'Item Variant ID Key' field) - SKU (uses the new 'Item SKU Key' field) - Custom Shopify (builds 'shopify_MARKET_prod_var') To support this, the following new template fields were added: - `idFormatType` (the dropdown) - `keyVariantId` - `keySku` - `marketCode` A new helper function, `getFormattedId(item)`, has been created to contain this new logic. All internal functions (getItems, getContents, getContentIds, etc.) have been updated to use this helper function instead of directly accessing the original `keyId` value.
Added a section on Product ID formatting with details on various ID options and requirements.
Contributor
|
Hi @eclat-shubh, please fix the template.tpl file. You overrode it with the GTM container .json export instead of the actual template.tpl file. |
eclat-shubh
commented
Nov 4, 2025
Author
eclat-shubh
left a comment
There was a problem hiding this comment.
Hi @giovaniortolani apologies for the mixup, I've fixed the template file now.
Contributor
|
Hi @eclat-shubh, thanks. We'll validate your suggestion and let you know. |
Author
|
hi @giovaniortolani hope you are well, just a check-in if there were any issues with validation. |
Contributor
|
Hi @eclat-shubh, it's still on our backlog. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi Stape Team,
This pull request enhances the Universal Conversions Variable by adding a new "Product ID Format" selector. This allows users to easily choose which ID to send to various platforms, which is especially useful for custom Shopify setups.
Key Changes
Adds a "Product ID Format" dropdown with four options:
Adds new template fields to support this:
keyVariantIdkeySkumarketCodeAdds a
getFormattedId(item)helper function to implement the logic.Updates all internal functions (like
getItems,getContents, etc.) to use this new helper function for consistency.Updates
README.mdandmetadata.yamlto reflect the new version and features.This change is fully backward-compatible. By default, the dropdown is set to "Default," so existing users will experience no change.
I look forward to your review!