Closed felixarntz closed 2 years ago
IB ✔️
colorTheme
property added as per TWG settings.promptSettings
property have style
field with either inline
or floating
value based on the TwG settings.floatingPromptProminence
property shows only for the overlay type and its value is based on the prominence setting.
The TwG JS snippet was originally configured in #5450, however the underlying TwG JS library is being updated to satisfy the additional requirements and options that need to be available for the TwG launch (for which Site Kit is already receiving the necessary options, e.g. the color customization).
Once the JS library is updated, we need to make sure to pass the configuration parameters to it correctly based on the TwG module settings in Site Kit.
This issue is effectively blocked until the updated version of the TwG JS snippet has been launched.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
buttonPosition
should be replaced with apromptSettings
object with properties:style
: This should support/use the same value as today, either "inline" or "floating".floatingPromptProminence
: This only needs to be present if the abovestyle
is "floating". It also means the corresponding module setting is either "dynamic_high" or "dynamic_low". Based on that, the supported values for this field are either "high" or "low".colorTheme
parameter should be added which should simply have the color slug from the module setting as value.thank.js
library from TwG side may not have launched yet as this issue is implemented. If so, this needs to be purely aQA: Eng
issue for the time being. Of course it will need to be launched before the eventual e2e test, preferably before the bug bash.Implementation Brief
In
includes/Modules/Thank_With_Google/Web_Tag.php
:colorTheme
setting.enqueue_twg_script
method:$twg_src
is correct, update if the new version has a new URL.buttonPosition
property withpromptSettings
, with an object as the value. This object should have the following properties:style
: Use the existingbuttonPosition
value.floatingPromptProminence
(optional): This property should be defined only whenstyle
is "floating". Check$this->cta_placement
, which should have the value "dynamic_high" or "dynamic_low" (see constantsPLACEMENT_DYNAMIC_HIGH
orPLACEMENT_DYNAMIC_LOW
). Set thefloatingPromptProminence
value to "high" or "low" accordingly.colorTheme
property with the value of thecolorTheme
setting.In
includes/Modules/Thank_With_Google.php
, update theregister_tag
method:colorTheme
setter to pass the color theme setting to the Web Tag.Test Coverage
QA Brief
SWG_BASIC
).colorTheme
property that is added with the color that you selected in the TwG settings.promptSettings
property that has thestyle
field with eitherinline
orfloating
value based on the TwG settings (for fixed type it should be inline, for overlay it should be floating).floatingPromptProminence
property only for the overlay type and its value is based on the prominence setting.Changelog entry