Got a solution from Shawn C. Reed:
In Page Load Rules > Adobe Analytics > Custom Page Code [Open Editor]
I typed the following:
s.purchaseID is now firing with the data held in the var 'my_cart_id'
Thanks for the help everyone!
Other ideas I've heard involve writing the custom script prefaced with var s=window.s;
I've made a Data Element from the js variable on the page and named it my_cart_id. Tried a custom script as:
s.purchaseID = _satellite.getVar('my_cart_id');
Does that look right, or should it be:
s.purchaseID = _satellite.getVar('%my_cart_id%');
Once that is saved, you can reference the Data Element in custom script (you were entering it in the right place). For example:
s.purchaseID = _satellite.getVar('name of your data element');
Right after that custom code, you may also want to use _satellite.notify('custom script fired', 1); or something like that for debugging purposes. _satellite.notify() is a protected version of console.log(). You can look in the console and make sure that script fired as expected.
Hope that helps. Let us know if that doesn't work for you.
Alternately, I've tried writing some custom scripts, but I can't seem to get any to fire.
I'm in Page Load Rule > Adobe Analytics > Custom Page Code [Open Editor] >
Am I missing anything?