Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Event Handlers #10

Open
srakl opened this issue Mar 11, 2015 · 2 comments
Open

Event Handlers #10

srakl opened this issue Mar 11, 2015 · 2 comments

Comments

@srakl
Copy link

srakl commented Mar 11, 2015

in my view, i added this

<a href="#" onclick="<?php echo Yii::app()->googleAnalytics->_setCustomVar(1, 'Section', 'Life & Style', 3); ?>"click</a>

but it echo's 1 what am i doing wrong? Thanks

@MisterPhilip
Copy link
Member

This plugin isn't meant for onclicks. Yii::app()->googleAnalytics->_setCustomVar(1, 'Section', 'Life & Style', 3); would set it in the global code and not return GA code.

@srakl
Copy link
Author

srakl commented Mar 13, 2015

you mean like this? in my controller? This doesn't work for me

public function actionAjaxGetnumber($id) {
        if (Yii::app ()->request->isAjaxRequest) {

            Yii::app()->googleAnalytics->_trackEvent($_GET['type'], "Number", $id);
                 }

sorry need help, kind of new to yii

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants