Analytics Type lowercases on save
robertsky opened this issue · 3 comments
Issue: Upon saving, the Analytics Type indicated is saved with the string in lower case. This leads to the config for the type not detected.
Example: adobeanalytics_nativeConfig
On saving: adobeanalytics_nativeconfig
My current workaround is to use the amp_post_template_analytics
filter instead. However, this issue might lead others to wonder why their analytics tag is not working properly.
Can you share the full config you are using?
Nevermind. I see it. The problem is that sanitize_key()
normalizes by lower-casing.
I suggest replacing the instances of sanitize_key( $x )
with preg_replace( '/[^a-z0-9_\-]/', '', $x )
.
Apologies for not responding sooner. Glad that you have found the cause! I hope the fix would be in the codebase sometime for other users!