Zavo
Forum Replies Created
-
Hi Thomas,
Thanks for your answer! Interesting, you are right that the data layer variable in GTM comes out fine, so all is good with your plug in. Strangely, I still get garbled text in GA, but again, since it’s fine in GTM, the issue is not on your side.
Thank you so much for taking the time to answer
Xavier
Hi Thomas,
Thanks for your answer!
In the meantime I realized that when your plugin defines the datalayer, it doesn’t overwrite the existing data layer object (when there is one), so what I just did is create the data layer above your container. That way when your plug in comes up, it just pushes new values to the data layer without overwriting the ones I had created above.
All set. Thank you!actually I should have written frontend.php, not admin.php
Forum: Plugins
In reply to: [Metronet Tag Manager] How to add custom fields to the datalayerThanks, Ronald! But where do I enter this code?
Forum: Plugins
In reply to: [Metronet Tag Manager] How to add custom fields to the datalayerHi Ronald,
Thanks for the quick reply!
Sorry, but I don’t understand this.I have custom fields on my post, for example, “Pro”.
WordPress documentation custom fields says the function to retrieve the value of fields is as follows:
get_post_meta($post_id, $key, $single);In your plug in, I entered:
“Pro” under “Name”
” get_post_meta($post_id, $key, $single);” under “Value”But on the datalayer, it just outputs ” get_post_meta($post_id, $key, $single);
“, it doesn’t actually run the function.I am interested in your plugin because I was told it allows to add custom fields data to the datalayer, but I can’t get it to work. Can you confirm that the plugin allows me to do it? If so, could you please explain how?
Thank you!!
Xavier