P
P
Polina Emelyanova2020-02-27 11:48:14
JavaScript
Polina Emelyanova, 2020-02-27 11:48:14

How to write the value from LocalStorage to the script code on the page?

Good afternoon, colleagues. Need help with data collection from lokarstorgash.)
SUBZH:
There is a landos. A link comes to it with the parameter - Facebook Pixel ID. This setting is stored in LocalStorage.
The user places an order. Goes to the thank you page.
There is a code in which it is necessary to EXPLICITLY RETURN the value from Storage.
By explicit, I mean directly putting this value into the pixel code
. A cool sketch that will show the idea more quickly -
Codepen with a sketch

How to do this?

PS
I already thought at first, in which div value to push

But here it's obviously not possible to prescribe.

So that when inspecting the code, it would be like innerHTML.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2020-02-27
@Kozack

I don't understand your problem. What's stopping you from doing something like this?
fbq('init', localStorage.getItem('pxID'));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question