Hi Annah,
In the jQuery onHandler extension, select "JS Code" from the drop down when setting your data source, and do something like this:
{code:javascript}
jQuery(this).attr("href").match(/(?:sku\=)(.*)(?:&)/)[1];
{code}
To explain each part of the expression in detail:
This bit is a regular expression that will match the SKU value:
{code:javascript}
/(?:sku\=)(.*)(?:&)/
{code}
... but we want only the captured SKU, so we need to address the second part of the match array (index 1), hence:
{code:javascript}
(/(?:sku\=)(.*)(?:&)/)[1] // [1] will return the 2nd match from the regex
{code}
{code:javascript}
jQuery(this).attr("href")
{code}
...will return the URL of the item you clicked on, which I'm assuming is where the string you posted originally came from.
I hope this helps - it's a bit tricky to explain without getting too verbose. Let me know if you have any questions!
Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.