Skip to content

Click Event Analytics not working, bindItemClickEventsConfig missing #80

@gjportegies

Description

@gjportegies

After enabling the "Send analytics events to Tweakwise" config setting we did not see data appear in our Tweakwise dashboard.
I've done some digging and found that the bindItemClickEventsConfig parameter is not set on init and the value is undefined.

if (this.bindItemClickEventsConfig) {

The default Tweakwise Magento template looks like this:

<script type="text/x-magento-init">
    {
        "*": {
            "Tweakwise_Magento2Tweakwise/js/analytics": {
                "value": "<?= $escaper->escapeHtmlAttr($value ?? ''); ?>",
                "type": "<?= $escaper->escapeHtmlAttr($analyticsType ?? ''); ?>",
                "bindItemClickEventsConfig": {
                    "productListSelector": "<?= $escaper->escapeHtmlAttr($jsFormConfig['tweakwiseNavigationForm']['productListSelector'] ?? ''); ?>",
                    "productSelector": "<?= $escaper->escapeHtmlAttr($jsFormConfig['tweakwiseNavigationForm']['productSelector'] ?? ''); ?>",
                    "analyticsEndpoint": "<?= $escaper->escapeHtmlAttr($jsFormConfig['tweakwiseNavigationForm']['analyticsEndpoint'] ?? ''); ?>",
                    "twRequestId": "<?= $escaper->escapeHtmlAttr($jsFormConfig['tweakwiseNavigationForm']['twRequestId'] ?? ''); ?>"
                }
            }
        }
    }
</script>

The Tweakwise Hyva template looks like this, where the bindItemClickEventsConfig is missing:

<div x-data="{
    value: '<?= $escaper->escapeHtmlAttr($value); ?>',
    type: '<?= $escaper->escapeHtmlAttr($analyticsType); ?>'
}" x-init="() => {
    Tweakwise_Hyva_Analytics({
        value: value,
        type: type
    }).init();
}">
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions