Skip to content

Commit

Permalink
Update shopify-ab-test.mdx
Browse files Browse the repository at this point in the history
fix code for parsing stable id
  • Loading branch information
cpreid authored Jan 2, 2025
1 parent 8e2409c commit d8be4f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guides/shopify-ab-test.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Below is boilerplate custom pixel code that provides a function to send events b
*/
const stableID = (function () {
for (var key in localStorage) {
if (key.includes('statsig.stable_id.')) return localStorage.getItem(key);
if (key.includes('statsig.stable_id.')) return localStorage.getItem(key).replace(/"/gi, '');
}
})() || localStorage.getItem('STATSIG_LOCAL_STORAGE_STABLE_ID');
const statsigEvent = async (eventKey, eventValue = null, metadata = {}, userObject = {}) => {
Expand Down

0 comments on commit d8be4f6

Please sign in to comment.